text: /*! decentraland-ecs@1.0.1-20181220152036.commit-d560183 */;
  !function(t,e){for(var o in e)t[o]=e[o]}(this,function(t){var e={};function o(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=22)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CW=0]="CW",t[t.CCW=1]="CCW"}(e.Orientation||(e.Orientation={})),function(t){t[t.LOCAL=0]="LOCAL",t[t.WORLD=1]="WORLD",t[t.BONE=2]="BONE"}(e.Space||(e.Space={})),e.ToGammaSpace=1/2.2,e.ToLinearSpace=2.2,e.Epsilon=1e-6,e.DEG2RAD=Math.PI/180,e.RAD2DEG=360/(2*Math.PI)},function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},r=this&&this.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var s=o(11),a=o(8),p="__name__symbol_",u="__classId__symbol_",h="__component__id_",l=function(){function t(t,e,o){this.componentId=t,this.componentName=e,this.classId=o}return t=n([a.EventConstructor("dcl-disposable-component-created")],t)}();e.DisposableComponentCreated=l;var f=function(){function t(t){this.componentId=t}return t=n([a.EventConstructor("dcl-disposable-component-removed")],t)}();e.DisposableComponentRemoved=f;var c=function(){function t(t,e){this.componentId=t,this.component=e}return t=n([a.EventConstructor("dcl-disposable-component-updated")],t)}();function d(t,e){return function(o){if(o.isComponent)throw new TypeError("You cannot extend a component. Trying to extend "+o.originalClassName+" with: "+t);if("number"!=typeof e||isNaN(e))throw new Error("classId: "+e+" is an invalid integer");var n=o,r=function(){if(!d.engine)throw new Error("You need to set a DisposableComponent.engine before creating disposable components");var o=new(n.bind.apply(n,i([void 0],arguments))),r=s.uuid();return Object.defineProperty(o,p,{enumerable:!1,writable:!1,configurable:!1,value:t}),Object.defineProperty(o,h,{enumerable:!1,writable:!1,configurable:!1,value:r}),void 0!==e&&Object.defineProperty(o,u,{enumerable:!1,writable:!1,configurable:!1,value:e}),d.engine&&d.engine.registerComponent(o),o};return void 0!==e&&(r[u]=e),r[p]=t,r.isComponent=!0,r.isDisposableComponent=!0,r.originalClassName=t,(r.prototype=o.prototype).constructor=o,r}}e.DisposableComponentUpdated=c,e.Component=function(t,e){return function(o){if(o.isComponent)throw new TypeError("You cannot extend a component. Trying to extend "+o.originalClassName+" with: "+t);var n=o,r=function(){var o=new(n.bind.apply(n,i([void 0],arguments)));return Object.defineProperty(o,p,{enumerable:!1,writable:!1,configurable:!1,value:t}),void 0!==e&&Object.defineProperty(o,u,{enumerable:!1,writable:!1,configurable:!1,value:e}),o};return void 0!==e&&(r[u]=e),r[p]=t,r.isComponent=!0,r.originalClassName=t,(r.prototype=o.prototype).constructor=o,r}},e.DisposableComponent=d,function(t){t.engine=null}(d=e.DisposableComponent||(e.DisposableComponent={})),e.getComponentName=function(t){if(!t)throw new TypeError(t+" is not a component.");if(t[p])return t[p];throw new TypeError(t+" is not a registered component.")},e.getComponentClassId=function(t){if(!t)throw new TypeError(t+" is not a component.");if(t[u])return t[u];if(!t[p])throw new TypeError(t+" is not a registered component.");return null},e.getComponentId=function(t){if(!t)throw new TypeError(t+" is not a component.");if(t[h])return t[h];throw new TypeError(t+" is not a registered disposable component.")};var y=function(){function t(){this.dirty=!1,this.data={},this.subscriptions=[]}return t.field=function(t,e){delete t[e]&&Object.defineProperty(t,e.toString(),{get:function(){return this.data[e]},set:function(t){var o=this.data[e];if(this.data[e]=t,t!==o){this.dirty=!0;for(var n=0;n<this.subscriptions.length;n++)this.subscriptions[n](e,t,o)}},enumerable:!0})},t.readonly=function(t,e){delete t[e]&&Object.defineProperty(t,e.toString(),{get:function(){if(e in this.data==!1)throw new Error("The field "+e+" is uninitialized");return this.data[e]},set:function(t){if(e in this.data)throw new Error("The field "+e+" is readonly");this.data[e]=t},enumerable:!0,configurable:!1})},t.prototype.onChange=function(t){this.subscriptions.push(t)},t.prototype.toJSON=function(){return this.data},t}();e.ObservableComponent=y,e.isDisposableComponent=function(t){return h in t}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(6),r=o(0),i=o(9),s=o(3),a=function(){function t(t,e,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===o&&(o=0),this.x=t,this.y=e,this.z=o}return Object.defineProperty(t.prototype,"isNonUniform",{get:function(){var t=Math.abs(this.x),e=Math.abs(this.y);if(t!==e)return!0;var o=Math.abs(this.z);return t!==o||e!==o},enumerable:!0,configurable:!0}),t.Add=function(e,o){return new t(e.x,e.y,e.z).addInPlace(o)},t.GetClipFactor=function(e,o,n,r){var i=t.Dot(e,n)-r;return i/(i-(t.Dot(o,n)-r))},t.GetAngleBetweenVectors=function(e,o,r){var i=e.normalizeToRef(n.MathTmp.Vector3[1]),s=o.normalizeToRef(n.MathTmp.Vector3[2]),a=t.Dot(i,s),p=n.MathTmp.Vector3[3];return t.CrossToRef(i,s,p),t.Dot(p,r)>0?Math.acos(a):-Math.acos(a)},t.FromArray=function(e,o){return void 0===o&&(o=0),new t(e[o],e[o+1],e[o+2])},t.FromFloatArray=function(e,o){return t.FromArray(e,o)},t.FromArrayToRef=function(t,e,o){o.x=t[e],o.y=t[e+1],o.z=t[e+2]},t.FromFloatArrayToRef=function(e,o,n){return t.FromArrayToRef(e,o,n)},t.FromFloatsToRef=function(t,e,o,n){n.copyFromFloats(t,e,o)},t.Zero=function(){return new t(0,0,0)},t.One=function(){return new t(1,1,1)},t.Up=function(){return new t(0,1,0)},t.Down=function(){return new t(0,-1,0)},t.Forward=function(){return new t(0,0,1)},t.Backward=function(){return new t(0,0,-1)},t.Right=function(){return new t(1,0,0)},t.Left=function(){return new t(-1,0,0)},t.TransformCoordinates=function(e,o){var n=t.Zero();return t.TransformCoordinatesToRef(e,o,n),n},t.TransformCoordinatesToRef=function(e,o,n){return t.TransformCoordinatesFromFloatsToRef(e.x,e.y,e.z,o,n)},t.TransformCoordinatesFromFloatsToRef=function(t,e,o,n,r){var i=n.m,s=t*i[0]+e*i[4]+o*i[8]+i[12],a=t*i[1]+e*i[5]+o*i[9]+i[13],p=t*i[2]+e*i[6]+o*i[10]+i[14],u=1/(t*i[3]+e*i[7]+o*i[11]+i[15]);r.x=s*u,r.y=a*u,r.z=p*u},t.TransformNormal=function(e,o){var n=t.Zero();return t.TransformNormalToRef(e,o,n),n},t.TransformNormalToRef=function(t,e,o){this.TransformNormalFromFloatsToRef(t.x,t.y,t.z,e,o)},t.TransformNormalFromFloatsToRef=function(t,e,o,n,r){var i=n.m;r.x=t*i[0]+e*i[4]+o*i[8],r.y=t*i[1]+e*i[5]+o*i[9],r.z=t*i[2]+e*i[6]+o*i[10]},t.CatmullRom=function(e,o,n,r,i){var s=i*i,a=i*s;return new t(.5*(2*o.x+(-e.x+n.x)*i+(2*e.x-5*o.x+4*n.x-r.x)*s+(-e.x+3*o.x-3*n.x+r.x)*a),.5*(2*o.y+(-e.y+n.y)*i+(2*e.y-5*o.y+4*n.y-r.y)*s+(-e.y+3*o.y-3*n.y+r.y)*a),.5*(2*o.z+(-e.z+n.z)*i+(2*e.z-5*o.z+4*n.z-r.z)*s+(-e.z+3*o.z-3*n.z+r.z)*a))},t.Clamp=function(e,o,n){var r=new t;return t.ClampToRef(e,o,n,r),r},t.ClampToRef=function(t,e,o,n){var r=t.x;r=(r=r>o.x?o.x:r)<e.x?e.x:r;var i=t.y;i=(i=i>o.y?o.y:i)<e.y?e.y:i;var s=t.z;s=(s=s>o.z?o.z:s)<e.z?e.z:s,n.copyFromFloats(r,i,s)},t.Hermite=function(e,o,n,r,i){var s=i*i,a=i*s,p=2*a-3*s+1,u=-2*a+3*s,h=a-2*s+i,l=a-s;return new t(e.x*p+n.x*u+o.x*h+r.x*l,e.y*p+n.y*u+o.y*h+r.y*l,e.z*p+n.z*u+o.z*h+r.z*l)},t.Lerp=function(e,o,n){var r=new t(0,0,0);return t.LerpToRef(e,o,n,r),r},t.LerpToRef=function(t,e,o,n){n.x=t.x+(e.x-t.x)*o,n.y=t.y+(e.y-t.y)*o,n.z=t.z+(e.z-t.z)*o},t.Dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},t.Cross=function(e,o){var n=t.Zero();return t.CrossToRef(e,o,n),n},t.CrossToRef=function(t,e,o){var n=t.y*e.z-t.z*e.y,r=t.z*e.x-t.x*e.z,i=t.x*e.y-t.y*e.x;o.copyFromFloats(n,r,i)},t.Normalize=function(e){var o=t.Zero();return t.NormalizeToRef(e,o),o},t.NormalizeToRef=function(t,e){t.normalizeToRef(e)},t.Minimize=function(e,o){var n=new t(e.x,e.y,e.z);return n.minimizeInPlace(o),n},t.Maximize=function(e,o){var n=new t(e.x,e.y,e.z);return n.maximizeInPlace(o),n},t.Distance=function(e,o){return Math.sqrt(t.DistanceSquared(e,o))},t.DistanceSquared=function(t,e){var o=t.x-e.x,n=t.y-e.y,r=t.z-e.z;return o*o+n*n+r*r},t.Center=function(e,o){var n=t.Add(e,o);return n.scaleInPlace(.5),n},t.RotationFromAxis=function(e,o,n){var r=t.Zero();return t.RotationFromAxisToRef(e,o,n,r),r},t.RotationFromAxisToRef=function(t,e,o,r){var s=n.MathTmp.Quaternion[0];i.Quaternion.RotationQuaternionFromAxisToRef(t,e,o,s),s.toEulerAnglesToRef(r)},t.prototype.toString=function(){return"{ x: "+this.x+", y: "+this.y+", z: "+this.z+" }"},t.prototype.getClassName=function(){return"Vector3"},t.prototype.getHashCode=function(){var t=this.x||0;return t=397*(t=397*t^(this.y||0))^(this.z||0)},t.prototype.asArray=function(){var t=[];return this.toArray(t,0),t},t.prototype.toArray=function(t,e){return void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,this},t.prototype.toQuaternion=function(){return i.Quaternion.RotationYawPitchRoll(this.y,this.x,this.z)},t.prototype.addInPlace=function(t){return this.addInPlaceFromFloats(t.x,t.y,t.z)},t.prototype.addInPlaceFromFloats=function(t,e,o){return this.x+=t,this.y+=e,this.z+=o,this},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y,this.z+e.z)},t.prototype.addToRef=function(t,e){return e.copyFromFloats(this.x+t.x,this.y+t.y,this.z+t.z)},t.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y,this.z-e.z)},t.prototype.subtractToRef=function(t,e){return this.subtractFromFloatsToRef(t.x,t.y,t.z,e)},t.prototype.subtractFromFloats=function(e,o,n){return new t(this.x-e,this.y-o,this.z-n)},t.prototype.subtractFromFloatsToRef=function(t,e,o,n){return n.copyFromFloats(this.x-t,this.y-e,this.z-o)},t.prototype.negate=function(){return new t(-this.x,-this.y,-this.z)},t.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this},t.prototype.scale=function(e){return new t(this.x*e,this.y*e,this.z*e)},t.prototype.scaleToRef=function(t,e){return e.copyFromFloats(this.x*t,this.y*t,this.z*t)},t.prototype.scaleAndAddToRef=function(t,e){return e.addInPlaceFromFloats(this.x*t,this.y*t,this.z*t)},t.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z},t.prototype.equalsWithEpsilon=function(t,e){return void 0===e&&(e=r.Epsilon),t&&s.Scalar.WithinEpsilon(this.x,t.x,e)&&s.Scalar.WithinEpsilon(this.y,t.y,e)&&s.Scalar.WithinEpsilon(this.z,t.z,e)},t.prototype.equalsToFloats=function(t,e,o){return this.x===t&&this.y===e&&this.z===o},t.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},t.prototype.multiply=function(t){return this.multiplyByFloats(t.x,t.y,t.z)},t.prototype.multiplyToRef=function(t,e){return e.copyFromFloats(this.x*t.x,this.y*t.y,this.z*t.z)},t.prototype.multiplyByFloats=function(e,o,n){return new t(this.x*e,this.y*o,this.z*n)},t.prototype.divide=function(e){return new t(this.x/e.x,this.y/e.y,this.z/e.z)},t.prototype.divideToRef=function(t,e){return e.copyFromFloats(this.x/t.x,this.y/t.y,this.z/t.z)},t.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},t.prototype.minimizeInPlace=function(t){return this.minimizeInPlaceFromFloats(t.x,t.y,t.z)},t.prototype.maximizeInPlace=function(t){return this.maximizeInPlaceFromFloats(t.x,t.y,t.z)},t.prototype.minimizeInPlaceFromFloats=function(t,e,o){return t<this.x&&(this.x=t),e<this.y&&(this.y=e),o<this.z&&(this.z=o),this},t.prototype.maximizeInPlaceFromFloats=function(t,e,o){return t>this.x&&(this.x=t),e>this.y&&(this.y=e),o>this.z&&(this.z=o),this},t.prototype.floor=function(){return new t(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z))},t.prototype.fract=function(){return new t(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z))},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},t.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},t.prototype.normalize=function(){return this.normalizeFromLength(this.length())},t.prototype.normalizeFromLength=function(t){return 0===t||1===t?this:this.scaleInPlace(1/t)},t.prototype.normalizeToNew=function(){var e=new t(0,0,0);return this.normalizeToRef(e),e},t.prototype.normalizeToRef=function(t){var e=this.length();return 0===e||1===e?t.copyFromFloats(this.x,this.y,this.z):this.scaleToRef(1/e,t)},t.prototype.clone=function(){return new t(this.x,this.y,this.z)},t.prototype.copyFrom=function(t){return this.copyFromFloats(t.x,t.y,t.z)},t.prototype.copyFromFloats=function(t,e,o){return this.x=t,this.y=e,this.z=o,this},t.prototype.set=function(t,e,o){return this.copyFromFloats(t,e,o)},t.prototype.setAll=function(t){return this.x=this.y=this.z=t,this},t.prototype.rotateToRef=function(t,e){var o=this.x,n=this.y,r=this.z,i=t.w*o+t.y*r-t.z*n,s=t.w*n+t.z*o-t.x*r,a=t.w*r+t.x*n-t.y*o,p=-t.x*o-t.y*n-t.z*r;e.x=i*t.w+p*-t.x+s*-t.z-a*-t.y,e.y=s*t.w+p*-t.y+a*-t.x-i*-t.z,e.z=a*t.w+p*-t.z+i*-t.y-s*-t.x},t.prototype.rotate=function(t){return this.rotateToRef(t,this),this},t}();e.Vector3=a},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.WithinEpsilon=function(t,e,o){void 0===o&&(o=1.401298e-45);var n=t-e;return-o<=n&&n<=o},t.ToHex=function(t){var e=t.toString(16);return t<=15?("0"+e).toUpperCase():e.toUpperCase()},t.Sign=function(t){var e=+t;return 0===e||isNaN(e)?e:e>0?1:-1},t.Clamp=function(t,e,o){return void 0===e&&(e=0),void 0===o&&(o=1),Math.min(o,Math.max(e,t))},t.Log2=function(t){return Math.log(t)*Math.LOG2E},t.Repeat=function(t,e){return t-Math.floor(t/e)*e},t.Normalize=function(t,e,o){return(t-e)/(o-e)},t.Denormalize=function(t,e,o){return t*(o-e)+e},t.DeltaAngle=function(e,o){var n=t.Repeat(o-e,360);return n>180&&(n-=360),n},t.PingPong=function(e,o){var n=t.Repeat(e,2*o);return o-Math.abs(n-o)},t.SmoothStep=function(e,o,n){var r=t.Clamp(n);return o*(r=-2*r*r*r+3*r*r)+e*(1-r)},t.MoveTowards=function(e,o,n){return Math.abs(o-e)<=n?o:e+t.Sign(o-e)*n},t.MoveTowardsAngle=function(e,o,n){var r=t.DeltaAngle(e,o);return-n<r&&r<n?o:t.MoveTowards(e,e+r,n)},t.Lerp=function(t,e,o){return t+(e-t)*o},t.LerpAngle=function(e,o,n){var r=t.Repeat(o-e,360);return r>180&&(r-=360),e+r*t.Clamp(n)},t.InverseLerp=function(e,o,n){return e!==o?t.Clamp((n-e)/(o-e)):0},t.Hermite=function(t,e,o,n,r){var i=r*r,s=r*i;return t*(2*s-3*i+1)+o*(-2*s+3*i)+e*(s-2*i+r)+n*(s-i)},t.RandomRange=function(t,e){return t===e?t:Math.random()*(e-t)+t},t.RangeToPercent=function(t,e,o){return(t-e)/(o-e)},t.PercentToRange=function(t,e,o){return(o-e)*t+e},t.NormalizeRadians=function(e){return e-t.TwoPi*Math.floor((e+Math.PI)/t.TwoPi)},t.TwoPi=2*Math.PI,t}();e.Scalar=n},function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},r=this&&this.__read||function(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,r,i=o.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return s},i=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var s=o(7),a=o(1),p=o(8),u=o(23);function h(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof dcl?dcl.log.apply(dcl,i(t)):console.log.apply(console,i(["DEBUG:"],t))}function l(t,e){"undefined"!=typeof dcl?dcl.error(t,e):console.error("ERROR:",t,e)}e.log=h,e.error=l;var f=function(){function t(t){this.data=t}return t=n([p.EventConstructor("engineEvent")],t)}();e.EngineEvent=f;var c=function(){function t(){var t;this.eventManager=new p.EventManager,this.rootEntity=((t=new s.Entity(null,"scene")).uuid="0",t),this.systems=[],this.entityLists={},this.addedSystems=[],this._entities={},this._disposableComponents={},this._componentGroups={},this.simpleSystems=[],this.eventManager.addListener(s.ComponentAdded,this,this.componentAddedHandler),this.eventManager.addListener(s.ComponentRemoved,this,this.componentRemovedHandler)}return Object.defineProperty(t.prototype,"entities",{get:function(){return this._entities},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disposableComponents",{get:function(){return this._disposableComponents},enumerable:!0,configurable:!0}),t.prototype.addEntity=function(t){var e=t.getParent();t.isAddedToEngine()?h("The entity is already in the engine. Please fix this"):(t.eventManager=this.eventManager,t.engine=this,e?e.isAddedToEngine()||h("Engine: warning, added an entity with a parent not present in the engine"):t.setParent(this.rootEntity),this._entities[t.uuid]=t,this.checkRequirementsAndAdd(t),t.alive=!0)},t.prototype.removeEntity=function(t,e,o){void 0===e&&(e=!1);var n=t.uuid;if(t.isAddedToEngine()){for(var r in t.components){var i=this._componentGroups[r];if(i)for(var s in i)i[s].removeEntity(t);delete this.entityLists[r][n]}for(var a=0;a<this.simpleSystems.length;a++){var p=this.simpleSystems[a];p.onRemoveEntity&&p.onRemoveEntity(t)}if(e)for(var a in t.children){(u=t.children[a])&&this.removeEntity(u,!0)}else for(var a in t.children){var u;(u=t.children[a])&&u.setParent(o||this.rootEntity)}t.alive=!1,t.eventManager=null,delete this._entities[n]}else for(var r in h("Engine: Trying to remove non existent entity from engine."),t.isAddedToEngine()?h("Engine: Entity id: "+n):h('Engine: Entity "'+t.uuid+'" has not been added to any engine yet.'),h("Engine: Entity's components:"),t.components)h(r)},t.prototype.addSystem=function(t,e){if(void 0===e&&(e=0),-1===this.addedSystems.indexOf(t)){if(this.systems.length>0)for(var o=0;o<this.systems.length;o++){var n=this.systems[o],r=o===this.systems.length-1;if(n.priority>e){this.addedSystems.push(t),this.systems.splice(o,0,{system:t,priority:e});break}if(r){this.addedSystems.push(t),this.systems.splice(o+1,0,{system:t,priority:e});break}}else this.addedSystems.push(t),this.systems.splice(1,0,{system:t,priority:e});this.registerSystem(t)}else h("Engine: Trying to add a system that is already added. Aborting")},t.prototype.removeSystem=function(t){var e=this.addedSystems.indexOf(t);if(-1!==e){t.active=!1,t.deactivate&&t.deactivate(),this.addedSystems.splice(e,1);for(var o=0;o<this.systems.length;o++){this.systems[o].system===t&&this.systems.splice(o,1)}}},t.prototype.update=function(t){for(var e in this.systems){var o=this.systems[e].system;if(o.active&&o.update)try{o.update(t)}catch(t){l(t)}}},t.prototype.getEntitiesWithComponent=function(t){var e="string"==typeof t?t:a.getComponentName(t);return e in this.entityLists?this.entityLists[e]:this.entityLists[e]={}},t.prototype.registerComponent=function(t){var e=a.getComponentId(t),o=a.getComponentName(t),n=a.getComponentClassId(t);this._disposableComponents[e]=t,null!==n&&(this.eventManager.fireEvent(new a.DisposableComponentCreated(e,o,n)),this.eventManager.fireEvent(new a.DisposableComponentUpdated(e,t)))},t.prototype.disposeComponent=function(t){var e=a.getComponentId(t);delete this._disposableComponents[e]&&(this.eventManager.fireEvent(new a.DisposableComponentRemoved(e)),t.onDispose&&t.onDispose())},t.prototype.updateComponent=function(t){this.eventManager.fireEvent(new a.DisposableComponentUpdated(a.getComponentId(t),t))},t.prototype.getComponentGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var o=new(u.ComponentGroup.bind.apply(u.ComponentGroup,i([void 0],t)));o.active=!0;for(var n=o.requiresNames,r=0;r<n.length;r++){var s=n[r],a=this._componentGroups[s];a||(this._componentGroups[s]=a=[]),-1===a.indexOf(o)&&a.push(o)}for(var p in this._entities)this.checkRequirements(this._entities[p],o);return o},t.prototype.removeComponentGroup=function(t){if(t.active){t.active=!1;for(var e=t.requiresNames,o=0;o<e.length;o++){var n=e[o],r=this._componentGroups[n];if(r){var i=r.indexOf(t);-1!==i&&r.splice(i,1)}}}},t.prototype.registerSystem=function(t){t.active=!0,t.activate&&t.activate(this),this.simpleSystems.push(t)},t.prototype.checkRequirementsAndAdd=function(t){if(t.isAddedToEngine()){for(var e in t.components){e in this.entityLists||(this.entityLists[e]={}),this.entityLists[e][t.uuid]=t;var o=this._componentGroups[e];if(o)for(var n in o)this.checkRequirements(t,o[n])}for(var r=0;r<this.simpleSystems.length;r++){var i=this.simpleSystems[r];i.onAddEntity&&i.onAddEntity(t)}}},t.prototype.checkRequirements=function(t,e){e.meetsRequirements(t)?e.hasEntity(t)||e.addEntity(t):e.hasEntity(t)&&e.removeEntity(t)},t.prototype.componentAddedHandler=function(t){var e,o=t.entity,n=t.componentName;if(o.isAddedToEngine()){this.entityLists[n]?this.entityLists[n][o.uuid]=o:this.entityLists[n]=((e={})[o.uuid]=o,e);var r=this._componentGroups[n];if(r)for(var i in r)this.checkRequirements(o,r[i])}},t.prototype.componentRemovedHandler=function(t){var e=t.entity,o=t.componentName;if(e.isAddedToEngine()){delete this.entityLists[o][e.uuid];var n=this._componentGroups[o];if(n)for(var r in n)this.checkRequirements(e,n[r])}},t}();e.Engine=c},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(0)),n(o(6)),n(o(17)),n(o(18)),n(o(26)),n(o(27)),n(o(28)),n(o(19)),n(o(29)),n(o(30)),n(o(10)),n(o(31)),n(o(32)),n(o(20)),n(o(9)),n(o(3)),n(o(33)),n(o(14)),n(o(2)),n(o(16)),n(o(5))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(11),r=o(2),i=o(9),s=o(10);e.MathTmp={Vector3:n.buildArray(6,r.Vector3.Zero),Matrix:n.buildArray(2,s.Matrix.Identity),Quaternion:n.buildArray(3,i.Quaternion.Zero),staticUp:r.Vector3.Up(),tmpMatrix:s.Matrix.Zero()}},function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};Object.defineProperty(e,"__esModule",{value:!0});var r=o(1),i=o(4),s=o(8),a=o(11),p=function(){function t(t,e){void 0===t&&(t=null),this.name=e,this.children={},this.eventManager=null,this.alive=!1,this.uuid=a.uuid(),this.components={},this._engine=null,this._parent=null,!t&&this.engine?this._parent=this.engine.rootEntity:this._parent=t}return Object.defineProperty(t.prototype,"engine",{get:function(){return this._engine},set:function(t){this._engine=t},enumerable:!0,configurable:!0}),t.prototype.set=function(t){var e=r.getComponentName(t);this.components[e]?this.components[e]=t:this.add(t)},t.prototype.has=function(t){var e=r.getComponentName(t);return!!this.components[e]},t.prototype.get=function(t){var e="string"==typeof t?t:r.getComponentName(t);if(!this.components[e])throw new Error('Can not get component "'+e+'" from entity "'+this.identifier+'"');return this.components[e]},t.prototype.getOrNull=function(t){var e="string"==typeof t?t:r.getComponentName(t);return this.components[e]||null},t.prototype.getOrCreate=function(t){var e=r.getComponentName(t),o=this.components[e]||null;return o||(o=new t,this.set(o)),o},t.prototype.add=function(t){var e=r.getComponentName(t),o=r.getComponentClassId(t);if(this.components[e])throw new Error('A component of type "'+e+'" is already present in entity "'+this.identifier+'"');this.components[e]=t,this.eventManager&&this.eventManager.fireEvent(new h(this,e,o))},t.prototype.remove=function(t){var e=r.getComponentName(t);this.components[e]?delete this.components[e]:i.log('Entity Warning: Trying to remove inexisting component "'+e+'" from entity "'+this.identifier+'"'),this.eventManager&&this.eventManager.fireEvent(new u(this,e,t))},t.prototype.isAddedToEngine=function(){return!!(this._engine&&this.uuid in this._engine.entities)},t.prototype.setParent=function(t){var e=!t&&this.engine?this.engine.rootEntity:t,o=this.getParent();if(t===this)throw new Error('Failed to set parent for entity "'+this.identifier+"\": An entity can't set itself as a its own parent");var n=this.getCircularAncestor(t);if(n)throw new Error('Failed to set parent for entity "'+this.identifier+'": Circular parent references are not allowed (See entity "'+n+'")');o&&delete o.children[this.uuid],this._parent=e||null,this.registerAsChild(),this.eventManager&&this.engine&&this.eventManager.fireEvent(new l(this,e))},t.prototype.getParent=function(){return this._parent},Object.defineProperty(t.prototype,"identifier",{get:function(){return this.name||this.uuid},enumerable:!0,configurable:!0}),t.prototype.getCircularAncestor=function(t){for(var e=this.engine?this.engine.rootEntity:null,o=t;o&&o!==e;){var n=o.getParent();if(n===this)return o.uuid;o=n}return null},t.prototype.registerAsChild=function(){var t=this.getParent();this.uuid&&t&&(t.children[this.uuid]=this)},t}();e.Entity=p;var u=function(){function t(t,e,o){this.entity=t,this.componentName=e,this.component=o}return t=n([s.EventConstructor("dcl-component-removed")],t)}();e.ComponentRemoved=u;var h=function(){function t(t,e,o){this.entity=t,this.componentName=e,this.classId=o}return t=n([s.EventConstructor("dcl-component-added")],t)}();e.ComponentAdded=h;var l=function(){function t(t,e){this.entity=t,this.parent=e}return t=n([s.EventConstructor("dcl-parent-changed")],t)}();e.ParentChanged=l},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4),r="__event_name__",i=[];function s(t){if(!(r in t)||"string"!=typeof t[r])throw new Error("The EventConstructor is not registered");return t[r]}var a=function(){function t(){this.listeners={}}return t.prototype.addListener=function(t,e,o){if(!t||"function"!=typeof t)throw new Error("Invalid EventConstructor");var n=s(t),r=this.listeners[n];r||(r=this.listeners[n]=[]);for(var i=0;i<r.length;i++){if(r[i].listener===e)throw new Error("The provided listener is already registered")}r.push({listener:e,fn:o})},t.prototype.removeListener=function(t,e){if(!e||"function"!=typeof e)throw new Error("Invalid EventConstructor");var o=s(e),n=this.listeners[o];if(!n)return!1;for(var r=0;r<n.length;r++){if(n[r].listener===t)return n.splice(r,1),!0}return!1},t.prototype.fireEvent=function(t){var e=s(t.constructor),o=this.listeners[e];if(o)for(var r=0;r<o.length;r++)try{var i=o[r];i.fn.call(i.listener,t)}catch(t){n.error(t)}},t}();e.EventManager=a,e.EventConstructor=function(t){if(!t||"string"!=typeof t)throw new Error("Invalid event name "+t);if(-1!==i.indexOf(t))throw new Error("The event name "+t+" is already taken");return i.push(t),function(e){return e[r]=t,e}}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(10),r=o(2),i=o(6),s=o(0),a=function(){function t(t,e,o,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===o&&(o=0),void 0===n&&(n=1),this.x=t,this.y=e,this.z=o,this.w=n}return t.FromRotationMatrix=function(e){var o=new t;return t.FromRotationMatrixToRef(e,o),o},t.FromRotationMatrixToRef=function(t,e){var o,n=t.m,r=n[0],i=n[4],s=n[8],a=n[1],p=n[5],u=n[9],h=n[2],l=n[6],f=n[10],c=r+p+f;c>0?(o=.5/Math.sqrt(c+1),e.w=.25/o,e.x=(l-u)*o,e.y=(s-h)*o,e.z=(a-i)*o):r>p&&r>f?(o=2*Math.sqrt(1+r-p-f),e.w=(l-u)/o,e.x=.25*o,e.y=(i+a)/o,e.z=(s+h)/o):p>f?(o=2*Math.sqrt(1+p-r-f),e.w=(s-h)/o,e.x=(i+a)/o,e.y=.25*o,e.z=(u+l)/o):(o=2*Math.sqrt(1+f-r-p),e.w=(a-i)/o,e.x=(s+h)/o,e.y=(u+l)/o,e.z=.25*o)},t.Dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},t.AreClose=function(e,o){return t.Dot(e,o)>=0},t.Zero=function(){return new t(0,0,0,0)},t.Inverse=function(e){return new t(-e.x,-e.y,-e.z,e.w)},t.IsIdentity=function(t){return t&&0===t.x&&0===t.y&&0===t.z&&1===t.w},t.RotationAxis=function(e,o){var n=o*s.DEG2RAD;return t.RotationAxisToRef(e,n,new t)},t.RotationAxisToRef=function(t,e,o){var n=e*s.DEG2RAD,r=Math.sin(n/2);return t.normalize(),o.w=Math.cos(n/2),o.x=t.x*r,o.y=t.y*r,o.z=t.z*r,o},t.FromArray=function(e,o){return void 0===o&&(o=0),new t(e[o],e[o+1],e[o+2],e[o+3])},t.FromEulerAnglesRef=function(e,o,n,r){return t.RotationYawPitchRollToRef(o*s.DEG2RAD,e*s.DEG2RAD,n*s.DEG2RAD,r)},t.RotationYawPitchRoll=function(e,o,n){var r=new t;return t.RotationYawPitchRollToRef(e,o,n,r),r},t.RotationYawPitchRollToRef=function(t,e,o,n){var r=.5*o,i=.5*e,s=.5*t,a=Math.sin(r),p=Math.cos(r),u=Math.sin(i),h=Math.cos(i),l=Math.sin(s),f=Math.cos(s);n.x=f*u*p+l*h*a,n.y=l*h*p-f*u*a,n.z=f*h*a-l*u*p,n.w=f*h*p+l*u*a},t.RotationAlphaBetaGamma=function(e,o,n){var r=new t;return t.RotationAlphaBetaGammaToRef(e,o,n,r),r},t.RotationAlphaBetaGammaToRef=function(t,e,o,n){var r=.5*(o+t),i=.5*(o-t),s=.5*e;n.x=Math.cos(i)*Math.sin(s),n.y=Math.sin(i)*Math.sin(s),n.z=Math.sin(r)*Math.cos(s),n.w=Math.cos(r)*Math.cos(s)},t.RotationQuaternionFromAxis=function(e,o,n){var r=new t(0,0,0,0);return t.RotationQuaternionFromAxisToRef(e,o,n,r),r},t.RotationQuaternionFromAxisToRef=function(e,o,r,s){var a=i.MathTmp.Matrix[0];n.Matrix.FromXYZAxesToRef(e.normalize(),o.normalize(),r.normalize(),a),t.FromRotationMatrixToRef(a,s)},t.Slerp=function(e,o,n){var r=t.Identity;return t.SlerpToRef(e,o,n,r),r},t.SlerpToRef=function(t,e,o,n){var r,i,s=t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w,a=!1;if(s<0&&(a=!0,s=-s),s>.999999)i=1-o,r=a?-o:o;else{var p=Math.acos(s),u=1/Math.sin(p);i=Math.sin((1-o)*p)*u,r=a?-Math.sin(o*p)*u:Math.sin(o*p)*u}n.x=i*t.x+r*e.x,n.y=i*t.y+r*e.y,n.z=i*t.z+r*e.z,n.w=i*t.w+r*e.w},t.Hermite=function(e,o,n,r,i){var s=i*i,a=i*s,p=2*a-3*s+1,u=-2*a+3*s,h=a-2*s+i,l=a-s;return new t(e.x*p+n.x*u+o.x*h+r.x*l,e.y*p+n.y*u+o.y*h+r.y*l,e.z*p+n.z*u+o.z*h+r.z*l,e.w*p+n.w*u+o.w*h+r.w*l)},Object.defineProperty(t,"Identity",{get:function(){return new t(0,0,0,1)},enumerable:!0,configurable:!0}),t.Angle=function(e,o){var n=t.Dot(e,o);return 2*Math.acos(Math.min(Math.abs(n),1))*s.RAD2DEG},t.Euler=function(e,o,n){return t.RotationYawPitchRoll(o*s.DEG2RAD,e*s.DEG2RAD,n*s.DEG2RAD)},t.LookRotation=function(e,o){void 0===o&&(o=i.MathTmp.staticUp);var n=r.Vector3.Normalize(e),s=r.Vector3.Normalize(r.Vector3.Cross(o,n)),a=r.Vector3.Cross(n,s),p=s.x,u=s.y,h=s.z,l=a.x,f=a.y,c=a.z,d=n.x,y=n.y,v=n.z,m=p+f+v,b=new t;if(m>0){var g=Math.sqrt(m+1);return b.w=.5*g,g=.5/g,b.x=(c-y)*g,b.y=(d-h)*g,b.z=(u-l)*g,b}if(p>=f&&p>=v){var x=Math.sqrt(1+p-f-v),C=.5/x;return b.x=.5*x,b.y=(u+l)*C,b.z=(h+d)*C,b.w=(c-y)*C,b}if(f>v){var w=Math.sqrt(1+f-p-v),_=.5/w;return b.x=(l+u)*_,b.y=.5*w,b.z=(y+c)*_,b.w=(d-h)*_,b}var O=Math.sqrt(1+v-p-f),T=.5/O;return b.x=(d+h)*T,b.y=(y+c)*T,b.z=.5*O,b.w=(u-l)*T,b},t.RotateTowards=function(e,o,n){var r=t.Angle(e,o);if(0===r)return o;var i=Math.min(1,n/r);return t.Slerp(e,o,i)},t.FromToRotation=function(e,o){var n=new t,i=e.normalize(),a=o.normalize(),p=r.Vector3.Dot(i,a);if(p>-1+s.Epsilon){var u=Math.sqrt(2*(1+p)),h=1/u,l=r.Vector3.Cross(i,a).scaleInPlace(h);n.set(l.x,l.y,l.z,.5*u)}else{if(p>1-s.Epsilon)return new t(0,0,0,1);var f=r.Vector3.Cross(r.Vector3.Right(),i);f.lengthSquared()<s.Epsilon&&(f=r.Vector3.Cross(r.Vector3.Forward(),i)),n.set(f.x,f.y,f.z,0)}return n.normalize()},t.NormalizeAngles=function(e){return e.x=t.NormalizeAngle(e.x),e.y=t.NormalizeAngle(e.y),e.z=t.NormalizeAngle(e.z),e},t.NormalizeAngle=function(t){for(var e=t;e>=360;)e-=360;for(;e<-s.Epsilon;)e+=360;return e},Object.defineProperty(t.prototype,"eulerAngles",{get:function(){var e=this.w*this.w,o=this.x*this.x+this.y*this.y+this.z*this.z+e,n=this.x*this.w-this.y*this.z,i=new r.Vector3;if(n>.4995*o)return i.y=2*Math.atan2(this.y,this.x),i.x=Math.PI/2,i.z=0,t.NormalizeAngles(i.scaleInPlace(s.RAD2DEG));if(n<-.4995*o)return i.y=-2*Math.atan2(this.y,this.x),i.x=-Math.PI/2,i.z=0,t.NormalizeAngles(i.scaleInPlace(s.RAD2DEG));var a=new t(this.w,this.z,this.x,this.y);return i.y=Math.atan2(2*a.x*a.w+2*a.y*a.z,1-2*(a.z*a.z+a.w*a.w)),i.x=Math.asin(2*(a.x*a.z-a.w*a.y)),i.z=Math.atan2(2*a.x*a.y+2*a.z*a.w,1-2*(a.y*a.y+a.z*a.z)),t.NormalizeAngles(i.scaleInPlace(s.RAD2DEG))},set:function(e){t.RotationYawPitchRollToRef(e.y*s.DEG2RAD,e.x*s.DEG2RAD,e.z*s.DEG2RAD,this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"normalized",{get:function(){return this.normalize()},enumerable:!0,configurable:!0}),t.prototype.setFromToRotation=function(e,o,r){void 0===r&&(r=i.MathTmp.staticUp),i.MathTmp.tmpMatrix=n.Matrix.Zero(),n.Matrix.LookAtLHToRef(e,o,r,i.MathTmp.tmpMatrix),i.MathTmp.tmpMatrix.invert(),t.FromRotationMatrixToRef(i.MathTmp.tmpMatrix,this)},t.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},Object.defineProperty(t.prototype,"length",{get:function(){return Math.sqrt(this.lengthSquared)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lengthSquared",{get:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},enumerable:!0,configurable:!0}),t.prototype.getClassName=function(){return"Quaternion"},t.prototype.getHashCode=function(){var t=this.x||0;return t=397*(t=397*(t=397*t^(this.y||0))^(this.z||0))^(this.w||0)},t.prototype.asArray=function(){return[this.x,this.y,this.z,this.w]},t.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},t.prototype.clone=function(){return new t(this.x,this.y,this.z,this.w)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},t.prototype.copyFromFloats=function(t,e,o,n){return this.x=t,this.y=e,this.z=o,this.w=n,this},t.prototype.set=function(t,e,o,n){return this.copyFromFloats(t,e,o,n)},t.prototype.setEuler=function(e,o,n){return t.RotationYawPitchRollToRef(o*s.DEG2RAD,e*s.DEG2RAD,n*s.DEG2RAD,this),this},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)},t.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)},t.prototype.scale=function(e){return new t(this.x*e,this.y*e,this.z*e,this.w*e)},t.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,e.z=this.z*t,e.w=this.w*t,this},t.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},t.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,e.z+=this.z*t,e.w+=this.w*t,this},t.prototype.multiply=function(e){var o=new t(0,0,0,1);return this.multiplyToRef(e,o),o},t.prototype.multiplyToRef=function(t,e){var o=this.x*t.w+this.y*t.z-this.z*t.y+this.w*t.x,n=-this.x*t.z+this.y*t.w+this.z*t.x+this.w*t.y,r=this.x*t.y-this.y*t.x+this.z*t.w+this.w*t.z,i=-this.x*t.x-this.y*t.y-this.z*t.z+this.w*t.w;return e.copyFromFloats(o,n,r,i),this},t.prototype.multiplyInPlace=function(t){return this.multiplyToRef(t,this),this},t.prototype.conjugateToRef=function(t){return t.copyFromFloats(-this.x,-this.y,-this.z,this.w),this},t.prototype.conjugateInPlace=function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},t.prototype.conjugate=function(){return new t(-this.x,-this.y,-this.z,this.w)},t.prototype.normalize=function(){var t=1/this.length;return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},t.prototype.toEulerAnglesToRef=function(t,e){void 0===e&&(e="YZX");var o=this.z,n=this.x,r=this.y,i=this.w,s=i*i,a=o*o,p=n*n,u=r*r,h=r*o-n*i;return h<-.4999999?(t.y=2*Math.atan2(r,i),t.x=Math.PI/2,t.z=0):h>.4999999?(t.y=2*Math.atan2(r,i),t.x=-Math.PI/2,t.z=0):(t.z=Math.atan2(2*(n*r+o*i),-a-p+u+s),t.x=Math.asin(-2*(o*r-n*i)),t.y=Math.atan2(2*(o*n+r*i),a-p-u+s)),this},t.prototype.angleAxis=function(e,o){if(0===o.lengthSquared())return t.Identity;var n=t.Identity,r=e*s.DEG2RAD;r*=.5;var i=o.normalize();return i=o.scaleInPlace(Math.sin(r)),n.x=i.x,n.y=i.y,n.z=i.z,n.w=Math.cos(r),n.normalize()},t.prototype.toRotationMatrix=function(t){return n.Matrix.FromQuaternionToRef(this,t),this},t.prototype.fromRotationMatrix=function(e){return t.FromRotationMatrixToRef(e,this),this},t}();e.Quaternion=a},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(9),i=o(6),s=o(16),a=function(){function t(){this._isIdentity=!1,this._isIdentityDirty=!0,this._isIdentity3x2=!0,this._isIdentity3x2Dirty=!0,this._m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this._updateIdentityStatus(!1)}return Object.defineProperty(t.prototype,"m",{get:function(){return this._m},enumerable:!0,configurable:!0}),Object.defineProperty(t,"IdentityReadOnly",{get:function(){return t._identityReadOnly},enumerable:!0,configurable:!0}),t.FromArray=function(e,o){void 0===o&&(o=0);var n=new t;return t.FromArrayToRef(e,o,n),n},t.FromArrayToRef=function(t,e,o){for(var n=0;n<16;n++)o._m[n]=t[n+e];o._markAsUpdated()},t.FromFloatArrayToRefScaled=function(t,e,o,n){for(var r=0;r<16;r++)n._m[r]=t[r+e]*o;n._markAsUpdated()},t.FromValuesToRef=function(t,e,o,n,r,i,s,a,p,u,h,l,f,c,d,y,v){var m=v._m;m[0]=t,m[1]=e,m[2]=o,m[3]=n,m[4]=r,m[5]=i,m[6]=s,m[7]=a,m[8]=p,m[9]=u,m[10]=h,m[11]=l,m[12]=f,m[13]=c,m[14]=d,m[15]=y,v._markAsUpdated()},t.FromValues=function(e,o,n,r,i,s,a,p,u,h,l,f,c,d,y,v){var m=new t,b=m._m;return b[0]=e,b[1]=o,b[2]=n,b[3]=r,b[4]=i,b[5]=s,b[6]=a,b[7]=p,b[8]=u,b[9]=h,b[10]=l,b[11]=f,b[12]=c,b[13]=d,b[14]=y,b[15]=v,m._markAsUpdated(),m},t.Compose=function(e,o,n){var r=new t;return t.ComposeToRef(e,o,n,r),r},t.ComposeToRef=function(e,o,n,r){t.ScalingToRef(e.x,e.y,e.z,i.MathTmp.Matrix[1]),o.toRotationMatrix(i.MathTmp.Matrix[0]),i.MathTmp.Matrix[1].multiplyToRef(i.MathTmp.Matrix[0],r),r.setTranslation(n)},t.Identity=function(){var e=t.FromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return e._updateIdentityStatus(!0),e},t.IdentityToRef=function(e){t.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,e),e._updateIdentityStatus(!0)},t.Zero=function(){var e=t.FromValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);return e._updateIdentityStatus(!1),e},t.RotationX=function(e){var o=new t;return t.RotationXToRef(e,o),o},t.Invert=function(e){var o=new t;return e.invertToRef(o),o},t.RotationXToRef=function(e,o){var n=Math.sin(e),r=Math.cos(e);t.FromValuesToRef(1,0,0,0,0,r,n,0,0,-n,r,0,0,0,0,1,o),o._updateIdentityStatus(1===r&&0===n)},t.RotationY=function(e){var o=new t;return t.RotationYToRef(e,o),o},t.RotationYToRef=function(e,o){var n=Math.sin(e),r=Math.cos(e);t.FromValuesToRef(r,0,-n,0,0,1,0,0,n,0,r,0,0,0,0,1,o),o._updateIdentityStatus(1===r&&0===n)},t.RotationZ=function(e){var o=new t;return t.RotationZToRef(e,o),o},t.RotationZToRef=function(e,o){var n=Math.sin(e),r=Math.cos(e);t.FromValuesToRef(r,n,0,0,-n,r,0,0,0,0,1,0,0,0,0,1,o),o._updateIdentityStatus(1===r&&0===n)},t.RotationAxis=function(e,o){var n=new t;return t.RotationAxisToRef(e,o,n),n},t.RotationAxisToRef=function(t,e,o){var n=Math.sin(-e),r=Math.cos(-e),i=1-r;t.normalize();var s=o._m;s[0]=t.x*t.x*i+r,s[1]=t.x*t.y*i-t.z*n,s[2]=t.x*t.z*i+t.y*n,s[3]=0,s[4]=t.y*t.x*i+t.z*n,s[5]=t.y*t.y*i+r,s[6]=t.y*t.z*i-t.x*n,s[7]=0,s[8]=t.z*t.x*i-t.y*n,s[9]=t.z*t.y*i+t.x*n,s[10]=t.z*t.z*i+r,s[11]=0,s[12]=0,s[13]=0,s[14]=0,s[15]=1,o._markAsUpdated()},t.RotationYawPitchRoll=function(e,o,n){var r=new t;return t.RotationYawPitchRollToRef(e,o,n,r),r},t.RotationYawPitchRollToRef=function(t,e,o,n){r.Quaternion.RotationYawPitchRollToRef(t,e,o,i.MathTmp.Quaternion[0]),i.MathTmp.Quaternion[0].toRotationMatrix(n)},t.Scaling=function(e,o,n){var r=new t;return t.ScalingToRef(e,o,n,r),r},t.ScalingToRef=function(e,o,n,r){t.FromValuesToRef(e,0,0,0,0,o,0,0,0,0,n,0,0,0,0,1,r),r._updateIdentityStatus(1===e&&1===o&&1===n)},t.Translation=function(e,o,n){var r=new t;return t.TranslationToRef(e,o,n,r),r},t.TranslationToRef=function(e,o,n,r){t.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e,o,n,1,r),r._updateIdentityStatus(0===e&&0===o&&0===n)},t.Lerp=function(e,o,n){var r=new t;return t.LerpToRef(e,o,n,r),r},t.LerpToRef=function(t,e,o,n){for(var r=0;r<16;r++)n._m[r]=t._m[r]*(1-o)+e._m[r]*o;n._markAsUpdated()},t.DecomposeLerp=function(e,o,n){var r=new t;return t.DecomposeLerpToRef(e,o,n,r),r},t.DecomposeLerpToRef=function(e,o,s,a){var p=i.MathTmp.Vector3[0],u=i.MathTmp.Quaternion[0],h=i.MathTmp.Vector3[1];e.decompose(p,u,h);var l=i.MathTmp.Vector3[2],f=i.MathTmp.Quaternion[1],c=i.MathTmp.Vector3[3];o.decompose(l,f,c);var d=i.MathTmp.Vector3[4];n.Vector3.LerpToRef(p,l,s,d);var y=i.MathTmp.Quaternion[2];r.Quaternion.SlerpToRef(u,f,s,y);var v=i.MathTmp.Vector3[5];n.Vector3.LerpToRef(h,c,s,v),t.ComposeToRef(d,y,v,a)},t.LookAtLH=function(e,o,n){var r=new t;return t.LookAtLHToRef(e,o,n,r),r},t.LookAtLHToRef=function(e,o,r,s){var a=i.MathTmp.Vector3[0],p=i.MathTmp.Vector3[1],u=i.MathTmp.Vector3[2];o.subtractToRef(e,u),u.normalize(),n.Vector3.CrossToRef(r,u,a);var h=a.lengthSquared();0===h?a.x=1:a.normalizeFromLength(Math.sqrt(h)),n.Vector3.CrossToRef(u,a,p),p.normalize();var l=-n.Vector3.Dot(a,e),f=-n.Vector3.Dot(p,e),c=-n.Vector3.Dot(u,e);t.FromValuesToRef(a.x,p.x,u.x,0,a.y,p.y,u.y,0,a.z,p.z,u.z,0,l,f,c,1,s)},t.LookAtRH=function(e,o,n){var r=new t;return t.LookAtRHToRef(e,o,n,r),r},t.LookAtRHToRef=function(e,o,r,s){var a=i.MathTmp.Vector3[0],p=i.MathTmp.Vector3[1],u=i.MathTmp.Vector3[2];e.subtractToRef(o,u),u.normalize(),n.Vector3.CrossToRef(r,u,a);var h=a.lengthSquared();0===h?a.x=1:a.normalizeFromLength(Math.sqrt(h)),n.Vector3.CrossToRef(u,a,p),p.normalize();var l=-n.Vector3.Dot(a,e),f=-n.Vector3.Dot(p,e),c=-n.Vector3.Dot(u,e);t.FromValuesToRef(a.x,p.x,u.x,0,a.y,p.y,u.y,0,a.z,p.z,u.z,0,l,f,c,1,s)},t.OrthoLH=function(e,o,n,r){var i=new t;return t.OrthoLHToRef(e,o,n,r,i),i},t.OrthoLHToRef=function(e,o,n,r,i){var s=2/e,a=2/o,p=2/(r-n),u=-(r+n)/(r-n);t.FromValuesToRef(s,0,0,0,0,a,0,0,0,0,p,0,0,0,u,1,i),i._updateIdentityStatus(1===s&&1===a&&1===p&&0===u)},t.OrthoOffCenterLH=function(e,o,n,r,i,s){var a=new t;return t.OrthoOffCenterLHToRef(e,o,n,r,i,s,a),a},t.OrthoOffCenterLHToRef=function(e,o,n,r,i,s,a){var p=2/(o-e),u=2/(r-n),h=2/(s-i),l=-(s+i)/(s-i),f=(e+o)/(e-o),c=(r+n)/(n-r);t.FromValuesToRef(p,0,0,0,0,u,0,0,0,0,h,0,f,c,l,1,a),a._markAsUpdated()},t.OrthoOffCenterRH=function(e,o,n,r,i,s){var a=new t;return t.OrthoOffCenterRHToRef(e,o,n,r,i,s,a),a},t.OrthoOffCenterRHToRef=function(e,o,n,r,i,s,a){t.OrthoOffCenterLHToRef(e,o,n,r,i,s,a),a._m[10]*=-1},t.PerspectiveLH=function(e,o,n,r){var i=new t,s=2*n/e,a=2*n/o,p=(r+n)/(r-n),u=-2*r*n/(r-n);return t.FromValuesToRef(s,0,0,0,0,a,0,0,0,0,p,1,0,0,u,0,i),i._updateIdentityStatus(!1),i},t.PerspectiveFovLH=function(e,o,n,r){var i=new t;return t.PerspectiveFovLHToRef(e,o,n,r,i),i},t.PerspectiveFovLHToRef=function(e,o,n,r,i,s){void 0===s&&(s=!0);var a=n,p=r,u=1/Math.tan(.5*e),h=s?u/o:u,l=s?u:u*o,f=(p+a)/(p-a),c=-2*p*a/(p-a);t.FromValuesToRef(h,0,0,0,0,l,0,0,0,0,f,1,0,0,c,0,i),i._updateIdentityStatus(!1)},t.PerspectiveFovRH=function(e,o,n,r){var i=new t;return t.PerspectiveFovRHToRef(e,o,n,r,i),i},t.PerspectiveFovRHToRef=function(e,o,n,r,i,s){void 0===s&&(s=!0);var a=n,p=r,u=1/Math.tan(.5*e),h=s?u/o:u,l=s?u:u*o,f=-(p+a)/(p-a),c=-2*p*a/(p-a);t.FromValuesToRef(h,0,0,0,0,l,0,0,0,0,f,-1,0,0,c,0,i),i._updateIdentityStatus(!1)},t.PerspectiveFovWebVRToRef=function(t,e,o,n,r){void 0===r&&(r=!1);var i=r?-1:1,s=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),p=Math.tan(t.leftDegrees*Math.PI/180),u=Math.tan(t.rightDegrees*Math.PI/180),h=2/(p+u),l=2/(s+a),f=n._m;f[0]=h,f[1]=f[2]=f[3]=f[4]=0,f[5]=l,f[6]=f[7]=0,f[8]=(p-u)*h*.5,f[9]=-(s-a)*l*.5,f[10]=-o/(e-o),f[11]=1*i,f[12]=f[13]=f[15]=0,f[14]=-2*o*e/(o-e),n._markAsUpdated()},t.GetAsMatrix2x2=function(t){return[t._m[0],t._m[1],t._m[4],t._m[5]]},t.GetAsMatrix3x3=function(t){return[t._m[0],t._m[1],t._m[2],t._m[4],t._m[5],t._m[6],t._m[8],t._m[9],t._m[10]]},t.Transpose=function(e){var o=new t;return t.TransposeToRef(e,o),o},t.TransposeToRef=function(t,e){var o=e._m,n=t._m;o[0]=n[0],o[1]=n[4],o[2]=n[8],o[3]=n[12],o[4]=n[1],o[5]=n[5],o[6]=n[9],o[7]=n[13],o[8]=n[2],o[9]=n[6],o[10]=n[10],o[11]=n[14],o[12]=n[3],o[13]=n[7],o[14]=n[11],o[15]=n[15],e._updateIdentityStatus(t._isIdentity,t._isIdentityDirty)},t.Reflection=function(e){var o=new t;return t.ReflectionToRef(e,o),o},t.ReflectionToRef=function(e,o){e.normalize();var n=e.normal.x,r=e.normal.y,i=e.normal.z,s=-2*n,a=-2*r,p=-2*i;t.FromValuesToRef(s*n+1,a*n,p*n,0,s*r,a*r+1,p*r,0,s*i,a*i,p*i+1,0,s*e.d,a*e.d,p*e.d,1,o)},t.FromXYZAxesToRef=function(e,o,n,r){t.FromValuesToRef(e.x,e.y,e.z,0,o.x,o.y,o.z,0,n.x,n.y,n.z,0,0,0,0,1,r)},t.FromQuaternionToRef=function(t,e){var o=t.x*t.x,n=t.y*t.y,r=t.z*t.z,i=t.x*t.y,s=t.z*t.w,a=t.z*t.x,p=t.y*t.w,u=t.y*t.z,h=t.x*t.w;e._m[0]=1-2*(n+r),e._m[1]=2*(i+s),e._m[2]=2*(a-p),e._m[3]=0,e._m[4]=2*(i-s),e._m[5]=1-2*(r+o),e._m[6]=2*(u+h),e._m[7]=0,e._m[8]=2*(a+p),e._m[9]=2*(u-h),e._m[10]=1-2*(n+o),e._m[11]=0,e._m[12]=0,e._m[13]=0,e._m[14]=0,e._m[15]=1,e._markAsUpdated()},t.prototype._markAsUpdated=function(){this.updateFlag=t._updateFlagSeed++,this._isIdentity=!1,this._isIdentity3x2=!1,this._isIdentityDirty=!0,this._isIdentity3x2Dirty=!0},t.prototype.isIdentity=function(){if(this._isIdentityDirty){this._isIdentityDirty=!1;var t=this._m;this._isIdentity=1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&1===t[5]&&0===t[6]&&0===t[7]&&0===t[8]&&0===t[9]&&1===t[10]&&0===t[11]&&0===t[12]&&0===t[13]&&0===t[14]&&1===t[15]}return this._isIdentity},t.prototype.isIdentityAs3x2=function(){return this._isIdentity3x2Dirty&&(this._isIdentity3x2Dirty=!1,1!==this._m[0]||1!==this._m[5]||1!==this._m[15]?this._isIdentity3x2=!1:0!==this._m[1]||0!==this._m[2]||0!==this._m[3]||0!==this._m[4]||0!==this._m[6]||0!==this._m[7]||0!==this._m[8]||0!==this._m[9]||0!==this._m[10]||0!==this._m[11]||0!==this._m[12]||0!==this._m[13]||0!==this._m[14]?this._isIdentity3x2=!1:this._isIdentity3x2=!0),this._isIdentity3x2},t.prototype.determinant=function(){if(!0===this._isIdentity)return 1;var t=this._m,e=t[0],o=t[1],n=t[2],r=t[3],i=t[4],s=t[5],a=t[6],p=t[7],u=t[8],h=t[9],l=t[10],f=t[11],c=t[12],d=t[13],y=t[14],v=t[15],m=l*v-y*f,b=h*v-d*f,g=h*y-d*l,x=u*v-c*f,C=u*y-l*c,w=u*d-c*h;return e*+(s*m-a*b+p*g)+o*-(i*m-a*x+p*C)+n*+(i*b-s*x+p*w)+r*-(i*g-s*C+a*w)},t.prototype.toArray=function(){return this._m},t.prototype.asArray=function(){return this._m},t.prototype.invert=function(){return this.invertToRef(this),this},t.prototype.reset=function(){return t.FromValuesToRef(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,this),this._updateIdentityStatus(!1),this},t.prototype.add=function(e){var o=new t;return this.addToRef(e,o),o},t.prototype.addToRef=function(t,e){for(var o=0;o<16;o++)e._m[o]=this._m[o]+t._m[o];return e._markAsUpdated(),this},t.prototype.addToSelf=function(t){for(var e=0;e<16;e++)this._m[e]+=t._m[e];return this._markAsUpdated(),this},t.prototype.invertToRef=function(e){if(!0===this._isIdentity)return t.IdentityToRef(e),this;var o=this._m,n=o[0],r=o[1],i=o[2],s=o[3],a=o[4],p=o[5],u=o[6],h=o[7],l=o[8],f=o[9],c=o[10],d=o[11],y=o[12],v=o[13],m=o[14],b=o[15],g=c*b-m*d,x=f*b-v*d,C=f*m-v*c,w=l*b-y*d,_=l*m-c*y,O=l*v-y*f,T=+(p*g-u*x+h*C),R=-(a*g-u*w+h*_),z=+(a*x-p*w+h*O),A=-(a*C-p*_+u*O),M=n*T+r*R+i*z+s*A;if(0===M)return e.copyFrom(this),this;var P=1/M,E=u*b-m*h,I=p*b-v*h,S=p*m-v*u,F=a*b-y*h,D=a*m-y*u,L=a*v-y*p,N=u*d-c*h,U=p*d-f*h,B=p*c-f*u,H=a*d-l*h,V=a*c-l*u,j=a*f-l*p,G=-(r*g-i*x+s*C),q=+(n*g-i*w+s*_),k=-(n*x-r*w+s*O),W=+(n*C-r*_+i*O),Y=+(r*E-i*I+s*S),Z=-(n*E-i*F+s*D),X=+(n*I-r*F+s*L),Q=-(n*S-r*D+i*L),J=-(r*N-i*U+s*B),K=+(n*N-i*H+s*V),$=-(n*U-r*H+s*j),tt=+(n*B-r*V+i*j);return t.FromValuesToRef(T*P,G*P,Y*P,J*P,R*P,q*P,Z*P,K*P,z*P,k*P,X*P,$*P,A*P,W*P,Q*P,tt*P,e),this},t.prototype.addAtIndex=function(t,e){return this._m[t]+=e,this._markAsUpdated(),this},t.prototype.multiplyAtIndex=function(t,e){return this._m[t]*=e,this._markAsUpdated(),this},t.prototype.setTranslationFromFloats=function(t,e,o){return this._m[12]=t,this._m[13]=e,this._m[14]=o,this._markAsUpdated(),this},t.prototype.setTranslation=function(t){return this.setTranslationFromFloats(t.x,t.y,t.z)},t.prototype.getTranslation=function(){return new n.Vector3(this._m[12],this._m[13],this._m[14])},t.prototype.getTranslationToRef=function(t){return t.x=this._m[12],t.y=this._m[13],t.z=this._m[14],this},t.prototype.removeRotationAndScaling=function(){var e=this.m;return t.FromValuesToRef(1,0,0,0,0,1,0,0,0,0,1,0,e[12],e[13],e[14],e[15],this),this._updateIdentityStatus(0===e[12]&&0===e[13]&&0===e[14]&&1===e[15]),this},t.prototype.multiply=function(e){var o=new t;return this.multiplyToRef(e,o),o},t.prototype.copyFrom=function(t){t.copyToArray(this._m);var e=t;return this._updateIdentityStatus(e._isIdentity,e._isIdentityDirty,e._isIdentity3x2,e._isIdentity3x2Dirty),this},t.prototype.copyToArray=function(t,e){void 0===e&&(e=0);for(var o=0;o<16;o++)t[e+o]=this._m[o];return this},t.prototype.multiplyToRef=function(t,e){return this._isIdentity?(e.copyFrom(t),this):t._isIdentity?(e.copyFrom(this),this):(this.multiplyToArray(t,e._m,0),e._markAsUpdated(),this)},t.prototype.multiplyToArray=function(t,e,o){var n=this._m,r=t.m,i=n[0],s=n[1],a=n[2],p=n[3],u=n[4],h=n[5],l=n[6],f=n[7],c=n[8],d=n[9],y=n[10],v=n[11],m=n[12],b=n[13],g=n[14],x=n[15],C=r[0],w=r[1],_=r[2],O=r[3],T=r[4],R=r[5],z=r[6],A=r[7],M=r[8],P=r[9],E=r[10],I=r[11],S=r[12],F=r[13],D=r[14],L=r[15];return e[o]=i*C+s*T+a*M+p*S,e[o+1]=i*w+s*R+a*P+p*F,e[o+2]=i*_+s*z+a*E+p*D,e[o+3]=i*O+s*A+a*I+p*L,e[o+4]=u*C+h*T+l*M+f*S,e[o+5]=u*w+h*R+l*P+f*F,e[o+6]=u*_+h*z+l*E+f*D,e[o+7]=u*O+h*A+l*I+f*L,e[o+8]=c*C+d*T+y*M+v*S,e[o+9]=c*w+d*R+y*P+v*F,e[o+10]=c*_+d*z+y*E+v*D,e[o+11]=c*O+d*A+y*I+v*L,e[o+12]=m*C+b*T+g*M+x*S,e[o+13]=m*w+b*R+g*P+x*F,e[o+14]=m*_+b*z+g*E+x*D,e[o+15]=m*O+b*A+g*I+x*L,this},t.prototype.equals=function(t){var e=t;if(!e)return!1;if((this._isIdentity||e._isIdentity)&&!this._isIdentityDirty&&!e._isIdentityDirty)return this._isIdentity&&e._isIdentity;var o=this.m,n=e.m;return o[0]===n[0]&&o[1]===n[1]&&o[2]===n[2]&&o[3]===n[3]&&o[4]===n[4]&&o[5]===n[5]&&o[6]===n[6]&&o[7]===n[7]&&o[8]===n[8]&&o[9]===n[9]&&o[10]===n[10]&&o[11]===n[11]&&o[12]===n[12]&&o[13]===n[13]&&o[14]===n[14]&&o[15]===n[15]},t.prototype.clone=function(){var e=new t;return e.copyFrom(this),e},t.prototype.getClassName=function(){return"Matrix"},t.prototype.getHashCode=function(){for(var t=this._m[0]||0,e=1;e<16;e++)t=397*t^(this._m[e]||0);return t},t.prototype.decompose=function(e,o,n){if(this._isIdentity)return n&&n.setAll(0),e&&e.setAll(1),o&&o.copyFromFloats(0,0,0,1),!0;var s=this._m;n&&n.copyFromFloats(s[12],s[13],s[14]);var a=e||i.MathTmp.Vector3[0];if(a.x=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),a.y=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),a.z=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]),this.determinant()<=0&&(a.y*=-1),0===a.x||0===a.y||0===a.z)return o&&o.copyFromFloats(0,0,0,1),!1;if(o){var p=1/a.x,u=1/a.y,h=1/a.z;t.FromValuesToRef(s[0]*p,s[1]*p,s[2]*p,0,s[4]*u,s[5]*u,s[6]*u,0,s[8]*h,s[9]*h,s[10]*h,0,0,0,0,1,i.MathTmp.Matrix[0]),r.Quaternion.FromRotationMatrixToRef(i.MathTmp.Matrix[0],o)}return!0},t.prototype.getRow=function(t){if(t<0||t>3)return null;var e=4*t;return new s.Vector4(this._m[e+0],this._m[e+1],this._m[e+2],this._m[e+3])},t.prototype.setRow=function(t,e){return this.setRowFromFloats(t,e.x,e.y,e.z,e.w)},t.prototype.transpose=function(){return t.Transpose(this)},t.prototype.transposeToRef=function(e){return t.TransposeToRef(this,e),this},t.prototype.setRowFromFloats=function(t,e,o,n,r){if(t<0||t>3)return this;var i=4*t;return this._m[i+0]=e,this._m[i+1]=o,this._m[i+2]=n,this._m[i+3]=r,this._markAsUpdated(),this},t.prototype.scale=function(e){var o=new t;return this.scaleToRef(e,o),o},t.prototype.scaleToRef=function(t,e){for(var o=0;o<16;o++)e._m[o]=this._m[o]*t;return e._markAsUpdated(),this},t.prototype.scaleAndAddToRef=function(t,e){for(var o=0;o<16;o++)e._m[o]+=this._m[o]*t;return e._markAsUpdated(),this},t.prototype.toNormalMatrix=function(e){var o=i.MathTmp.Matrix[0];this.invertToRef(o),o.transposeToRef(e);var n=e._m;t.FromValuesToRef(n[0],n[1],n[2],0,n[4],n[5],n[6],0,n[8],n[9],n[10],0,0,0,0,1,e)},t.prototype.getRotationMatrix=function(){var e=new t;return this.getRotationMatrixToRef(e),e},t.prototype.getRotationMatrixToRef=function(e){var o=i.MathTmp.Vector3[0];if(!this.decompose(o))return t.IdentityToRef(e),this;var n=this._m,r=1/o.x,s=1/o.y,a=1/o.z;return t.FromValuesToRef(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,0,0,0,1,e),this},t.prototype.toggleModelMatrixHandInPlace=function(){var t=this._m;t[2]*=-1,t[6]*=-1,t[8]*=-1,t[9]*=-1,t[14]*=-1,this._markAsUpdated()},t.prototype.toggleProjectionMatrixHandInPlace=function(){var t=this._m;t[8]*=-1,t[9]*=-1,t[10]*=-1,t[11]*=-1,this._markAsUpdated()},t.prototype._updateIdentityStatus=function(e,o,n,r){void 0===o&&(o=!1),void 0===n&&(n=!1),void 0===r&&(r=!0),this.updateFlag=t._updateFlagSeed++,this._isIdentity=e,this._isIdentity3x2=e||n,this._isIdentityDirty=!this._isIdentity&&o,this._isIdentity3x2Dirty=!this._isIdentity3x2&&r},t._updateFlagSeed=0,t._identityReadOnly=t.Identity(),t}();e.Matrix=a},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},e.buildArray=function(t,e){for(var o=[],n=0;n<t;++n)o.push(e());return o}},function(t,e,o){"use strict";var n=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};Object.defineProperty(e,"__esModule",{value:!0});var r=o(8),i=function(){function t(){}return t=n([r.EventConstructor("uuidEvent")],t)}();e.UUIDEvent=i},function(t,e,o){"use strict";var n,r=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};Object.defineProperty(e,"__esModule",{value:!0});var s,a,p=o(1),u=o(5),h=o(21);!function(t){t[t.TRANSFORM=1]="TRANSFORM",t[t.UUID_CALLBACK=8]="UUID_CALLBACK",t[t.BOX_SHAPE=16]="BOX_SHAPE",t[t.SPHERE_SHAPE=17]="SPHERE_SHAPE",t[t.PLANE_SHAPE=18]="PLANE_SHAPE",t[t.CONE_SHAPE=19]="CONE_SHAPE",t[t.CYLINDER_SHAPE=20]="CYLINDER_SHAPE",t[t.TEXT_SHAPE=21]="TEXT_SHAPE",t[t.NFT_SHAPE=22]="NFT_SHAPE",t[t.UI_WORLD_SPACE_SHAPE=23]="UI_WORLD_SPACE_SHAPE",t[t.UI_SCREEN_SPACE_SHAPE=24]="UI_SCREEN_SPACE_SHAPE",t[t.UI_CONTAINER_RECT=25]="UI_CONTAINER_RECT",t[t.UI_CONTAINER_STACK=26]="UI_CONTAINER_STACK",t[t.UI_TEXT_SHAPE=27]="UI_TEXT_SHAPE",t[t.UI_INPUT_TEXT_SHAPE=28]="UI_INPUT_TEXT_SHAPE",t[t.UI_IMAGE_SHAPE=29]="UI_IMAGE_SHAPE",t[t.UI_SLIDER_SHAPE=30]="UI_SLIDER_SHAPE",t[t.GLTF_SHAPE=54]="GLTF_SHAPE",t[t.OBJ_SHAPE=55]="OBJ_SHAPE",t[t.BASIC_MATERIAL=64]="BASIC_MATERIAL",t[t.PRB_MATERIAL=65]="PRB_MATERIAL"}(s=e.CLASS_ID||(e.CLASS_ID={})),function(t){t[t.BILLBOARDMODE_NONE=0]="BILLBOARDMODE_NONE",t[t.BILLBOARDMODE_X=1]="BILLBOARDMODE_X",t[t.BILLBOARDMODE_Y=2]="BILLBOARDMODE_Y",t[t.BILLBOARDMODE_Z=4]="BILLBOARDMODE_Z",t[t.BILLBOARDMODE_ALL=7]="BILLBOARDMODE_ALL"}(a=e.BillboardMode||(e.BillboardMode={}));var l=function(t){function e(e){void 0===e&&(e={});var o=t.call(this)||this;return o.tag="transform",o.position=e.position||u.Vector3.Zero(),o.rotation=e.rotation||u.Quaternion.Identity,o.scale=e.scale||new u.Vector3(1,1,1),o}return r(e,t),Object.defineProperty(e.prototype,"eulerAngles",{get:function(){return this.rotation.eulerAngles},enumerable:!0,configurable:!0}),e.prototype.lookAt=function(t,e){void 0===e&&(e=u.MathTmp.staticUp);var o=new u.Matrix;u.Matrix.LookAtLHToRef(this.position,t,e,o),o.invert(),u.Quaternion.FromRotationMatrixToRef(o,this.rotation)},e.prototype.rotate=function(t,e){this.rotation.multiplyInPlace(this.rotation.angleAxis(e,t))},e.prototype.translate=function(t){this.position.addInPlace(t)},i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"position",void 0),i([p.ObservableComponent.field],e.prototype,"rotation",void 0),i([p.ObservableComponent.field],e.prototype,"scale",void 0),e=i([p.Component("engine.transform",s.TRANSFORM)],e)}(p.ObservableComponent);e.Transform=l;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.withCollisions=!1,e.billboard=a.BILLBOARDMODE_NONE,e.visible=!0,e}return r(e,t),i([p.ObservableComponent.field],e.prototype,"withCollisions",void 0),i([p.ObservableComponent.field],e.prototype,"billboard",void 0),i([p.ObservableComponent.field],e.prototype,"visible",void 0),e}(p.ObservableComponent);e.Shape=f;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="box",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),e=i([p.Component("engine.shape",s.BOX_SHAPE)],e)}(f);e.BoxShape=c;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="sphere",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),e=i([p.Component("engine.shape",s.SPHERE_SHAPE)],e)}(f);e.SphereShape=d;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="plane",e.width=1,e.height=1,e.uvs=[],e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"width",void 0),i([p.ObservableComponent.field],e.prototype,"height",void 0),i([p.ObservableComponent.field],e.prototype,"uvs",void 0),e=i([p.Component("engine.shape",s.PLANE_SHAPE)],e)}(f);e.PlaneShape=y;var v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="cone",e.radiusTop=0,e.radiusBottom=1,e.segmentsHeight=1,e.segmentsRadial=36,e.openEnded=!1,e.radius=null,e.arc=360,e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"radiusTop",void 0),i([p.ObservableComponent.field],e.prototype,"radiusBottom",void 0),i([p.ObservableComponent.field],e.prototype,"segmentsHeight",void 0),i([p.ObservableComponent.field],e.prototype,"segmentsRadial",void 0),i([p.ObservableComponent.field],e.prototype,"openEnded",void 0),i([p.ObservableComponent.field],e.prototype,"radius",void 0),i([p.ObservableComponent.field],e.prototype,"arc",void 0),e=i([p.Component("engine.shape",s.CONE_SHAPE)],e)}(f);e.ConeShape=v;var m=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="cylinder",e.radiusTop=0,e.radiusBottom=1,e.segmentsHeight=1,e.segmentsRadial=36,e.openEnded=!1,e.radius=null,e.arc=360,e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"radiusTop",void 0),i([p.ObservableComponent.field],e.prototype,"radiusBottom",void 0),i([p.ObservableComponent.field],e.prototype,"segmentsHeight",void 0),i([p.ObservableComponent.field],e.prototype,"segmentsRadial",void 0),i([p.ObservableComponent.field],e.prototype,"openEnded",void 0),i([p.ObservableComponent.field],e.prototype,"radius",void 0),i([p.ObservableComponent.field],e.prototype,"arc",void 0),e=i([p.Component("engine.shape",s.CYLINDER_SHAPE)],e)}(f);e.CylinderShape=m;var b=function(t){function e(e){var o=t.call(this)||this;return o.tag="gltf-model",o.skeletalAnimation=[],o.src=e,o}return r(e,t),e.prototype.addClip=function(t){var e=this;this.skeletalAnimation.push(t),t.onChange(function(){e.dirty=!0})},e.prototype.getClip=function(t){for(var e=0;e<this.skeletalAnimation.length;e++){var o=this.skeletalAnimation[e];if(o.clip===t)return o}var n=new h.default(t);return this.addClip(n),n},i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([f.readonly],e.prototype,"src",void 0),i([p.ObservableComponent.readonly],e.prototype,"skeletalAnimation",void 0),e=i([p.Component("engine.shape",s.GLTF_SHAPE)],e)}(f);e.GLTFShape=b;var g=function(t){function e(e){var o=t.call(this)||this;return o.tag="obj-model",o.src=e,o}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.readonly],e.prototype,"src",void 0),e=i([p.Component("engine.shape",s.OBJ_SHAPE)],e)}(f);e.OBJShape=g;var x=function(t){function e(e){var o=t.call(this)||this;return o.tag="text",o.outlineWidth=0,o.outlineColor=new u.Color3(1,1,1),o.color=new u.Color3(1,1,1),o.fontFamily="Arial",o.fontSize=100,o.fontWeight="normal",o.opacity=1,o.value="",o.lineSpacing="0px",o.lineCount=0,o.resizeToFit=!1,o.textWrapping=!1,o.shadowBlur=0,o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowColor=new u.Color3(1,1,1),o.zIndex=0,o.hAlign="center",o.vAlign="center",o.width=1,o.height=1,o.paddingTop=0,o.paddingRight=0,o.paddingBottom=0,o.paddingLeft=0,e&&(o.value=e),o}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"outlineWidth",void 0),i([p.ObservableComponent.field],e.prototype,"outlineColor",void 0),i([p.ObservableComponent.field],e.prototype,"color",void 0),i([p.ObservableComponent.field],e.prototype,"fontFamily",void 0),i([p.ObservableComponent.field],e.prototype,"fontSize",void 0),i([p.ObservableComponent.field],e.prototype,"fontWeight",void 0),i([p.ObservableComponent.field],e.prototype,"opacity",void 0),i([p.ObservableComponent.field],e.prototype,"value",void 0),i([p.ObservableComponent.field],e.prototype,"lineSpacing",void 0),i([p.ObservableComponent.field],e.prototype,"lineCount",void 0),i([p.ObservableComponent.field],e.prototype,"resizeToFit",void 0),i([p.ObservableComponent.field],e.prototype,"textWrapping",void 0),i([p.ObservableComponent.field],e.prototype,"shadowBlur",void 0),i([p.ObservableComponent.field],e.prototype,"shadowOffsetX",void 0),i([p.ObservableComponent.field],e.prototype,"shadowOffsetY",void 0),i([p.ObservableComponent.field],e.prototype,"shadowColor",void 0),i([p.ObservableComponent.field],e.prototype,"zIndex",void 0),i([p.ObservableComponent.field],e.prototype,"hAlign",void 0),i([p.ObservableComponent.field],e.prototype,"vAlign",void 0),i([p.ObservableComponent.field],e.prototype,"width",void 0),i([p.ObservableComponent.field],e.prototype,"height",void 0),i([p.ObservableComponent.field],e.prototype,"paddingTop",void 0),i([p.ObservableComponent.field],e.prototype,"paddingRight",void 0),i([p.ObservableComponent.field],e.prototype,"paddingBottom",void 0),i([p.ObservableComponent.field],e.prototype,"paddingLeft",void 0),e=i([p.Component("engine.shape",s.TEXT_SHAPE)],e)}(f);e.TextShape=x;var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="material",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"alpha",void 0),i([p.ObservableComponent.field],e.prototype,"albedoColor",void 0),i([p.ObservableComponent.field],e.prototype,"emissiveColor",void 0),i([p.ObservableComponent.field],e.prototype,"metallic",void 0),i([p.ObservableComponent.field],e.prototype,"roughness",void 0),i([p.ObservableComponent.field],e.prototype,"ambientColor",void 0),i([p.ObservableComponent.field],e.prototype,"reflectionColor",void 0),i([p.ObservableComponent.field],e.prototype,"reflectivityColor",void 0),i([p.ObservableComponent.field],e.prototype,"directIntensity",void 0),i([p.ObservableComponent.field],e.prototype,"microSurface",void 0),i([p.ObservableComponent.field],e.prototype,"emissiveIntensity",void 0),i([p.ObservableComponent.field],e.prototype,"environmentIntensity",void 0),i([p.ObservableComponent.field],e.prototype,"specularIntensity",void 0),i([p.ObservableComponent.field],e.prototype,"albedoTexture",void 0),i([p.ObservableComponent.field],e.prototype,"alphaTexture",void 0),i([p.ObservableComponent.field],e.prototype,"emissiveTexture",void 0),i([p.ObservableComponent.field],e.prototype,"bumpTexture",void 0),i([p.ObservableComponent.field],e.prototype,"refractionTexture",void 0),i([p.ObservableComponent.field],e.prototype,"disableLighting",void 0),i([p.ObservableComponent.field],e.prototype,"transparencyMode",void 0),i([p.ObservableComponent.field],e.prototype,"hasAlpha",void 0),e=i([p.DisposableComponent("engine.material",s.PRB_MATERIAL)],e)}(p.ObservableComponent);e.Material=C;var w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="basic-material",e.texture="",e.alphaTest=.5,e.samplingMode=2,e.wrap=0,e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.field],e.prototype,"texture",void 0),i([p.ObservableComponent.field],e.prototype,"alphaTest",void 0),i([p.ObservableComponent.field],e.prototype,"samplingMode",void 0),i([p.ObservableComponent.field],e.prototype,"wrap",void 0),e=i([p.DisposableComponent("engine.material",s.BASIC_MATERIAL)],e)}(p.ObservableComponent);e.BasicMaterial=w;var _=function(t){function e(e,o){var n=t.call(this)||this;return n.tag="nft",n.width=1,n.height=1,n.alpha=1,n.hasAlpha=!1,n.contract=e,n.tokenId=o,n}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"tag",void 0),i([p.ObservableComponent.readonly],e.prototype,"contract",void 0),i([p.ObservableComponent.readonly],e.prototype,"tokenId",void 0),i([p.ObservableComponent.field],e.prototype,"width",void 0),i([p.ObservableComponent.field],e.prototype,"height",void 0),i([p.ObservableComponent.field],e.prototype,"alpha",void 0),i([p.ObservableComponent.field],e.prototype,"hasAlpha",void 0),e=i([p.Component("engine.shape",s.NFT_SHAPE)],e)}(f);e.NFTShape=_;var O=function(t){function e(e){var o=t.call(this)||this;return o.callback=e,o}return r(e,t),Object.defineProperty(e.prototype,"uuid",{get:function(){return p.getComponentId(this)},enumerable:!0,configurable:!0}),e.prototype.toJSON=function(){return{uuid:this.uuid}},i([p.ObservableComponent.field],e.prototype,"callback",void 0),e}(p.ObservableComponent);e.OnUUIDEvent=O;var T=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="onClick",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"type",void 0),e=i([p.DisposableComponent("engine.onClick",s.UUID_CALLBACK)],e)}(O);e.OnClick=T;var R=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="onChanged",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"type",void 0),e=i([p.DisposableComponent("engine.onChanged",s.UUID_CALLBACK)],e)}(O);e.OnChanged=R;var z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="onFocus",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"type",void 0),e=i([p.DisposableComponent("engine.onFocus",s.UUID_CALLBACK)],e)}(O);e.OnFocus=z;var A=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="onBlur",e}return r(e,t),i([p.ObservableComponent.readonly],e.prototype,"type",void 0),e=i([p.DisposableComponent("engine.onBlur",s.UUID_CALLBACK)],e)}(O);e.OnBlur=A},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0),r=o(3),i=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.Zero=function(){return new t(0,0)},t.One=function(){return new t(1,1)},t.Add=function(e,o){return new t(e.x,e.y).addInPlace(o)},t.FromArray=function(e,o){return void 0===o&&(o=0),new t(e[o],e[o+1])},t.FromArrayToRef=function(t,e,o){o.x=t[e],o.y=t[e+1]},t.CatmullRom=function(e,o,n,r,i){var s=i*i,a=i*s;return new t(.5*(2*o.x+(-e.x+n.x)*i+(2*e.x-5*o.x+4*n.x-r.x)*s+(-e.x+3*o.x-3*n.x+r.x)*a),.5*(2*o.y+(-e.y+n.y)*i+(2*e.y-5*o.y+4*n.y-r.y)*s+(-e.y+3*o.y-3*n.y+r.y)*a))},t.Clamp=function(e,o,n){var r=e.x;r=(r=r>n.x?n.x:r)<o.x?o.x:r;var i=e.y;return new t(r,i=(i=i>n.y?n.y:i)<o.y?o.y:i)},t.Hermite=function(e,o,n,r,i){var s=i*i,a=i*s,p=2*a-3*s+1,u=-2*a+3*s,h=a-2*s+i,l=a-s;return new t(e.x*p+n.x*u+o.x*h+r.x*l,e.y*p+n.y*u+o.y*h+r.y*l)},t.Lerp=function(e,o,n){return new t(e.x+(o.x-e.x)*n,e.y+(o.y-e.y)*n)},t.Dot=function(t,e){return t.x*e.x+t.y*e.y},t.Normalize=function(e){var o=new t(e.x,e.y);return o.normalize(),o},t.Minimize=function(e,o){return new t(e.x<o.x?e.x:o.x,e.y<o.y?e.y:o.y)},t.Maximize=function(e,o){return new t(e.x>o.x?e.x:o.x,e.y>o.y?e.y:o.y)},t.Transform=function(e,o){var n=t.Zero();return t.TransformToRef(e,o,n),n},t.TransformToRef=function(t,e,o){var n=e.m,r=t.x*n[0]+t.y*n[4]+n[12],i=t.x*n[1]+t.y*n[5]+n[13];o.x=r,o.y=i},t.PointInTriangle=function(t,e,o,n){var r=.5*(-o.y*n.x+e.y*(-o.x+n.x)+e.x*(o.y-n.y)+o.x*n.y),i=r<0?-1:1,s=(e.y*n.x-e.x*n.y+(n.y-e.y)*t.x+(e.x-n.x)*t.y)*i,a=(e.x*o.y-e.y*o.x+(e.y-o.y)*t.x+(o.x-e.x)*t.y)*i;return s>0&&a>0&&s+a<2*r*i},t.Distance=function(e,o){return Math.sqrt(t.DistanceSquared(e,o))},t.DistanceSquared=function(t,e){var o=t.x-e.x,n=t.y-e.y;return o*o+n*n},t.Center=function(e,o){var n=t.Add(e,o);return n.scaleInPlace(.5),n},t.DistanceOfPointFromSegment=function(e,o,n){var r=t.DistanceSquared(o,n);if(0===r)return t.Distance(e,o);var i=n.subtract(o),s=Math.max(0,Math.min(1,t.Dot(e.subtract(o),i)/r)),a=o.add(i.multiplyByFloats(s,s));return t.Distance(e,a)},t.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+"}"},t.prototype.getClassName=function(){return"Vector2"},t.prototype.getHashCode=function(){var t=this.x||0;return t=397*t^(this.y||0)},t.prototype.toArray=function(t,e){return void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,this},t.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.copyFromFloats=function(t,e){return this.x=t,this.y=e,this},t.prototype.set=function(t,e){return this.copyFromFloats(t,e)},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addToRef=function(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,this},t.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.addVector3=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.subtractToRef=function(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,this},t.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this},t.prototype.multiply=function(e){return new t(this.x*e.x,this.y*e.y)},t.prototype.multiplyToRef=function(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,this},t.prototype.multiplyByFloats=function(e,o){return new t(this.x*e,this.y*o)},t.prototype.divide=function(e){return new t(this.x/e.x,this.y/e.y)},t.prototype.divideToRef=function(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,this},t.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},t.prototype.negate=function(){return new t(-this.x,-this.y)},t.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this},t.prototype.scale=function(e){var o=new t(0,0);return this.scaleToRef(e,o),o},t.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,this},t.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,this},t.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y},t.prototype.equalsWithEpsilon=function(t,e){return void 0===e&&(e=n.Epsilon),t&&r.Scalar.WithinEpsilon(this.x,t.x,e)&&r.Scalar.WithinEpsilon(this.y,t.y,e)},t.prototype.floor=function(){return new t(Math.floor(this.x),Math.floor(this.y))},t.prototype.fract=function(){return new t(this.x-Math.floor(this.x),this.y-Math.floor(this.y))},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.length();if(0===t)return this;var e=1/t;return this.x*=e,this.y*=e,this},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Vector2=i},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(12),r=o(13),i=o(7),s=function(){function t(){this.handlerMap={}}return t.prototype.activate=function(t){t.eventManager.addListener(n.UUIDEvent,this,this.handleEvent),t.eventManager.addListener(i.ComponentAdded,this,this.componentAdded),t.eventManager.addListener(i.ComponentRemoved,this,this.componentRemoved),"undefined"!=typeof dcl&&dcl.subscribe("uuidEvent")},t.prototype.deactivate=function(){"undefined"!=typeof dcl&&dcl.unsubscribe("uuidEvent")},t.prototype.onAddEntity=function(t){for(var e in t.components){var o=t.components[e];o instanceof r.OnUUIDEvent&&(this.handlerMap[o.uuid]=o)}},t.prototype.onRemoveEntity=function(t){for(var e in t.components){var o=t.components[e];o instanceof r.OnUUIDEvent&&delete this.handlerMap[o.uuid]}},t.prototype.componentAdded=function(t){if(t.entity.isAddedToEngine()){var e=t.entity.components[t.componentName];e instanceof r.OnUUIDEvent&&(this.handlerMap[e.uuid]=e)}},t.prototype.componentRemoved=function(t){t.entity.isAddedToEngine()&&t.component instanceof r.OnUUIDEvent&&delete this.handlerMap[t.component.uuid]},t.prototype.handleEvent=function(t){if(t.uuid in this.handlerMap){var e=this.handlerMap[t.uuid];e&&e.callback(t.payload)}},t}();e.UUIDEventSystem=s},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0),r=o(3),i=o(2),s=function(){function t(t,e,o,n){this.x=t,this.y=e,this.z=o,this.w=n}return t.Add=function(e,o){return new t(e.x,e.y,e.z,e.w).addInPlace(o)},t.FromArray=function(e,o){return void 0===o&&(o=0),new t(e[o],e[o+1],e[o+2],e[o+3])},t.FromArrayToRef=function(t,e,o){o.x=t[e],o.y=t[e+1],o.z=t[e+2],o.w=t[e+3]},t.FromFloatArrayToRef=function(e,o,n){t.FromArrayToRef(e,o,n)},t.FromFloatsToRef=function(t,e,o,n,r){r.x=t,r.y=e,r.z=o,r.w=n},t.Zero=function(){return new t(0,0,0,0)},t.One=function(){return new t(1,1,1,1)},t.Normalize=function(e){var o=t.Zero();return t.NormalizeToRef(e,o),o},t.NormalizeToRef=function(t,e){e.copyFrom(t),e.normalize()},t.Minimize=function(e,o){var n=new t(e.x,e.y,e.z,e.w);return n.minimizeInPlace(o),n},t.Maximize=function(e,o){var n=new t(e.x,e.y,e.z,e.w);return n.maximizeInPlace(o),n},t.Distance=function(e,o){return Math.sqrt(t.DistanceSquared(e,o))},t.DistanceSquared=function(t,e){var o=t.x-e.x,n=t.y-e.y,r=t.z-e.z,i=t.w-e.w;return o*o+n*n+r*r+i*i},t.Center=function(e,o){var n=t.Add(e,o);return n.scaleInPlace(.5),n},t.TransformNormal=function(e,o){var n=t.Zero();return t.TransformNormalToRef(e,o,n),n},t.TransformNormalToRef=function(t,e,o){var n=e.m,r=t.x*n[0]+t.y*n[4]+t.z*n[8],i=t.x*n[1]+t.y*n[5]+t.z*n[9],s=t.x*n[2]+t.y*n[6]+t.z*n[10];o.x=r,o.y=i,o.z=s,o.w=t.w},t.TransformNormalFromFloatsToRef=function(t,e,o,n,r,i){var s=r.m;i.x=t*s[0]+e*s[4]+o*s[8],i.y=t*s[1]+e*s[5]+o*s[9],i.z=t*s[2]+e*s[6]+o*s[10],i.w=n},t.prototype.toString=function(){return"{X: "+this.x+" Y:"+this.y+" Z:"+this.z+" W:"+this.w+"}"},t.prototype.getClassName=function(){return"Vector4"},t.prototype.getHashCode=function(){var t=this.x||0;return t=397*(t=397*(t=397*t^(this.y||0))^(this.z||0))^(this.w||0)},t.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},t.prototype.toArray=function(t,e){return void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,this},t.prototype.addInPlace=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y,this.z+e.z,this.w+e.w)},t.prototype.addToRef=function(t,e){return e.x=this.x+t.x,e.y=this.y+t.y,e.z=this.z+t.z,e.w=this.w+t.w,this},t.prototype.subtractInPlace=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y,this.z-e.z,this.w-e.w)},t.prototype.subtractToRef=function(t,e){return e.x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z,e.w=this.w-t.w,this},t.prototype.subtractFromFloats=function(e,o,n,r){return new t(this.x-e,this.y-o,this.z-n,this.w-r)},t.prototype.subtractFromFloatsToRef=function(t,e,o,n,r){return r.x=this.x-t,r.y=this.y-e,r.z=this.z-o,r.w=this.w-n,this},t.prototype.negate=function(){return new t(-this.x,-this.y,-this.z,-this.w)},t.prototype.scaleInPlace=function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},t.prototype.scale=function(e){return new t(this.x*e,this.y*e,this.z*e,this.w*e)},t.prototype.scaleToRef=function(t,e){return e.x=this.x*t,e.y=this.y*t,e.z=this.z*t,e.w=this.w*t,this},t.prototype.scaleAndAddToRef=function(t,e){return e.x+=this.x*t,e.y+=this.y*t,e.z+=this.z*t,e.w+=this.w*t,this},t.prototype.equals=function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},t.prototype.equalsWithEpsilon=function(t,e){return void 0===e&&(e=n.Epsilon),t&&r.Scalar.WithinEpsilon(this.x,t.x,e)&&r.Scalar.WithinEpsilon(this.y,t.y,e)&&r.Scalar.WithinEpsilon(this.z,t.z,e)&&r.Scalar.WithinEpsilon(this.w,t.w,e)},t.prototype.equalsToFloats=function(t,e,o,n){return this.x===t&&this.y===e&&this.z===o&&this.w===n},t.prototype.multiplyInPlace=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},t.prototype.multiply=function(e){return new t(this.x*e.x,this.y*e.y,this.z*e.z,this.w*e.w)},t.prototype.multiplyToRef=function(t,e){return e.x=this.x*t.x,e.y=this.y*t.y,e.z=this.z*t.z,e.w=this.w*t.w,this},t.prototype.multiplyByFloats=function(e,o,n,r){return new t(this.x*e,this.y*o,this.z*n,this.w*r)},t.prototype.divide=function(e){return new t(this.x/e.x,this.y/e.y,this.z/e.z,this.w/e.w)},t.prototype.divideToRef=function(t,e){return e.x=this.x/t.x,e.y=this.y/t.y,e.z=this.z/t.z,e.w=this.w/t.w,this},t.prototype.divideInPlace=function(t){return this.divideToRef(t,this)},t.prototype.minimizeInPlace=function(t){return t.x<this.x&&(this.x=t.x),t.y<this.y&&(this.y=t.y),t.z<this.z&&(this.z=t.z),t.w<this.w&&(this.w=t.w),this},t.prototype.maximizeInPlace=function(t){return t.x>this.x&&(this.x=t.x),t.y>this.y&&(this.y=t.y),t.z>this.z&&(this.z=t.z),t.w>this.w&&(this.w=t.w),this},t.prototype.floor=function(){return new t(Math.floor(this.x),Math.floor(this.y),Math.floor(this.z),Math.floor(this.w))},t.prototype.fract=function(){return new t(this.x-Math.floor(this.x),this.y-Math.floor(this.y),this.z-Math.floor(this.z),this.w-Math.floor(this.w))},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},t.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},t.prototype.normalize=function(){var t=this.length();return 0===t?this:this.scaleInPlace(1/t)},t.prototype.toVector3=function(){return new i.Vector3(this.x,this.y,this.z)},t.prototype.clone=function(){return new t(this.x,this.y,this.z,this.w)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},t.prototype.copyFromFloats=function(t,e,o,n){return this.x=t,this.y=e,this.z=o,this.w=n,this},t.prototype.set=function(t,e,o,n){return this.copyFromFloats(t,e,o,n)},t.prototype.setAll=function(t){return this.x=this.y=this.z=this.w=t,this},t}();e.Vector4=s},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this._radians=t,this._radians<0&&(this._radians+=2*Math.PI)}return t.BetweenTwoPoints=function(e,o){var n=o.subtract(e);return new t(Math.atan2(n.y,n.x))},t.FromRadians=function(e){return new t(e)},t.FromDegrees=function(e){return new t(e*Math.PI/180)},t.prototype.degrees=function(){return 180*this._radians/Math.PI},t.prototype.radians=function(){return this._radians},t}();e.Angle=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(17),r=o(14),i=o(0),s=function(){return function(t,e,o){this.startPoint=t,this.midPoint=e,this.endPoint=o;var s=Math.pow(e.x,2)+Math.pow(e.y,2),a=(Math.pow(t.x,2)+Math.pow(t.y,2)-s)/2,p=(s-Math.pow(o.x,2)-Math.pow(o.y,2))/2,u=(t.x-e.x)*(e.y-o.y)-(e.x-o.x)*(t.y-e.y);this.centerPoint=new r.Vector2((a*(e.y-o.y)-p*(t.y-e.y))/u,((t.x-e.x)*p-(e.x-o.x)*a)/u),this.radius=this.centerPoint.subtract(this.startPoint).length(),this.startAngle=n.Angle.BetweenTwoPoints(this.centerPoint,this.startPoint);var h=this.startAngle.degrees(),l=n.Angle.BetweenTwoPoints(this.centerPoint,this.midPoint).degrees(),f=n.Angle.BetweenTwoPoints(this.centerPoint,this.endPoint).degrees();l-h>180&&(l-=360),l-h<-180&&(l+=360),f-l>180&&(f-=360),f-l<-180&&(f+=360),this.orientation=l-h<0?i.Orientation.CW:i.Orientation.CCW,this.angle=n.Angle.FromDegrees(this.orientation===i.Orientation.CW?h-f:f-h)}}();e.Arc2=s},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(3),r=o(0),i=function(){function t(t,e,o,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===o&&(o=0),void 0===n&&(n=1),this.r=t,this.g=e,this.b=o,this.a=n}return t.FromHexString=function(e){if("#"!==e.substring(0,1)||9!==e.length)return new t(0,0,0,0);var o=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),r=parseInt(e.substring(5,7),16),i=parseInt(e.substring(7,9),16);return t.FromInts(o,n,r,i)},t.Lerp=function(e,o,n){var r=new t(0,0,0,0);return t.LerpToRef(e,o,n,r),r},t.LerpToRef=function(t,e,o,n){n.r=t.r+(e.r-t.r)*o,n.g=t.g+(e.g-t.g)*o,n.b=t.b+(e.b-t.b)*o,n.a=t.a+(e.a-t.a)*o},t.FromColor3=function(e,o){return void 0===o&&(o=1),new t(e.r,e.g,e.b,o)},t.FromArray=function(e,o){return void 0===o&&(o=0),new t(e[o],e[o+1],e[o+2],e[o+3])},t.FromInts=function(e,o,n,r){return new t(e/255,o/255,n/255,r/255)},t.CheckColors4=function(t,e){if(t.length===3*e){for(var o=[],n=0;n<t.length;n+=3){var r=n/3*4;o[r]=t[n],o[r+1]=t[n+1],o[r+2]=t[n+2],o[r+3]=1}return o}return t},t.prototype.addInPlace=function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this.a+=t.a,this},t.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},t.prototype.toArray=function(t,e){return void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,this},t.prototype.add=function(e){return new t(this.r+e.r,this.g+e.g,this.b+e.b,this.a+e.a)},t.prototype.subtract=function(e){return new t(this.r-e.r,this.g-e.g,this.b-e.b,this.a-e.a)},t.prototype.subtractToRef=function(t,e){return e.r=this.r-t.r,e.g=this.g-t.g,e.b=this.b-t.b,e.a=this.a-t.a,this},t.prototype.scale=function(e){return new t(this.r*e,this.g*e,this.b*e,this.a*e)},t.prototype.scaleToRef=function(t,e){return e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,e.a=this.a*t,this},t.prototype.scaleAndAddToRef=function(t,e){return e.r+=this.r*t,e.g+=this.g*t,e.b+=this.b*t,e.a+=this.a*t,this},t.prototype.clampToRef=function(t,e,o){return void 0===t&&(t=0),void 0===e&&(e=1),o.r=n.Scalar.Clamp(this.r,t,e),o.g=n.Scalar.Clamp(this.g,t,e),o.b=n.Scalar.Clamp(this.b,t,e),o.a=n.Scalar.Clamp(this.a,t,e),this},t.prototype.multiply=function(e){return new t(this.r*e.r,this.g*e.g,this.b*e.b,this.a*e.a)},t.prototype.multiplyToRef=function(t,e){return e.r=this.r*t.r,e.g=this.g*t.g,e.b=this.b*t.b,e.a=this.a*t.a,e},t.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+" A:"+this.a+"}"},t.prototype.getClassName=function(){return"Color4"},t.prototype.getHashCode=function(){var t=this.r||0;return t=397*(t=397*(t=397*t^(this.g||0))^(this.b||0))^(this.a||0)},t.prototype.clone=function(){return new t(this.r,this.g,this.b,this.a)},t.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.copyFromFloats=function(t,e,o,n){return this.r=t,this.g=e,this.b=o,this.a=n,this},t.prototype.set=function(t,e,o,n){return this.copyFromFloats(t,e,o,n)},t.prototype.toHexString=function(){var t=255*this.r|0,e=255*this.g|0,o=255*this.b|0,r=255*this.a|0;return"#"+n.Scalar.ToHex(t)+n.Scalar.ToHex(e)+n.Scalar.ToHex(o)+n.Scalar.ToHex(r)},t.prototype.toLinearSpace=function(){var e=new t;return this.toLinearSpaceToRef(e),e},t.prototype.toLinearSpaceToRef=function(t){return t.r=Math.pow(this.r,r.ToLinearSpace),t.g=Math.pow(this.g,r.ToLinearSpace),t.b=Math.pow(this.b,r.ToLinearSpace),t.a=this.a,this},t.prototype.toGammaSpace=function(){var e=new t;return this.toGammaSpaceToRef(e),e},t.prototype.toGammaSpaceToRef=function(t){return t.r=Math.pow(this.r,r.ToGammaSpace),t.g=Math.pow(this.g,r.ToGammaSpace),t.b=Math.pow(this.b,r.ToGammaSpace),t.a=this.a,this},t}();e.Color4=i},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(10),i=o(6),s=function(){function t(t,e,o,r){this.normal=new n.Vector3(t,e,o),this.d=r}return t.FromArray=function(e){return new t(e[0],e[1],e[2],e[3])},t.FromPoints=function(e,o,n){var r=new t(0,0,0,0);return r.copyFromPoints(e,o,n),r},t.FromPositionAndNormal=function(e,o){var n=new t(0,0,0,0);return o.normalize(),n.normal=o,n.d=-(o.x*e.x+o.y*e.y+o.z*e.z),n},t.SignedDistanceToPlaneFromPositionAndNormal=function(t,e,o){var r=-(e.x*t.x+e.y*t.y+e.z*t.z);return n.Vector3.Dot(o,e)+r},t.prototype.asArray=function(){return[this.normal.x,this.normal.y,this.normal.z,this.d]},t.prototype.clone=function(){return new t(this.normal.x,this.normal.y,this.normal.z,this.d)},t.prototype.getClassName=function(){return"Plane"},t.prototype.getHashCode=function(){var t=this.normal.getHashCode();return t=397*t^(this.d||0)},t.prototype.normalize=function(){var t=Math.sqrt(this.normal.x*this.normal.x+this.normal.y*this.normal.y+this.normal.z*this.normal.z),e=0;return 0!==t&&(e=1/t),this.normal.x*=e,this.normal.y*=e,this.normal.z*=e,this.d*=e,this},t.prototype.transform=function(e){var o=i.MathTmp.Matrix[0];r.Matrix.TransposeToRef(e,o);var n=o.m,s=this.normal.x,a=this.normal.y,p=this.normal.z,u=this.d;return new t(s*n[0]+a*n[1]+p*n[2]+u*n[3],s*n[4]+a*n[5]+p*n[6]+u*n[7],s*n[8]+a*n[9]+p*n[10]+u*n[11],s*n[12]+a*n[13]+p*n[14]+u*n[15])},t.prototype.dotCoordinate=function(t){return this.normal.x*t.x+this.normal.y*t.y+this.normal.z*t.z+this.d},t.prototype.copyFromPoints=function(t,e,o){var n,r=e.x-t.x,i=e.y-t.y,s=e.z-t.z,a=o.x-t.x,p=o.y-t.y,u=o.z-t.z,h=i*u-s*p,l=s*a-r*u,f=r*p-i*a,c=Math.sqrt(h*h+l*l+f*f);return n=0!==c?1/c:0,this.normal.x=h*n,this.normal.y=l*n,this.normal.z=f*n,this.d=-(this.normal.x*t.x+this.normal.y*t.y+this.normal.z*t.z),this},t.prototype.isFrontFacingTo=function(t,e){return n.Vector3.Dot(this.normal,t)<=e},t.prototype.signedDistanceTo=function(t){return n.Vector3.Dot(t,this.normal)+this.d},t}();e.Plane=s},function(t,e,o){"use strict";var n,r=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},s=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};Object.defineProperty(e,"__esModule",{value:!0});var a=o(1),p={loop:!0,speed:1,weight:1},u=function(t){function e(e,o){void 0===o&&(o=p);var n=t.call(this)||this;return n.isAnimationClip=!0,n.loop=p.loop,n.weight=p.weight,n.playing=!1,n.speed=p.speed,n.setParams(i({clip:e},o)),n}return r(e,t),e.prototype.setParams=function(t){this.clip=t.clip||this.clip,this.loop=void 0!==t.loop?t.loop:this.loop,this.speed=t.speed||this.speed},e.prototype.play=function(){this.playing=!0},e.prototype.pause=function(){this.playing=!1},s([a.ObservableComponent.field],e.prototype,"clip",void 0),s([a.ObservableComponent.field],e.prototype,"loop",void 0),s([a.ObservableComponent.field],e.prototype,"weight",void 0),s([a.ObservableComponent.field],e.prototype,"playing",void 0),s([a.ObservableComponent.field],e.prototype,"speed",void 0),e}(a.ObservableComponent);e.AnimationClip=u,e.default=u},function(t,e,o){"use strict";function n(t){for(var o in t)e.hasOwnProperty(o)||(e[o]=t[o])}Object.defineProperty(e,"__esModule",{value:!0}),n(o(4)),n(o(1)),n(o(7)),n(o(24));var r=o(25),i=new(o(4).Engine);e.engine=i,o(1).DisposableComponent.engine=i,"undefined"!=typeof dcl&&i.addSystem(new r.DecentralandSynchronizationSystem(dcl),1/0);var s=new(o(15).UUIDEventSystem);i.addSystem(s),n(o(13)),n(o(15)),n(o(12)),n(o(34)),n(o(35)),n(o(5)),n(o(21)),n(o(36))},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(1),r=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this.entities=[],this.active=!1,this._requiresNames=[],!t)throw new Error("ComponentGroup: Could not load the requires list");if(!(t instanceof Array))throw new Error("ComponentGroup: requires list is not an Array");Object.defineProperty(this,"requires",{get:function(){return t.slice()}}),Object.defineProperty(this,"requiresNames",{get:function(){return this._requiresNames.slice()}});for(var o=function(e){var o=t[e],i=null;if(!o)throw new Error("ComponentGroup: the required component at location "+e+" is invalid");try{i=n.getComponentName(o)}catch(t){throw new Error("ComponentGroup: the required component at location "+e+" is not registered as a @Component. Remember to provide the class of the component, not the name")}if(r._requiresNames.some(function(t){return t===i}))throw new Error("ComponentGroup: the required component list has a repeated name "+i);r._requiresNames.push(i)},r=this,i=0;i<t.length;i++)o(i)}return t.prototype.hasEntity=function(t){return!!t.isAddedToEngine()&&-1!==this.entities.indexOf(t)},t.prototype.addEntity=function(t){if(!t.isAddedToEngine())throw new TypeError("ComponentGroup: Cannot add a entity that is not added to the engine");-1===this.entities.indexOf(t)&&this.entities.push(t)},t.prototype.removeEntity=function(t){var e=this.entities.indexOf(t);-1!==e&&this.entities.splice(e,1)},t.prototype.componentRemoved=function(t,e){-1!==this._requiresNames.indexOf(e)&&this.removeEntity(t)},t.prototype.meetsRequirements=function(t){for(var e=0;e<this._requiresNames.length;e++){if(!(this._requiresNames[e]in t.components))return!1}return!0},t}();e.ComponentGroup=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4);e.executeTask=function(t){var e=t();return e.isComplete=!1,e.then(function(t){e.isComplete=!0,e.result=t,e.didFail=!1}).catch(function(t){e.isComplete=!0,e.error=t,e.didFail=!0,n.log("executeTask: FAILED",t)}),e}},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(4),r=o(7),i=o(12),s=o(1),a=function(){function t(t){this.dcl=t,this.cachedComponents={}}return t.prototype.activate=function(t){var e=this;this.engine=t,t.eventManager.addListener(r.ComponentAdded,this,this.componentAdded),t.eventManager.addListener(r.ComponentRemoved,this,this.componentRemoved),t.eventManager.addListener(s.DisposableComponentCreated,this,this.disposableComponentCreated),t.eventManager.addListener(s.DisposableComponentRemoved,this,this.disposableComponentRemoved),t.eventManager.addListener(s.DisposableComponentUpdated,this,this.disposableComponentUpdated),t.eventManager.addListener(r.ParentChanged,this,this.parentChanged);var o=t.rootEntity.uuid;this.dcl.addEntity(o),this.dcl.onUpdate(function(o){t.update(o),e.presentEntities()}),this.dcl.onEvent(function(e){switch(e.type){case"uuidEvent":var o=new i.UUIDEvent;o.uuid=e.data.uuid,o.payload=e.data.payload,t.eventManager.fireEvent(o);break;default:t.eventManager.fireEvent(new n.EngineEvent(e))}})},t.prototype.onAddEntity=function(t){if(t&&t.isAddedToEngine()){var e=t.uuid,o=t.getParent();for(var n in this.dcl.addEntity(e),o&&this.dcl.setParent(e,o.uuid),this.cachedComponents[e]={},t.components){var r=t.components[n],i=s.getComponentClassId(r);if(null!==i)if(s.isDisposableComponent(r))this.dcl.attachEntityComponent(t.uuid,n,s.getComponentId(r));else{var a=JSON.stringify(r);this.dcl.updateEntityComponent(e,n,i,a),this.cachedComponents[e][n]=a}}}},t.prototype.onRemoveEntity=function(t){if(t.isAddedToEngine()){var e=t.uuid;this.dcl.removeEntity(e),delete this.cachedComponents[e]}},t.prototype.presentEntities=function(){for(var t in this.engine.entities){var e=this.engine.entities[t],o=e.uuid;for(var n in e.components){var r=e.components[n],i=s.getComponentClassId(r);if(null!==i&&!s.isDisposableComponent(r)){var a=JSON.stringify(r);this.cachedComponents[o][n]!==a&&(this.dcl.updateEntityComponent(e.uuid,n,i,a),this.cachedComponents[o][n]=a)}}}for(var p in this.engine.disposableComponents){(r=this.engine.disposableComponents[p])instanceof s.ObservableComponent&&r.dirty&&(this.dcl.componentUpdated(p,JSON.stringify(r)),r.dirty=!1)}},t.prototype.componentAdded=function(t){if(t.entity.isAddedToEngine()){var e=t.entity.components[t.componentName];if(s.isDisposableComponent(e))this.dcl.attachEntityComponent(t.entity.uuid,t.componentName,s.getComponentId(e));else if(null!==t.classId){var o=JSON.stringify(e);this.dcl.updateEntityComponent(t.entity.uuid,t.componentName,t.classId,o),this.cachedComponents[t.entity.uuid][t.componentName]=o}}},t.prototype.componentRemoved=function(t){t.entity.isAddedToEngine()&&this.dcl.removeEntityComponent(t.entity.uuid,t.componentName)},t.prototype.disposableComponentCreated=function(t){this.dcl.componentCreated(t.componentId,t.componentName,t.classId)},t.prototype.disposableComponentRemoved=function(t){this.dcl.componentDisposed(t.componentId)},t.prototype.disposableComponentUpdated=function(t){this.dcl.componentUpdated(t.componentId,JSON.stringify(t.component))},t.prototype.parentChanged=function(t){this.dcl.setParent(t.entity.uuid,t.parent.uuid)},t}();e.DecentralandSynchronizationSystem=a},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=function(){function t(){}return t.X=new n.Vector3(1,0,0),t.Y=new n.Vector3(0,1,0),t.Z=new n.Vector3(0,0,1),t}();e.Axis=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){}return t.Interpolate=function(t,e,o,n,r){for(var i=1-3*n+3*e,s=3*n-6*e,a=3*e,p=t,u=0;u<5;u++){var h=p*p;p-=(i*(h*p)+s*h+a*p-t)*(1/(3*i*h+2*s*p+a)),p=Math.min(1,Math.max(0,p))}return 3*Math.pow(1-p,2)*p*o+3*(1-p)*Math.pow(p,2)*r+Math.pow(p,3)},t}();e.BezierCurve=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(0),r=o(19),i=o(3),s=function(){function t(t,e,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===o&&(o=0),this.r=t,this.g=e,this.b=o}return t.FromHexString=function(e){if("#"!==e.substring(0,1)||7!==e.length)return new t(0,0,0);var o=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),r=parseInt(e.substring(5,7),16);return t.FromInts(o,n,r)},t.FromArray=function(e,o){return void 0===o&&(o=0),new t(e[o],e[o+1],e[o+2])},t.FromInts=function(e,o,n){return new t(e/255,o/255,n/255)},t.Lerp=function(e,o,n){var r=new t(0,0,0);return t.LerpToRef(e,o,n,r),r},t.LerpToRef=function(t,e,o,n){n.r=t.r+(e.r-t.r)*o,n.g=t.g+(e.g-t.g)*o,n.b=t.b+(e.b-t.b)*o},t.Red=function(){return new t(1,0,0)},t.Green=function(){return new t(0,1,0)},t.Blue=function(){return new t(0,0,1)},t.Black=function(){return new t(0,0,0)},t.White=function(){return new t(1,1,1)},t.Purple=function(){return new t(.5,0,.5)},t.Magenta=function(){return new t(1,0,1)},t.Yellow=function(){return new t(1,1,0)},t.Gray=function(){return new t(.5,.5,.5)},t.Teal=function(){return new t(0,1,1)},t.Random=function(){return new t(Math.random(),Math.random(),Math.random())},t.prototype.toString=function(){return"{R: "+this.r+" G:"+this.g+" B:"+this.b+"}"},t.prototype.getClassName=function(){return"Color3"},t.prototype.getHashCode=function(){var t=this.r||0;return t=397*(t=397*t^(this.g||0))^(this.b||0)},t.prototype.toArray=function(t,e){return void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,this},t.prototype.toColor4=function(t){return void 0===t&&(t=1),new r.Color4(this.r,this.g,this.b,t)},t.prototype.asArray=function(){var t=new Array;return this.toArray(t,0),t},t.prototype.toLuminance=function(){return.3*this.r+.59*this.g+.11*this.b},t.prototype.multiply=function(e){return new t(this.r*e.r,this.g*e.g,this.b*e.b)},t.prototype.multiplyToRef=function(t,e){return e.r=this.r*t.r,e.g=this.g*t.g,e.b=this.b*t.b,this},t.prototype.equals=function(t){return t&&this.r===t.r&&this.g===t.g&&this.b===t.b},t.prototype.equalsFloats=function(t,e,o){return this.r===t&&this.g===e&&this.b===o},t.prototype.scale=function(e){return new t(this.r*e,this.g*e,this.b*e)},t.prototype.scaleToRef=function(t,e){return e.r=this.r*t,e.g=this.g*t,e.b=this.b*t,this},t.prototype.scaleAndAddToRef=function(t,e){return e.r+=this.r*t,e.g+=this.g*t,e.b+=this.b*t,this},t.prototype.clampToRef=function(t,e,o){return void 0===t&&(t=0),void 0===e&&(e=1),o.r=i.Scalar.Clamp(this.r,t,e),o.g=i.Scalar.Clamp(this.g,t,e),o.b=i.Scalar.Clamp(this.b,t,e),this},t.prototype.add=function(e){return new t(this.r+e.r,this.g+e.g,this.b+e.b)},t.prototype.addToRef=function(t,e){return e.r=this.r+t.r,e.g=this.g+t.g,e.b=this.b+t.b,this},t.prototype.subtract=function(e){return new t(this.r-e.r,this.g-e.g,this.b-e.b)},t.prototype.subtractToRef=function(t,e){return e.r=this.r-t.r,e.g=this.g-t.g,e.b=this.b-t.b,this},t.prototype.clone=function(){return new t(this.r,this.g,this.b)},t.prototype.copyFrom=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},t.prototype.copyFromFloats=function(t,e,o){return this.r=t,this.g=e,this.b=o,this},t.prototype.set=function(t,e,o){return this.copyFromFloats(t,e,o)},t.prototype.toHexString=function(){var t=255*this.r|0,e=255*this.g|0,o=255*this.b|0;return"#"+i.Scalar.ToHex(t)+i.Scalar.ToHex(e)+i.Scalar.ToHex(o)},t.prototype.toLinearSpace=function(){var e=new t;return this.toLinearSpaceToRef(e),e},t.prototype.toLinearSpaceToRef=function(t){return t.r=Math.pow(this.r,n.ToLinearSpace),t.g=Math.pow(this.g,n.ToLinearSpace),t.b=Math.pow(this.b,n.ToLinearSpace),this},t.prototype.toGammaSpace=function(){var e=new t;return this.toGammaSpaceToRef(e),e},t.prototype.toGammaSpaceToRef=function(t){return t.r=Math.pow(this.r,n.ToGammaSpace),t.g=Math.pow(this.g,n.ToGammaSpace),t.b=Math.pow(this.b,n.ToGammaSpace),this},t.prototype.toJSON=function(){return this.toHexString()},t}();e.Color3=s},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=function(){function t(t){this._length=0,this._points=t,this._length=this._computeLength(t)}return t.CreateQuadraticBezier=function(e,o,r,i){i=i>2?i:3;for(var s=new Array,a=function(t,e,o,n){return(1-t)*(1-t)*e+2*t*(1-t)*o+t*t*n},p=0;p<=i;p++)s.push(new n.Vector3(a(p/i,e.x,o.x,r.x),a(p/i,e.y,o.y,r.y),a(p/i,e.z,o.z,r.z)));return new t(s)},t.CreateCubicBezier=function(e,o,r,i,s){s=s>3?s:4;for(var a=new Array,p=function(t,e,o,n,r){return(1-t)*(1-t)*(1-t)*e+3*t*(1-t)*(1-t)*o+3*t*t*(1-t)*n+t*t*t*r},u=0;u<=s;u++)a.push(new n.Vector3(p(u/s,e.x,o.x,r.x,i.x),p(u/s,e.y,o.y,r.y,i.y),p(u/s,e.z,o.z,r.z,i.z)));return new t(a)},t.CreateHermiteSpline=function(e,o,r,i,s){for(var a=new Array,p=1/s,u=0;u<=s;u++)a.push(n.Vector3.Hermite(e,o,r,i,u*p));return new t(a)},t.CreateCatmullRomSpline=function(e,o,r){var i=new Array,s=1/o,a=0;if(r){for(var p=e.length,u=0;u<p;u++){a=0;for(var h=0;h<o;h++)i.push(n.Vector3.CatmullRom(e[u%p],e[(u+1)%p],e[(u+2)%p],e[(u+3)%p],a)),a+=s}i.push(i[0])}else{var l=new Array;l.push(e[0].clone()),Array.prototype.push.apply(l,e),l.push(e[e.length-1].clone());u=0;for(u=0;u<l.length-3;u++){a=0;for(h=0;h<o;h++)i.push(n.Vector3.CatmullRom(l[u],l[u+1],l[u+2],l[u+3],a)),a+=s}u--,i.push(n.Vector3.CatmullRom(l[u],l[u+1],l[u+2],l[u+3],a))}return new t(i)},t.prototype.getPoints=function(){return this._points},t.prototype.length=function(){return this._length},t.prototype.continue=function(e){for(var o=this._points[this._points.length-1],n=this._points.slice(),r=e.getPoints(),i=1;i<r.length;i++)n.push(r[i].subtract(r[0]).add(o));return new t(n)},t.prototype._computeLength=function(t){for(var e=0,o=1;o<t.length;o++)e+=t[o].subtract(t[o-1]).length();return e},t}();e.Curve3=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(20),r=function(){function t(){}return t.GetPlanes=function(e){for(var o=[],r=0;r<6;r++)o.push(new n.Plane(0,0,0,0));return t.GetPlanesToRef(e,o),o},t.GetNearPlaneToRef=function(t,e){var o=t.m;e.normal.x=o[3]+o[2],e.normal.y=o[7]+o[6],e.normal.z=o[11]+o[10],e.d=o[15]+o[14],e.normalize()},t.GetFarPlaneToRef=function(t,e){var o=t.m;e.normal.x=o[3]-o[2],e.normal.y=o[7]-o[6],e.normal.z=o[11]-o[10],e.d=o[15]-o[14],e.normalize()},t.GetLeftPlaneToRef=function(t,e){var o=t.m;e.normal.x=o[3]+o[0],e.normal.y=o[7]+o[4],e.normal.z=o[11]+o[8],e.d=o[15]+o[12],e.normalize()},t.GetRightPlaneToRef=function(t,e){var o=t.m;e.normal.x=o[3]-o[0],e.normal.y=o[7]-o[4],e.normal.z=o[11]-o[8],e.d=o[15]-o[12],e.normalize()},t.GetTopPlaneToRef=function(t,e){var o=t.m;e.normal.x=o[3]-o[1],e.normal.y=o[7]-o[5],e.normal.z=o[11]-o[9],e.d=o[15]-o[13],e.normalize()},t.GetBottomPlaneToRef=function(t,e){var o=t.m;e.normal.x=o[3]+o[1],e.normal.y=o[7]+o[5],e.normal.z=o[11]+o[9],e.d=o[15]+o[13],e.normalize()},t.GetPlanesToRef=function(e,o){t.GetNearPlaneToRef(e,o[0]),t.GetFarPlaneToRef(e,o[1]),t.GetLeftPlaneToRef(e,o[2]),t.GetRightPlaneToRef(e,o[3]),t.GetTopPlaneToRef(e,o[4]),t.GetBottomPlaneToRef(e,o[5])},t}();e.Frustum=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(14),r=o(18),i=o(0),s=function(){function t(t,e){this.closed=!1,this._points=new Array,this._length=0,this._points.push(new n.Vector2(t,e))}return t.StartingAt=function(e,o){return new t(e,o)},t.prototype.addLineTo=function(t,e){if(this.closed)return this;var o=new n.Vector2(t,e),r=this._points[this._points.length-1];return this._points.push(o),this._length+=o.subtract(r).length(),this},t.prototype.addArcTo=function(t,e,o,s,a){if(void 0===a&&(a=36),this.closed)return this;var p=this._points[this._points.length-1],u=new n.Vector2(t,e),h=new n.Vector2(o,s),l=new r.Arc2(p,u,h),f=l.angle.radians()/a;l.orientation===i.Orientation.CW&&(f*=-1);for(var c=l.startAngle.radians()+f,d=0;d<a;d++){var y=Math.cos(c)*l.radius+l.centerPoint.x,v=Math.sin(c)*l.radius+l.centerPoint.y;this.addLineTo(y,v),c+=f}return this},t.prototype.close=function(){return this.closed=!0,this},t.prototype.length=function(){var t=this._length;if(!this.closed){var e=this._points[this._points.length-1];t+=this._points[0].subtract(e).length()}return t},t.prototype.getPoints=function(){return this._points},t.prototype.getPointAtLengthPosition=function(t){if(t<0||t>1)return n.Vector2.Zero();for(var e=t*this.length(),o=0,r=0;r<this._points.length;r++){var i=(r+1)%this._points.length,s=this._points[r],a=this._points[i].subtract(s),p=a.length()+o;if(e>=o&&e<=p){var u=a.normalize(),h=e-o;return new n.Vector2(s.x+u.x*h,s.y+u.y*h)}o=p}return n.Vector2.Zero()},t}();e.Path2=s},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(2),r=o(0),i=o(3),s=function(){function t(t,e,o){void 0===e&&(e=null),this.path=t,this._curve=new Array,this._distances=new Array,this._tangents=new Array,this._normals=new Array,this._binormals=new Array;for(var n=0;n<t.length;n++)this._curve[n]=t[n].clone();this._raw=o||!1,this._compute(e)}return t.prototype.getCurve=function(){return this._curve},t.prototype.getTangents=function(){return this._tangents},t.prototype.getNormals=function(){return this._normals},t.prototype.getBinormals=function(){return this._binormals},t.prototype.getDistances=function(){return this._distances},t.prototype.update=function(t,e){void 0===e&&(e=null);for(var o=0;o<t.length;o++)this._curve[o].x=t[o].x,this._curve[o].y=t[o].y,this._curve[o].z=t[o].z;return this._compute(e),this},t.prototype._compute=function(t){var e=this._curve.length;this._tangents[0]=this._getFirstNonNullVector(0),this._raw||this._tangents[0].normalize(),this._tangents[e-1]=this._curve[e-1].subtract(this._curve[e-2]),this._raw||this._tangents[e-1].normalize();var o,r,i,s,a=this._tangents[0],p=this._normalVector(this._curve[0],a,t);this._normals[0]=p,this._raw||this._normals[0].normalize(),this._binormals[0]=n.Vector3.Cross(a,this._normals[0]),this._raw||this._binormals[0].normalize(),this._distances[0]=0;for(var u=1;u<e;u++)o=this._getLastNonNullVector(u),u<e-1&&(r=this._getFirstNonNullVector(u),this._tangents[u]=o.add(r),this._tangents[u].normalize()),this._distances[u]=this._distances[u-1]+o.length(),i=this._tangents[u],s=this._binormals[u-1],this._normals[u]=n.Vector3.Cross(s,i),this._raw||this._normals[u].normalize(),this._binormals[u]=n.Vector3.Cross(i,this._normals[u]),this._raw||this._binormals[u].normalize()},t.prototype._getFirstNonNullVector=function(t){for(var e=1,o=this._curve[t+e].subtract(this._curve[t]);0===o.length()&&t+e+1<this._curve.length;)e++,o=this._curve[t+e].subtract(this._curve[t]);return o},t.prototype._getLastNonNullVector=function(t){for(var e=1,o=this._curve[t].subtract(this._curve[t-e]);0===o.length()&&t>e+1;)e++,o=this._curve[t].subtract(this._curve[t-e]);return o},t.prototype._normalVector=function(t,e,o){var s,a=e.length();if(0===a&&(a=1),null==o){var p=void 0;p=i.Scalar.WithinEpsilon(Math.abs(e.y)/a,1,r.Epsilon)?i.Scalar.WithinEpsilon(Math.abs(e.x)/a,1,r.Epsilon)?i.Scalar.WithinEpsilon(Math.abs(e.z)/a,1,r.Epsilon)?n.Vector3.Zero():new n.Vector3(0,0,1):new n.Vector3(1,0,0):new n.Vector3(0,-1,0),s=n.Vector3.Cross(e,p)}else s=n.Vector3.Cross(e,o),n.Vector3.CrossToRef(s,e,s);return s.normalize(),s},t}();e.Path3D=s},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){this.width=t,this.height=e}return Object.defineProperty(t.prototype,"surface",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),t.Zero=function(){return new t(0,0)},t.Lerp=function(e,o,n){return new t(e.width+(o.width-e.width)*n,e.height+(o.height-e.height)*n)},t.prototype.toString=function(){return"{W: "+this.width+", H: "+this.height+"}"},t.prototype.getClassName=function(){return"Size"},t.prototype.getHashCode=function(){var t=this.width||0;return t=397*t^(this.height||0)},t.prototype.copyFrom=function(t){this.width=t.width,this.height=t.height},t.prototype.copyFromFloats=function(t,e){return this.width=t,this.height=e,this},t.prototype.set=function(t,e){return this.copyFromFloats(t,e)},t.prototype.multiplyByFloats=function(e,o){return new t(this.width*e,this.height*o)},t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.equals=function(t){return!!t&&(this.width===t.width&&this.height===t.height)},t.prototype.add=function(e){return new t(this.width+e.width,this.height+e.height)},t.prototype.subtract=function(e){return new t(this.width-e.width,this.height-e.height)},t}();e.Size=n},function(t,e,o){"use strict";var n,r=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),i=this&&this.__decorate||function(t,e,o,n){var r,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(i<3?r(s):i>3?r(e,o,s):r(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s};Object.defineProperty(e,"__esModule",{value:!0});var s=o(1),a=o(13),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui",e.id=null,e.width="1",e.height="1",e.visible=!0,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_WORLD_SPACE_SHAPE)],e)}(a.Shape);e.UIWorldSpaceShape=p;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-fullscreen",e.id=null,e.visible=!0,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_SCREEN_SPACE_SHAPE)],e)}(a.Shape);e.UIScreenSpaceShape=u;var h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-container-rect",e.id=null,e.opacity=1,e.adaptWidth=!1,e.adaptHeight=!1,e.thickness=0,e.cornerRadius=0,e.width="100%",e.height="100%",e.top="0px",e.left="0px",e.color="white",e.background="transparent",e.hAlign="center",e.vAlign="center",e.visible=!0,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"opacity",void 0),i([s.ObservableComponent.field],e.prototype,"adaptWidth",void 0),i([s.ObservableComponent.field],e.prototype,"adaptHeight",void 0),i([s.ObservableComponent.field],e.prototype,"thickness",void 0),i([s.ObservableComponent.field],e.prototype,"cornerRadius",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"top",void 0),i([s.ObservableComponent.field],e.prototype,"left",void 0),i([s.ObservableComponent.field],e.prototype,"color",void 0),i([s.ObservableComponent.field],e.prototype,"background",void 0),i([s.ObservableComponent.field],e.prototype,"hAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vAlign",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_CONTAINER_RECT)],e)}(a.Shape);e.UIContainerRectShape=h;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-container-stack",e.id=null,e.opacity=1,e.adaptWidth=!1,e.adaptHeight=!1,e.width="100%",e.height="100%",e.top="0px",e.left="0px",e.color="white",e.background="transparent",e.hAlign="center",e.vAlign="center",e.vertical=!0,e.visible=!0,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"opacity",void 0),i([s.ObservableComponent.field],e.prototype,"adaptWidth",void 0),i([s.ObservableComponent.field],e.prototype,"adaptHeight",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"top",void 0),i([s.ObservableComponent.field],e.prototype,"left",void 0),i([s.ObservableComponent.field],e.prototype,"color",void 0),i([s.ObservableComponent.field],e.prototype,"background",void 0),i([s.ObservableComponent.field],e.prototype,"hAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vertical",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_CONTAINER_STACK)],e)}(a.Shape);e.UIContainerStackShape=l;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-text",e.id=null,e.outlineWidth=0,e.outlineColor="#fff",e.color="#fff",e.fontFamily="Arial",e.fontSize=100,e.fontWeight="normal",e.opacity=1,e.value="",e.lineSpacing="0px",e.lineCount=0,e.resizeToFit=!1,e.textWrapping=!1,e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor="#fff",e.zIndex=0,e.hAlign="center",e.vAlign="center",e.hTextAlign="center",e.vTextAlign="center",e.width="100%",e.height="100px",e.top="0px",e.left="0px",e.paddingTop="0px",e.paddingRight="0px",e.paddingBottom="0px",e.paddingLeft="0px",e.visible=!0,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"outlineWidth",void 0),i([s.ObservableComponent.field],e.prototype,"outlineColor",void 0),i([s.ObservableComponent.field],e.prototype,"color",void 0),i([s.ObservableComponent.field],e.prototype,"fontFamily",void 0),i([s.ObservableComponent.field],e.prototype,"fontSize",void 0),i([s.ObservableComponent.field],e.prototype,"fontWeight",void 0),i([s.ObservableComponent.field],e.prototype,"opacity",void 0),i([s.ObservableComponent.field],e.prototype,"value",void 0),i([s.ObservableComponent.field],e.prototype,"lineSpacing",void 0),i([s.ObservableComponent.field],e.prototype,"lineCount",void 0),i([s.ObservableComponent.field],e.prototype,"resizeToFit",void 0),i([s.ObservableComponent.field],e.prototype,"textWrapping",void 0),i([s.ObservableComponent.field],e.prototype,"shadowBlur",void 0),i([s.ObservableComponent.field],e.prototype,"shadowOffsetX",void 0),i([s.ObservableComponent.field],e.prototype,"shadowOffsetY",void 0),i([s.ObservableComponent.field],e.prototype,"shadowColor",void 0),i([s.ObservableComponent.field],e.prototype,"zIndex",void 0),i([s.ObservableComponent.field],e.prototype,"hAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vAlign",void 0),i([s.ObservableComponent.field],e.prototype,"hTextAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vTextAlign",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"top",void 0),i([s.ObservableComponent.field],e.prototype,"left",void 0),i([s.ObservableComponent.field],e.prototype,"paddingTop",void 0),i([s.ObservableComponent.field],e.prototype,"paddingRight",void 0),i([s.ObservableComponent.field],e.prototype,"paddingBottom",void 0),i([s.ObservableComponent.field],e.prototype,"paddingLeft",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_TEXT_SHAPE)],e)}(a.Shape);e.UITextShape=f;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-input",e.id=null,e.color="#fff",e.thickness=1,e.fontFamily="Arial",e.fontSize=100,e.fontWeight="normal",e.opacity=1,e.value="",e.placeholderColor="#fff",e.placeholder="",e.margin="10px",e.maxWidth="100%",e.autoStretchWidth=!0,e.background="black",e.focusedBackground="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowColor="#fff",e.zIndex=0,e.hAlign="center",e.vAlign="center",e.width="100%",e.height="50px",e.top="0px",e.left="0px",e.paddingTop="0px",e.paddingRight="0px",e.paddingBottom="0px",e.paddingLeft="0px",e.onChanged="",e.onFocus="",e.onBlur="",e.visible=!0,e.isPointerBlocker=!1,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"color",void 0),i([s.ObservableComponent.field],e.prototype,"thickness",void 0),i([s.ObservableComponent.field],e.prototype,"fontFamily",void 0),i([s.ObservableComponent.field],e.prototype,"fontSize",void 0),i([s.ObservableComponent.field],e.prototype,"fontWeight",void 0),i([s.ObservableComponent.field],e.prototype,"opacity",void 0),i([s.ObservableComponent.field],e.prototype,"value",void 0),i([s.ObservableComponent.field],e.prototype,"placeholderColor",void 0),i([s.ObservableComponent.field],e.prototype,"placeholder",void 0),i([s.ObservableComponent.field],e.prototype,"margin",void 0),i([s.ObservableComponent.field],e.prototype,"maxWidth",void 0),i([s.ObservableComponent.field],e.prototype,"autoStretchWidth",void 0),i([s.ObservableComponent.field],e.prototype,"background",void 0),i([s.ObservableComponent.field],e.prototype,"focusedBackground",void 0),i([s.ObservableComponent.field],e.prototype,"shadowBlur",void 0),i([s.ObservableComponent.field],e.prototype,"shadowOffsetX",void 0),i([s.ObservableComponent.field],e.prototype,"shadowOffsetY",void 0),i([s.ObservableComponent.field],e.prototype,"shadowColor",void 0),i([s.ObservableComponent.field],e.prototype,"zIndex",void 0),i([s.ObservableComponent.field],e.prototype,"hAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vAlign",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"top",void 0),i([s.ObservableComponent.field],e.prototype,"left",void 0),i([s.ObservableComponent.field],e.prototype,"paddingTop",void 0),i([s.ObservableComponent.field],e.prototype,"paddingRight",void 0),i([s.ObservableComponent.field],e.prototype,"paddingBottom",void 0),i([s.ObservableComponent.field],e.prototype,"paddingLeft",void 0),i([s.ObservableComponent.field],e.prototype,"onChanged",void 0),i([s.ObservableComponent.field],e.prototype,"onFocus",void 0),i([s.ObservableComponent.field],e.prototype,"onBlur",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),i([s.ObservableComponent.field],e.prototype,"isPointerBlocker",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_INPUT_TEXT_SHAPE)],e)}(a.Shape);e.UIInputTextShape=c;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-image",e.id=null,e.opacity=1,e.sourceLeft=null,e.sourceTop=null,e.sourceWidth=null,e.sourceHeight=null,e.source=null,e.width="100%",e.height="100%",e.top="0px",e.left="0px",e.hAlign="center",e.vAlign="center",e.paddingTop="0px",e.paddingRight="0px",e.paddingBottom="0px",e.paddingLeft="0px",e.visible=!0,e.isPointerBlocker=!1,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"opacity",void 0),i([s.ObservableComponent.field],e.prototype,"sourceLeft",void 0),i([s.ObservableComponent.field],e.prototype,"sourceTop",void 0),i([s.ObservableComponent.field],e.prototype,"sourceWidth",void 0),i([s.ObservableComponent.field],e.prototype,"sourceHeight",void 0),i([s.ObservableComponent.field],e.prototype,"source",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"top",void 0),i([s.ObservableComponent.field],e.prototype,"left",void 0),i([s.ObservableComponent.field],e.prototype,"hAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vAlign",void 0),i([s.ObservableComponent.field],e.prototype,"paddingTop",void 0),i([s.ObservableComponent.field],e.prototype,"paddingRight",void 0),i([s.ObservableComponent.field],e.prototype,"paddingBottom",void 0),i([s.ObservableComponent.field],e.prototype,"paddingLeft",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),i([s.ObservableComponent.field],e.prototype,"isPointerBlocker",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_IMAGE_SHAPE)],e)}(a.Shape);e.UIImageShape=d;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tag="ui-slider",e.id=null,e.minimum=0,e.maximum=1,e.color="#fff",e.opacity=1,e.value=0,e.borderColor="#fff",e.background="black",e.barOffset="5px",e.thumbWidth="30px",e.isThumbCircle=!1,e.isThumbClamped=!1,e.isVertical=!1,e.visible=!0,e.zIndex=0,e.hAlign="center",e.vAlign="center",e.width="100%",e.height="20px",e.top="0px",e.left="0px",e.paddingTop="0px",e.paddingRight="0px",e.paddingBottom="0px",e.paddingLeft="0px",e.onChanged="",e.swapOrientation=!1,e.isPointerBlocker=!1,e}return r(e,t),i([s.ObservableComponent.readonly],e.prototype,"tag",void 0),i([s.ObservableComponent.field],e.prototype,"id",void 0),i([s.ObservableComponent.field],e.prototype,"minimum",void 0),i([s.ObservableComponent.field],e.prototype,"maximum",void 0),i([s.ObservableComponent.field],e.prototype,"color",void 0),i([s.ObservableComponent.field],e.prototype,"opacity",void 0),i([s.ObservableComponent.field],e.prototype,"value",void 0),i([s.ObservableComponent.field],e.prototype,"borderColor",void 0),i([s.ObservableComponent.field],e.prototype,"background",void 0),i([s.ObservableComponent.field],e.prototype,"barOffset",void 0),i([s.ObservableComponent.field],e.prototype,"thumbWidth",void 0),i([s.ObservableComponent.field],e.prototype,"isThumbCircle",void 0),i([s.ObservableComponent.field],e.prototype,"isThumbClamped",void 0),i([s.ObservableComponent.field],e.prototype,"isVertical",void 0),i([s.ObservableComponent.field],e.prototype,"visible",void 0),i([s.ObservableComponent.field],e.prototype,"zIndex",void 0),i([s.ObservableComponent.field],e.prototype,"hAlign",void 0),i([s.ObservableComponent.field],e.prototype,"vAlign",void 0),i([s.ObservableComponent.field],e.prototype,"width",void 0),i([s.ObservableComponent.field],e.prototype,"height",void 0),i([s.ObservableComponent.field],e.prototype,"top",void 0),i([s.ObservableComponent.field],e.prototype,"left",void 0),i([s.ObservableComponent.field],e.prototype,"paddingTop",void 0),i([s.ObservableComponent.field],e.prototype,"paddingRight",void 0),i([s.ObservableComponent.field],e.prototype,"paddingBottom",void 0),i([s.ObservableComponent.field],e.prototype,"paddingLeft",void 0),i([s.ObservableComponent.field],e.prototype,"onChanged",void 0),i([s.ObservableComponent.field],e.prototype,"swapOrientation",void 0),i([s.ObservableComponent.field],e.prototype,"isPointerBlocker",void 0),e=i([s.Component("engine.shape",a.CLASS_ID.UI_SLIDER_SHAPE)],e)}(a.Shape);e.UISliderShape=y},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=o(5),r=function(){function t(){var t=this;this.position=new n.Vector3,this.rotation=new n.Quaternion,this.lastEventPosition={x:0,y:0,z:0},this.lastEventRotation={x:0,y:0,z:0,w:1},"undefined"!=typeof dcl&&(dcl.subscribe("positionChanged"),dcl.subscribe("rotationChanged"),dcl.onEvent(function(e){"positionChanged"===e.type?t.positionChanged(e.data):"rotationChanged"===e.type&&t.rotationChanged(e.data)})),Object.defineProperty(this.position,"x",{get:function(){return t.lastEventPosition.x}}),Object.defineProperty(this.position,"y",{get:function(){return t.lastEventPosition.y}}),Object.defineProperty(this.position,"z",{get:function(){return t.lastEventPosition.z}}),Object.defineProperty(this.rotation,"x",{get:function(){return t.lastEventRotation.x}}),Object.defineProperty(this.rotation,"y",{get:function(){return t.lastEventRotation.y}}),Object.defineProperty(this.rotation,"z",{get:function(){return t.lastEventRotation.z}}),Object.defineProperty(this.rotation,"w",{get:function(){return t.lastEventRotation.w}})}return Object.defineProperty(t,"instance",{get:function(){return t._instance||(t._instance=new t),t._instance},enumerable:!0,configurable:!0}),t.prototype.positionChanged=function(t){this.lastEventPosition=t.position},t.prototype.rotationChanged=function(t){this.lastEventRotation=t.quaternion},t}();e.Camera=r},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,r=o(5);!function(t){t.PRIMARY="PRIMARY",t.SECONDARY="SECONDARY"}(n=e.Pointer||(e.Pointer={}));var i=function(){function t(){var t,e=this;this.subscriptions={BUTTON_A_DOWN:[],BUTTON_A_UP:[]},this.internalState=((t={})[n.PRIMARY]={BUTTON_A_DOWN:!1},t[n.SECONDARY]={BUTTON_A_DOWN:!1},t),"undefined"!=typeof dcl&&(dcl.subscribe("pointerUp"),dcl.subscribe("pointerDown"),dcl.onEvent(function(t){"pointerUp"===t.type?e.handlePointerUp(t.data):"pointerDown"===t.type&&e.handlePointerDown(t.data)}))}return Object.defineProperty(t,"instance",{get:function(){return t._instance||(t._instance=new t),t._instance},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this.internalState},enumerable:!0,configurable:!0}),t.prototype.subscribe=function(t,e){var o=this;return this.subscriptions[t].push(e),function(){return o.unsubscribe(t,e)}},t.prototype.unsubscribe=function(t,e){var o=this.subscriptions[t].indexOf(e);o>-1&&this.subscriptions[t].splice(o,1)},t.prototype.getPointerById=function(t){return 1===t?n.PRIMARY:n.SECONDARY},t.prototype.handlePointerUp=function(t){var e=this.getPointerById(t.pointerId),o={length:t.length,from:new r.Vector3(t.from.x,t.from.y,t.from.z),direction:new r.Vector3(t.direction.x,t.direction.y,t.direction.z),pointerId:e};this.internalState[n.PRIMARY].BUTTON_A_DOWN=!1;for(var i=0;i<this.subscriptions.BUTTON_A_UP.length;i++)this.subscriptions.BUTTON_A_UP[i](o)},t.prototype.handlePointerDown=function(t){var e=this.getPointerById(t.pointerId),o={length:t.length,from:new r.Vector3(t.from.x,t.from.y,t.from.z),direction:new r.Vector3(t.direction.x,t.direction.y,t.direction.z),pointerId:e};this.internalState[n.PRIMARY].BUTTON_A_DOWN=!0;for(var i=0;i<this.subscriptions.BUTTON_A_DOWN.length;i++)this.subscriptions.BUTTON_A_DOWN[i](o)},t}();e.Input=i}]));;
  /*! dcl-amd */;
  var loader;(function(e){"use strict";var r=1;var d=2;var i=[];var f={baseUrl:""};var c={};function n(e){if(typeof e==="object"){for(var n in e){if(e.hasOwnProperty(n)){f[n]=e[n]}}}}e.config=n;function l(t,e,o){var n=arguments.length;if(n===1){o=t;e=["require","exports","module"];t=null}else if(n===2){if(f.toString.call(t)==="[object Array]"){o=e;e=t;t=null}else{o=e;e=["require","exports","module"]}}if(!t){i.push([e,o]);return}function r(){var e,n;if(c[t]){e=c[t].handlers;n=c[t].context}var r=c[t]=typeof o==="function"?o.apply(null,i.slice.call(arguments,0))||c[t]||{}:o;r.dclamd=d;r.context=n;for(var l=0,a=e?e.length:0;l<a;l++){e[l](r)}}u(e,r,t)}e.define=l;(function(e){e.amd={}})(l=e.define||(e.define={}));function u(r,l,a){var t=[];var o=0;var i=false;if(typeof r==="string"){if(c[r]&&c[r].dclamd===d){return c[r]}throw new Error(r+" has not been defined. Please include it as a dependency in "+a+"'s define()")}var f=r.length;var e=function(n){switch(r[n]){case"require":var e=function(e,n){return u(e,n,a)};e.toUrl=function(e){return p(e,a)};t[n]=e;o++;break;case"exports":t[n]=c[a]||(c[a]={});o++;break;case"module":t[n]={id:a,uri:p(a)};o++;break;case c[a]?c[a].context:"":t[n]=c[c[a].context];o++;break;default:s(r[n],function(e){t[n]=e;o++;if(o===f&&l){i=true;l.apply(null,t)}if(c[r[n]]){c[r[n]].dclamd=d}},a)}};for(var n=0;n<f;n++){e(n)}if(!i&&o===f&&l){l.apply(null,t)}}e.require=u;function t(e,n){return function(){return dcl.callRpc(e,n.name,i.slice.call(arguments,0))}}function s(e,a,n){e=n?p(e,n):e;if(c[e]){if(c[e].dclamd===r){a&&c[e].handlers.push(a)}else{a&&a(c[e])}return}else{c[e]={name:e,dclamd:r,handlers:[a],context:n}}if(e.indexOf("@")===0){if(typeof dcl!=="undefined"){dcl.loadModule(e).then(function(e){var n={};for(var r in e.methods){var l=e.methods[r];n[l.name]=t(e.rpcHandle,l)}a(n)})}}}if(typeof dcl!=="undefined"){dcl.onStart(function(){var e=[];for(var n in c){if(c[n]&&c[n].dclamd===r){e.push(c[n])}}if(e.length){throw new Error("These modules didn't load: "+e.map(function(e){return e.name}).join(", "))}})}function p(e,n){var r=false;switch(e){case"require":case"exports":case"module":return e}var l=(n||f.baseUrl).split("/");l.pop();var a=e.split("/");var t=a.length;while(--t){switch(e[0]){case"..":l.pop();case".":case"":a.shift();r=true}}return(l.length&&r?l.join("/")+"/":"")+a.join("/")}u.toUrl=p})(loader||(loader={}));global=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof this!=="undefined"?this:null;if(!global)throw new Error("unknown global context");global.define=loader.define;global.dclamd=loader;;
  /*! code */;
  eval("var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __values = (this && this.__values) || function (o) {\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\n    if (m) return m.call(o);\n    return {\n        next: function () {\n            if (o && i >= o.length) o = void 0;\n            return { value: o && o[i++], done: !o };\n        }\n    };\n};\ndefine(\"game\", [\"require\", \"exports\"], function (require, exports) {\r\n    \"use strict\";\r\n    Object.defineProperty(exports, \"__esModule\", { value: true });\r\n    // Custom component to handle wheel spinning\r\n    var WheelSpin = /** @class */ (function () {\r\n        function WheelSpin() {\r\n            this.active = false;\r\n            this.speed = 30;\r\n            this.direction = Vector3.Up();\r\n        }\r\n        WheelSpin = __decorate([\r\n            Component('wheelSpin')\r\n        ], WheelSpin);\r\n        return WheelSpin;\r\n    }());\r\n    exports.WheelSpin = WheelSpin;\r\n    // This group keeps track of all entities with a WheelSpin component\r\n    var wheels = engine.getComponentGroup(WheelSpin);\r\n    // This system carries out the rotation on each frame\r\n    var RotatorSystem = /** @class */ (function () {\r\n        function RotatorSystem() {\r\n        }\r\n        RotatorSystem.prototype.update = function (dt) {\r\n            var e_1, _a;\r\n            try {\r\n                // iterate over the wheels in the component group\r\n                for (var _b = __values(wheels.entities), _c = _b.next(); !_c.done; _c = _b.next()) {\r\n                    var wheel = _c.value;\r\n                    // handy shortcuts\r\n                    var spin = wheel.get(WheelSpin);\r\n                    var transform = wheel.get(Transform);\r\n                    // check state\r\n                    if (spin.active) {\r\n                        // spin the wheel\r\n                        transform.rotate(spin.direction, spin.speed * dt);\r\n                    }\r\n                }\r\n            }\r\n            catch (e_1_1) { e_1 = { error: e_1_1 }; }\r\n            finally {\r\n                try {\r\n                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\r\n                }\r\n                finally { if (e_1) throw e_1.error; }\r\n            }\r\n        };\r\n        return RotatorSystem;\r\n    }());\r\n    exports.RotatorSystem = RotatorSystem;\r\n    // Add system to engine\r\n    engine.addSystem(new RotatorSystem());\r\n    // Background scenery entity\r\n    var stage = new Entity();\r\n    stage.set(new GLTFShape(\"models/Theatre.gltf\"));\r\n    stage.set(new Transform({\r\n        position: new Vector3(5, 0, 5),\r\n        rotation: Quaternion.Euler(0, 90, 0)\r\n    }));\r\n    engine.addEntity(stage);\r\n    // Define a reusable Cylinder shape component\r\n    var CylinderWCollisions = new CylinderShape();\r\n    CylinderWCollisions.withCollisions = true;\r\n    // Create wheel entities\r\n    var wheel1 = new Entity();\r\n    wheel1.set(CylinderWCollisions);\r\n    wheel1.set(new Transform({\r\n        position: new Vector3(3, 2, 6),\r\n        rotation: Quaternion.Euler(90, 0, 0),\r\n        scale: new Vector3(1, 0.05, 1)\r\n    }));\r\n    engine.addEntity(wheel1);\r\n    var wheel2 = new Entity();\r\n    wheel2.set(CylinderWCollisions);\r\n    wheel2.set(new Transform({\r\n        position: new Vector3(7, 2, 6),\r\n        rotation: Quaternion.Euler(90, 0, 0),\r\n        scale: new Vector3(1, 0.05, 1)\r\n    }));\r\n    engine.addEntity(wheel2);\r\n    // Create material\r\n    var SpiralMaterial = new Material();\r\n    SpiralMaterial.albedoTexture = \"materials/hypno-wheel.png\";\r\n    // Add material to wheels\r\n    wheel1.set(SpiralMaterial);\r\n    wheel2.set(SpiralMaterial);\r\n    // Add the custom component to the wheels\r\n    wheel1.set(new WheelSpin());\r\n    wheel2.set(new WheelSpin());\r\n    // Change the direction for wheel2 (wheel1 is left with the default direction `Up`)\r\n    wheel2.get(WheelSpin).direction = Vector3.Down();\r\n    // Set the click behavior for the wheels\r\n    wheel1.set(new OnClick(function (e) {\r\n        var spin = wheel1.get(WheelSpin);\r\n        if (!spin.active) {\r\n            spin.active = true;\r\n        }\r\n        else {\r\n            spin.speed += 20;\r\n        }\r\n        //log(\"speed: \", spin.speed)\r\n    }));\r\n    wheel2.set(new OnClick(function (e) {\r\n        var spin = wheel2.get(WheelSpin);\r\n        if (!spin.active) {\r\n            spin.active = true;\r\n        }\r\n        else {\r\n            spin.speed += 30;\r\n        }\r\n        //log(\"speed: \", spin.speed)\r\n    }));\r\n});\r\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2FtZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9nYW1lLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFBQSw0Q0FBNEM7SUFFNUM7UUFEQTtZQUVFLFdBQU0sR0FBWSxLQUFLLENBQUE7WUFDdkIsVUFBSyxHQUFXLEVBQUUsQ0FBQTtZQUNsQixjQUFTLEdBQVksT0FBTyxDQUFDLEVBQUUsRUFBRSxDQUFBO1FBQ25DLENBQUM7UUFKWSxTQUFTO1lBRHJCLFNBQVMsQ0FBQyxXQUFXLENBQUM7V0FDVixTQUFTLENBSXJCO1FBQUQsZ0JBQUM7S0FBQSxBQUpELElBSUM7SUFKWSw4QkFBUztJQU10QixvRUFBb0U7SUFDcEUsSUFBTSxNQUFNLEdBQUcsTUFBTSxDQUFDLGlCQUFpQixDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBRWxELHFEQUFxRDtJQUNyRDtRQUFBO1FBZUEsQ0FBQztRQWJDLDhCQUFNLEdBQU4sVUFBTyxFQUFVOzs7Z0JBQ2YsaURBQWlEO2dCQUNqRCxLQUFrQixJQUFBLEtBQUEsU0FBQSxNQUFNLENBQUMsUUFBUSxDQUFBLGdCQUFBLDRCQUFFO29CQUE5QixJQUFJLEtBQUssV0FBQTtvQkFDWixrQkFBa0I7b0JBQ2xCLElBQUksSUFBSSxHQUFHLEtBQUssQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUE7b0JBQy9CLElBQUksU0FBUyxHQUFHLEtBQUssQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUE7b0JBQ3BDLGNBQWM7b0JBQ2QsSUFBSSxJQUFJLENBQUMsTUFBTSxFQUFDO3dCQUNkLGlCQUFpQjt3QkFDakIsU0FBUyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLElBQUksQ0FBQyxLQUFLLEdBQUcsRUFBRSxDQUFDLENBQUE7cUJBQ2xEO2lCQUNGOzs7Ozs7Ozs7UUFDSCxDQUFDO1FBQ0gsb0JBQUM7SUFBRCxDQUFDLEFBZkQsSUFlQztJQWZZLHNDQUFhO0lBaUIxQix1QkFBdUI7SUFDdkIsTUFBTSxDQUFDLFNBQVMsQ0FBQyxJQUFJLGFBQWEsRUFBRSxDQUFDLENBQUE7SUFHckMsNEJBQTRCO0lBQzVCLElBQUksS0FBSyxHQUFHLElBQUksTUFBTSxFQUFFLENBQUE7SUFDeEIsS0FBSyxDQUFDLEdBQUcsQ0FBQyxJQUFJLFNBQVMsQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDLENBQUE7SUFDL0MsS0FBSyxDQUFDLEdBQUcsQ0FBQyxJQUFJLFNBQVMsQ0FBQztRQUN0QixRQUFRLEVBQUUsSUFBSSxPQUFPLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDOUIsUUFBUSxFQUFFLFVBQVUsQ0FBQyxLQUFLLENBQUMsQ0FBQyxFQUFFLEVBQUUsRUFBRSxDQUFDLENBQUM7S0FDckMsQ0FBQyxDQUFDLENBQUE7SUFDSCxNQUFNLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxDQUFBO0lBRXZCLDZDQUE2QztJQUM3QyxJQUFJLG1CQUFtQixHQUFHLElBQUksYUFBYSxFQUFFLENBQUE7SUFDN0MsbUJBQW1CLENBQUMsY0FBYyxHQUFHLElBQUksQ0FBQTtJQUV6Qyx3QkFBd0I7SUFDeEIsSUFBSSxNQUFNLEdBQUcsSUFBSSxNQUFNLEVBQUUsQ0FBQTtJQUN6QixNQUFNLENBQUMsR0FBRyxDQUFDLG1CQUFtQixDQUFDLENBQUE7SUFDL0IsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLFNBQVMsQ0FBQztRQUN2QixRQUFRLEVBQUUsSUFBSSxPQUFPLENBQUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDOUIsUUFBUSxFQUFFLFVBQVUsQ0FBQyxLQUFLLENBQUMsRUFBRSxFQUFFLENBQUMsRUFBRSxDQUFDLENBQUM7UUFDcEMsS0FBSyxFQUFFLElBQUksT0FBTyxDQUFDLENBQUMsRUFBRSxJQUFJLEVBQUUsQ0FBQyxDQUFDO0tBQy9CLENBQUMsQ0FBQyxDQUFBO0lBQ0gsTUFBTSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsQ0FBQTtJQUV4QixJQUFJLE1BQU0sR0FBRyxJQUFJLE1BQU0sRUFBRSxDQUFBO0lBQ3pCLE1BQU0sQ0FBQyxHQUFHLENBQUMsbUJBQW1CLENBQUMsQ0FBQTtJQUMvQixNQUFNLENBQUMsR0FBRyxDQUFDLElBQUksU0FBUyxDQUFDO1FBQ3ZCLFFBQVEsRUFBRSxJQUFJLE9BQU8sQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUM5QixRQUFRLEVBQUUsVUFBVSxDQUFDLEtBQUssQ0FBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUNwQyxLQUFLLEVBQUUsSUFBSSxPQUFPLENBQUMsQ0FBQyxFQUFFLElBQUksRUFBRSxDQUFDLENBQUM7S0FDL0IsQ0FBQyxDQUFDLENBQUE7SUFDSCxNQUFNLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxDQUFBO0lBRXhCLGtCQUFrQjtJQUNsQixJQUFJLGNBQWMsR0FBRyxJQUFJLFFBQVEsRUFBRSxDQUFBO0lBQ25DLGNBQWMsQ0FBQyxhQUFhLEdBQUcsMkJBQTJCLENBQUE7SUFFMUQseUJBQXlCO0lBQ3pCLE1BQU0sQ0FBQyxHQUFHLENBQUMsY0FBYyxDQUFDLENBQUE7SUFDMUIsTUFBTSxDQUFDLEdBQUcsQ0FBQyxjQUFjLENBQUMsQ0FBQTtJQUUxQix5Q0FBeUM7SUFDekMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLFNBQVMsRUFBRSxDQUFDLENBQUE7SUFDM0IsTUFBTSxDQUFDLEdBQUcsQ0FBQyxJQUFJLFNBQVMsRUFBRSxDQUFDLENBQUE7SUFFM0IsbUZBQW1GO0lBQ25GLE1BQU0sQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUMsU0FBUyxHQUFHLE9BQU8sQ0FBQyxJQUFJLEVBQUUsQ0FBQTtJQUVoRCx3Q0FBd0M7SUFDeEMsTUFBTSxDQUFDLEdBQUcsQ0FDUixJQUFJLE9BQU8sQ0FBQyxVQUFBLENBQUM7UUFDWCxJQUFJLElBQUksR0FBRyxNQUFNLENBQUMsR0FBRyxDQUFDLFNBQVMsQ0FBQyxDQUFBO1FBQ2hDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFDO1lBQ2YsSUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUE7U0FDbkI7YUFBTTtZQUNMLElBQUksQ0FBQyxLQUFLLElBQUksRUFBRSxDQUFBO1NBQ2pCO1FBQ0QsNEJBQTRCO0lBQzlCLENBQUMsQ0FBQyxDQUNILENBQUE7SUFFRCxNQUFNLENBQUMsR0FBRyxDQUNSLElBQUksT0FBTyxDQUFDLFVBQUEsQ0FBQztRQUNYLElBQUksSUFBSSxHQUFHLE1BQU0sQ0FBQyxHQUFHLENBQUMsU0FBUyxDQUFDLENBQUE7UUFDaEMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUM7WUFDZixJQUFJLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQTtTQUNuQjthQUFNO1lBQ0wsSUFBSSxDQUFDLEtBQUssSUFBSSxFQUFFLENBQUE7U0FDakI7UUFDRCw0QkFBNEI7SUFDOUIsQ0FBQyxDQUFDLENBQ0gsQ0FBQSIsInNvdXJjZXNDb250ZW50IjpbIi8vIEN1c3RvbSBjb21wb25lbnQgdG8gaGFuZGxlIHdoZWVsIHNwaW5uaW5nXG5AQ29tcG9uZW50KCd3aGVlbFNwaW4nKVxuZXhwb3J0IGNsYXNzIFdoZWVsU3BpbiB7XG4gIGFjdGl2ZTogYm9vbGVhbiA9IGZhbHNlXG4gIHNwZWVkOiBudW1iZXIgPSAzMFxuICBkaXJlY3Rpb246IFZlY3RvcjMgPSBWZWN0b3IzLlVwKClcbn1cblxuLy8gVGhpcyBncm91cCBrZWVwcyB0cmFjayBvZiBhbGwgZW50aXRpZXMgd2l0aCBhIFdoZWVsU3BpbiBjb21wb25lbnRcbmNvbnN0IHdoZWVscyA9IGVuZ2luZS5nZXRDb21wb25lbnRHcm91cChXaGVlbFNwaW4pXG5cbi8vIFRoaXMgc3lzdGVtIGNhcnJpZXMgb3V0IHRoZSByb3RhdGlvbiBvbiBlYWNoIGZyYW1lXG5leHBvcnQgY2xhc3MgUm90YXRvclN5c3RlbSBpbXBsZW1lbnRzIElTeXN0ZW0ge1xuIFxuICB1cGRhdGUoZHQ6IG51bWJlcikge1xuICAgIC8vIGl0ZXJhdGUgb3ZlciB0aGUgd2hlZWxzIGluIHRoZSBjb21wb25lbnQgZ3JvdXBcbiAgICBmb3IgKGxldCB3aGVlbCBvZiB3aGVlbHMuZW50aXRpZXMpIHtcbiAgICAgIC8vIGhhbmR5IHNob3J0Y3V0c1xuICAgICAgbGV0IHNwaW4gPSB3aGVlbC5nZXQoV2hlZWxTcGluKVxuICAgICAgbGV0IHRyYW5zZm9ybSA9IHdoZWVsLmdldChUcmFuc2Zvcm0pXG4gICAgICAvLyBjaGVjayBzdGF0ZVxuICAgICAgaWYgKHNwaW4uYWN0aXZlKXtcbiAgICAgICAgLy8gc3BpbiB0aGUgd2hlZWxcbiAgICAgICAgdHJhbnNmb3JtLnJvdGF0ZShzcGluLmRpcmVjdGlvbiwgc3Bpbi5zcGVlZCAqIGR0KVxuICAgICAgfVxuICAgIH1cbiAgfVxufVxuXG4vLyBBZGQgc3lzdGVtIHRvIGVuZ2luZVxuZW5naW5lLmFkZFN5c3RlbShuZXcgUm90YXRvclN5c3RlbSgpKVxuXG5cbi8vIEJhY2tncm91bmQgc2NlbmVyeSBlbnRpdHlcbmxldCBzdGFnZSA9IG5ldyBFbnRpdHkoKVxuc3RhZ2Uuc2V0KG5ldyBHTFRGU2hhcGUoXCJtb2RlbHMvVGhlYXRyZS5nbHRmXCIpKVxuc3RhZ2Uuc2V0KG5ldyBUcmFuc2Zvcm0oe1xuICBwb3NpdGlvbjogbmV3IFZlY3RvcjMoNSwgMCwgNSksXG4gIHJvdGF0aW9uOiBRdWF0ZXJuaW9uLkV1bGVyKDAsIDkwLCAwKVxufSkpXG5lbmdpbmUuYWRkRW50aXR5KHN0YWdlKVxuXG4vLyBEZWZpbmUgYSByZXVzYWJsZSBDeWxpbmRlciBzaGFwZSBjb21wb25lbnRcbmxldCBDeWxpbmRlcldDb2xsaXNpb25zID0gbmV3IEN5bGluZGVyU2hhcGUoKVxuQ3lsaW5kZXJXQ29sbGlzaW9ucy53aXRoQ29sbGlzaW9ucyA9IHRydWVcblxuLy8gQ3JlYXRlIHdoZWVsIGVudGl0aWVzXG5sZXQgd2hlZWwxID0gbmV3IEVudGl0eSgpXG53aGVlbDEuc2V0KEN5bGluZGVyV0NvbGxpc2lvbnMpXG53aGVlbDEuc2V0KG5ldyBUcmFuc2Zvcm0oe1xuICBwb3NpdGlvbjogbmV3IFZlY3RvcjMoMywgMiwgNiksXG4gIHJvdGF0aW9uOiBRdWF0ZXJuaW9uLkV1bGVyKDkwLCAwLCAwKSxcbiAgc2NhbGU6IG5ldyBWZWN0b3IzKDEsIDAuMDUsIDEpXG59KSlcbmVuZ2luZS5hZGRFbnRpdHkod2hlZWwxKVxuXG5sZXQgd2hlZWwyID0gbmV3IEVudGl0eSgpXG53aGVlbDIuc2V0KEN5bGluZGVyV0NvbGxpc2lvbnMpXG53aGVlbDIuc2V0KG5ldyBUcmFuc2Zvcm0oe1xuICBwb3NpdGlvbjogbmV3IFZlY3RvcjMoNywgMiwgNiksXG4gIHJvdGF0aW9uOiBRdWF0ZXJuaW9uLkV1bGVyKDkwLCAwLCAwKSxcbiAgc2NhbGU6IG5ldyBWZWN0b3IzKDEsIDAuMDUsIDEpXG59KSlcbmVuZ2luZS5hZGRFbnRpdHkod2hlZWwyKVxuXG4vLyBDcmVhdGUgbWF0ZXJpYWxcbmxldCBTcGlyYWxNYXRlcmlhbCA9IG5ldyBNYXRlcmlhbCgpXG5TcGlyYWxNYXRlcmlhbC5hbGJlZG9UZXh0dXJlID0gXCJtYXRlcmlhbHMvaHlwbm8td2hlZWwucG5nXCJcblxuLy8gQWRkIG1hdGVyaWFsIHRvIHdoZWVsc1xud2hlZWwxLnNldChTcGlyYWxNYXRlcmlhbClcbndoZWVsMi5zZXQoU3BpcmFsTWF0ZXJpYWwpXG5cbi8vIEFkZCB0aGUgY3VzdG9tIGNvbXBvbmVudCB0byB0aGUgd2hlZWxzXG53aGVlbDEuc2V0KG5ldyBXaGVlbFNwaW4oKSlcbndoZWVsMi5zZXQobmV3IFdoZWVsU3BpbigpKVxuXG4vLyBDaGFuZ2UgdGhlIGRpcmVjdGlvbiBmb3Igd2hlZWwyICh3aGVlbDEgaXMgbGVmdCB3aXRoIHRoZSBkZWZhdWx0IGRpcmVjdGlvbiBgVXBgKVxud2hlZWwyLmdldChXaGVlbFNwaW4pLmRpcmVjdGlvbiA9IFZlY3RvcjMuRG93bigpXG5cbi8vIFNldCB0aGUgY2xpY2sgYmVoYXZpb3IgZm9yIHRoZSB3aGVlbHNcbndoZWVsMS5zZXQoXG4gIG5ldyBPbkNsaWNrKGUgPT4ge1xuICAgIGxldCBzcGluID0gd2hlZWwxLmdldChXaGVlbFNwaW4pXG4gICAgaWYgKCFzcGluLmFjdGl2ZSl7XG4gICAgICBzcGluLmFjdGl2ZSA9IHRydWVcbiAgICB9IGVsc2Uge1xuICAgICAgc3Bpbi5zcGVlZCArPSAyMFxuICAgIH1cbiAgICAvL2xvZyhcInNwZWVkOiBcIiwgc3Bpbi5zcGVlZClcbiAgfSlcbilcblxud2hlZWwyLnNldChcbiAgbmV3IE9uQ2xpY2soZSA9PiB7XG4gICAgbGV0IHNwaW4gPSB3aGVlbDIuZ2V0KFdoZWVsU3BpbilcbiAgICBpZiAoIXNwaW4uYWN0aXZlKXtcbiAgICAgIHNwaW4uYWN0aXZlID0gdHJ1ZVxuICAgIH0gZWxzZSB7XG4gICAgICBzcGluLnNwZWVkICs9IDMwXG4gICAgfVxuICAgIC8vbG9nKFwic3BlZWQ6IFwiLCBzcGluLnNwZWVkKVxuICB9KVxuKVxuXG5cblxuIl19");