UNPKG

@awayjs/scene

Version:
1 lines 345 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@awayjs/core"),require("@awayjs/stage"),require("@awayjs/view"),require("@awayjs/graphics"),require("@awayjs/renderer"),require("@awayjs/materials")):"function"==typeof define&&define.amd?define(["exports","@awayjs/core","@awayjs/stage","@awayjs/view","@awayjs/graphics","@awayjs/renderer","@awayjs/materials"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).AwayjsScene={},t.AwayjsCore,t.AwayjsStage,t.AwayjsView,t.AwayjsGraphics,t.AwayjsRenderer,t.AwayjsMaterials)}(this,(function(t,e,i,r,s,n,o){"use strict";var a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},a(t,e)};function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}"function"==typeof SuppressedError&&SuppressedError;var h,c,u=function(t){function i(){var e=t.call(this)||this;return e._pObjects=new Array,e}return l(i,t),i.prototype.getNewObject=function(){var t=this._pCreateObject();return this._pObjects.push(t),t},i.prototype._pCreateObject=function(){throw new e.AbstractMethodError},i.prototype._iValidate=function(){},i}(e.AssetBase),p=function(t){function r(e,r){void 0===e&&(e=null),void 0===r&&(r="triangle");var s=t.call(this)||this;if(s._primitiveDirty=!0,s._uvDirty=!0,s._scaleU=1,s._scaleV=1,s._material=e,s._elementsType=r,s._elementsType==n.ElementsType.TRIANGLE){var o=new n.TriangleElements(new i.AttributesBuffer);o.autoDeriveNormals=!1,o.autoDeriveTangents=!1,s._elements=o}else s._elementsType==n.ElementsType.LINE&&(s._elements=new n.LineElements(new i.AttributesBuffer));return s}return l(r,t),Object.defineProperty(r.prototype,"assetType",{get:function(){return r.assetType},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"elementsType",{get:function(){return this._elementsType},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"material",{get:function(){return this._material},set:function(t){if(t!=this._material){this._material=t;for(var e=this._pObjects.length,i=0;i<e;i++)this._pObjects[i].material=this._material}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scaleU",{get:function(){return this._scaleU},set:function(t){this._scaleU!=t&&(this._scaleU=t,this._pInvalidateUVs())},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"scaleV",{get:function(){return this._scaleV},set:function(t){this._scaleV!=t&&(this._scaleV=t,this._pInvalidateUVs())},enumerable:!1,configurable:!0}),r.prototype._pBuildGraphics=function(t,i){throw new e.AbstractMethodError},r.prototype._pBuildUVs=function(t,i){throw new e.AbstractMethodError},r.prototype._pInvalidatePrimitive=function(){this._primitiveDirty=!0},r.prototype._pInvalidateUVs=function(){this._uvDirty=!0},r.prototype.updateGraphics=function(){this._pBuildGraphics(this._elements,this._elementsType),this._primitiveDirty=!1},r.prototype.updateUVs=function(){this._pBuildUVs(this._elements,this._elementsType),this._uvDirty=!1},r.prototype._iValidate=function(){this._primitiveDirty&&this.updateGraphics(),this._uvDirty&&this.updateUVs()},r.prototype._pCreateObject=function(){var t=new y(null,this._material);return t.graphics.addShape(s.Shape.getShape(this._elements)),t._iSourcePrefab=this,t},r.assetType="[asset PrimitivePrefab]",r}(u),d=function(t){function e(e,i,r,s,n,o,a,l,h){void 0===e&&(e=null),void 0===i&&(i="triangle"),void 0===r&&(r=100),void 0===s&&(s=100),void 0===n&&(n=100),void 0===o&&(o=1),void 0===a&&(a=1),void 0===l&&(l=1),void 0===h&&(h=!0);var c=t.call(this,e,i)||this;return c._width=r,c._height=s,c._depth=n,c._segmentsW=o,c._segmentsH=a,c._segmentsD=l,c._tile6=h,c}return l(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t,this._pInvalidatePrimitive()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t,this._pInvalidatePrimitive()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"depth",{get:function(){return this._depth},set:function(t){this._depth=t,this._pInvalidatePrimitive()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tile6",{get:function(){return this._tile6},set:function(t){this._tile6=t,this._pInvalidatePrimitive()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segmentsW",{get:function(){return this._segmentsW},set:function(t){this._segmentsW=t,this._pInvalidatePrimitive(),this._pInvalidateUVs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segmentsH",{get:function(){return this._segmentsH},set:function(t){this._segmentsH=t,this._pInvalidatePrimitive(),this._pInvalidateUVs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segmentsD",{get:function(){return this._segmentsD},set:function(t){this._segmentsD=t,this._pInvalidatePrimitive(),this._pInvalidateUVs()},enumerable:!1,configurable:!0}),e.prototype._pBuildGraphics=function(t,e){var i,r,s,o,a,l,h,c,u,p,d,_,f,g,m,y,b,v=0,x=this._width/2,w=this._height/2,A=this._depth/2;if(e==n.ElementsType.TRIANGLE){var E=t,D=2*((this._segmentsW+1)*(this._segmentsH+1)+(this._segmentsW+1)*(this._segmentsD+1)+(this._segmentsH+1)*(this._segmentsD+1)),T=12*(this._segmentsW*this._segmentsH+this._segmentsW*this._segmentsD+this._segmentsH*this._segmentsD);for(D==E.numVertices&&null!=E.indices?(E.invalidateIndices(),E.invalidateVertices(E.positions),E.invalidateVertices(E.normals),E.invalidateVertices(E.tangents)):(E.setIndices(new Uint16Array(T)),E.setPositions(new Float32Array(3*D)),E.setNormals(new Float32Array(3*D)),E.setTangents(new Float32Array(3*D)),this._pInvalidateUVs()),i=E.indices.get(E.numElements),r=E.positions.get(D),s=E.normals.get(D),o=E.tangents.get(D),a=E.concatenatedBuffer.stride/4,_=0,f=0,g=this._width/this._segmentsW,m=this._height/this._segmentsH,y=this._depth/this._segmentsD,p=0;p<=this._segmentsW;p++)for(b=p*g-x,d=0;d<=this._segmentsH;d++)r[_]=b,r[_+1]=d*m-w,r[_+2]=-A,s[_]=0,s[_+1]=0,s[_+2]=-1,o[_]=1,o[_+1]=0,o[_+2]=0,r[_+=a]=b,r[_+1]=d*m-w,r[_+2]=A,s[_]=0,s[_+1]=0,s[_+2]=1,o[_]=-1,o[_+1]=0,o[_+2]=0,_+=a,p&&d&&(c=(l=2*((p-1)*(this._segmentsH+1)+(d-1)))+2,u=(h=2*(p*(this._segmentsH+1)+(d-1)))+2,i[f++]=l,i[f++]=c,i[f++]=u,i[f++]=l,i[f++]=u,i[f++]=h,i[f++]=h+1,i[f++]=u+1,i[f++]=c+1,i[f++]=h+1,i[f++]=c+1,i[f++]=l+1);for(v+=2*(this._segmentsW+1)*(this._segmentsH+1),p=0;p<=this._segmentsW;p++)for(b=p*g-x,d=0;d<=this._segmentsD;d++)r[_]=b,r[_+1]=w,r[_+2]=d*y-A,s[_]=0,s[_+1]=1,s[_+2]=0,o[_]=1,o[_+1]=0,o[_+2]=0,r[_+=a]=b,r[_+1]=-w,r[_+2]=d*y-A,s[_]=0,s[_+1]=-1,s[_+2]=0,o[_]=1,o[_+1]=0,o[_+2]=0,_+=a,p&&d&&(c=(l=v+2*((p-1)*(this._segmentsD+1)+(d-1)))+2,u=(h=v+2*(p*(this._segmentsD+1)+(d-1)))+2,i[f++]=l,i[f++]=c,i[f++]=u,i[f++]=l,i[f++]=u,i[f++]=h,i[f++]=h+1,i[f++]=u+1,i[f++]=c+1,i[f++]=h+1,i[f++]=c+1,i[f++]=l+1);for(v+=2*(this._segmentsW+1)*(this._segmentsD+1),p=0;p<=this._segmentsD;p++)for(b=A-p*y,d=0;d<=this._segmentsH;d++)r[_]=-x,r[_+1]=d*m-w,r[_+2]=b,s[_]=-1,s[_+1]=0,s[_+2]=0,o[_]=0,o[_+1]=0,o[_+2]=-1,r[_+=a]=x,r[_+1]=d*m-w,r[_+2]=b,s[_]=1,s[_+1]=0,s[_+2]=0,o[_]=0,o[_+1]=0,o[_+2]=1,_+=a,p&&d&&(c=(l=v+2*((p-1)*(this._segmentsH+1)+(d-1)))+2,u=(h=v+2*(p*(this._segmentsH+1)+(d-1)))+2,i[f++]=l,i[f++]=c,i[f++]=u,i[f++]=l,i[f++]=u,i[f++]=h,i[f++]=h+1,i[f++]=u+1,i[f++]=c+1,i[f++]=h+1,i[f++]=c+1,i[f++]=l+1)}else if(e==n.ElementsType.LINE){var S=t,C=4*this._segmentsH+4*this._segmentsW+4*this._segmentsD;r=new Float32Array(6*C);var P=new Float32Array(C);for(_=0,f=0,p=0;p<this._segmentsH;++p)r[_++]=-x,r[_++]=p*this._height/this._segmentsH-w,r[_++]=-A,r[_++]=x,r[_++]=p*this._height/this._segmentsH-w,r[_++]=-A,P[f++]=1,r[_++]=-x,r[_++]=w-p*this._height/this._segmentsH,r[_++]=A,r[_++]=x,r[_++]=w-p*this._height/this._segmentsH,r[_++]=A,P[f++]=1;for(p=0;p<this._segmentsW;++p)r[_++]=p*this._width/this._segmentsW-x,r[_++]=-w,r[_++]=-A,r[_++]=p*this._width/this._segmentsW-x,r[_++]=w,r[_++]=-A,P[f++]=1,r[_++]=x-p*this._width/this._segmentsW,r[_++]=-w,r[_++]=A,r[_++]=x-p*this._width/this._segmentsW,r[_++]=w,r[_++]=A,P[f++]=1;for(p=0;p<this._segmentsH;++p)r[_++]=-x,r[_++]=p*this._height/this._segmentsH-w,r[_++]=-A,r[_++]=-x,r[_++]=p*this._height/this._segmentsH-w,r[_++]=A,P[f++]=1,r[_++]=x,r[_++]=w-p*this._height/this._segmentsH,r[_++]=-A,r[_++]=x,r[_++]=w-p*this._height/this._segmentsH,r[_++]=A,P[f++]=1;for(p=0;p<this._segmentsD;++p)r[_++]=x,r[_++]=-w,r[_++]=p*this._depth/this._segmentsD-A,r[_++]=x,r[_++]=w,r[_++]=p*this._depth/this._segmentsD-A,P[f++]=1,r[_++]=-x,r[_++]=-w,r[_++]=A-p*this._depth/this._segmentsD,r[_++]=-x,r[_++]=w,r[_++]=A-p*this._depth/this._segmentsD,P[f++]=1;for(p=0;p<this._segmentsD;++p)r[_++]=-x,r[_++]=-w,r[_++]=A-p*this._depth/this._segmentsD,r[_++]=x,r[_++]=-w,r[_++]=A-p*this._depth/this._segmentsD,P[f++]=1,r[_++]=-x,r[_++]=w,r[_++]=p*this._depth/this._segmentsD-A,r[_++]=x,r[_++]=w,r[_++]=p*this._depth/this._segmentsD-A,P[f++]=1;for(p=0;p<this._segmentsW;++p)r[_++]=x-p*this._width/this._segmentsW,r[_++]=-w,r[_++]=-A,r[_++]=x-p*this._width/this._segmentsW,r[_++]=-w,r[_++]=A,P[f++]=1,r[_++]=p*this._width/this._segmentsW-x,r[_++]=w,r[_++]=-A,r[_++]=p*this._width/this._segmentsW-x,r[_++]=w,r[_++]=A,P[f++]=1;S.setPositions(r),S.setThickness(P)}},e.prototype._pBuildUVs=function(t,e){var i,r,s,o,a,l,h,c,u,p,d,_,f,g,m,y;if(e==n.ElementsType.TRIANGLE){y=2*((this._segmentsW+1)*(this._segmentsH+1)+(this._segmentsW+1)*(this._segmentsD+1)+(this._segmentsH+1)*(this._segmentsD+1));var b=t;for(b.uvs&&y==b.numVertices?b.invalidateVertices(b.uvs):b.setUVs(new Float32Array(2*y)),o=b.uvs.get(y),a=b.uvs.stride,this._tile6?(l=c=1/3,h=u=.5):(l=h=1,c=u=0),s=0,p=1*c,d=1*u,_=2*c,f=0*u,g=l/this._segmentsW,m=h/this._segmentsH,i=0;i<=this._segmentsW;i++)for(r=0;r<=this._segmentsH;r++)o[s]=(p+i*g)*this._scaleU,o[s+1]=(d+(h-r*m))*this._scaleV,o[s+=a]=(_+(l-i*g))*this._scaleU,o[s+1]=(f+(h-r*m))*this._scaleV,s+=a;for(p=1*c,d=0*u,_=0*c,f=0*u,g=l/this._segmentsW,m=h/this._segmentsD,i=0;i<=this._segmentsW;i++)for(r=0;r<=this._segmentsD;r++)o[s]=(p+i*g)*this._scaleU,o[s+1]=(d+(h-r*m))*this._scaleV,o[s+=a]=(_+i*g)*this._scaleU,o[s+1]=(f+r*m)*this._scaleV,s+=a;for(p=0*c,d=1*u,_=2*c,f=1*u,g=l/this._segmentsD,m=h/this._segmentsH,i=0;i<=this._segmentsD;i++)for(r=0;r<=this._segmentsH;r++)o[s]=(p+i*g)*this._scaleU,o[s+1]=(d+(h-r*m))*this._scaleV,o[s+=a]=(_+(l-i*g))*this._scaleU,o[s+1]=(f+(h-r*m))*this._scaleV,s+=a}else n.ElementsType.LINE},e}(p),_=function(t){function e(e,i,r,s,n,o){void 0===e&&(e=null),void 0===i&&(i="triangle"),void 0===r&&(r=50),void 0===s&&(s=16),void 0===n&&(n=12),void 0===o&&(o=!0);var a=t.call(this,e,i)||this;return a._radius=r,a._segmentsW=s,a._segmentsH=n,a._yUp=o,a}return l(e,t),Object.defineProperty(e.prototype,"radius",{get:function(){return this._radius},set:function(t){this._radius=t,this._pInvalidatePrimitive()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segmentsW",{get:function(){return this._segmentsW},set:function(t){this._segmentsW=t,this._pInvalidatePrimitive(),this._pInvalidateUVs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"segmentsH",{get:function(){return this._segmentsH},set:function(t){this._segmentsH=t,this._pInvalidatePrimitive(),this._pInvalidateUVs()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yUp",{get:function(){return this._yUp},set:function(t){this._yUp=t,this._pInvalidatePrimitive()},enumerable:!1,configurable:!0}),e.prototype._pBuildGraphics=function(t,e){var i,r,s,o,a,l,h,c,u,p,d,_;if(e==n.ElementsType.TRIANGLE){var f=t;(_=(this._segmentsH+1)*(this._segmentsW+1))==f.numVertices&&null!=f.indices?(f.invalidateIndices(),f.invalidateVertices(f.positions),f.invalidateVertices(f.normals),f.invalidateVertices(f.tangents)):(f.setIndices(new Uint16Array((this._segmentsH-1)*this._segmentsW*6)),f.setPositions(new Float32Array(3*_)),f.setNormals(new Float32Array(3*_)),f.setTangents(new Float32Array(3*_)),this._pInvalidateUVs()),i=f.indices.get(f.numElements),r=f.positions.get(_),s=f.normals.get(_),o=f.tangents.get(_),a=f.concatenatedBuffer.stride/4,c=0,u=0;var g=void 0,m=void 0,y=void 0;for(h=0;h<=this._segmentsH;++h){g=c;var b=Math.PI*h/this._segmentsH,v=-this._radius*Math.cos(b),x=this._radius*Math.sin(b);for(l=0;l<=this._segmentsW;++l){var w=2*Math.PI*l/this._segmentsW,A=x*Math.cos(w),E=x*Math.sin(w),D=1/Math.sqrt(A*A+E*E+v*v),T=Math.sqrt(E*E+A*A);if(this._yUp?(m=0,y=T>.007?A/T:0,p=-v,d=E):(m=T>.007?A/T:0,y=0,p=E,d=v),l==this._segmentsW?(r[c]=r[g],r[c+1]=r[g+1],r[c+2]=r[g+2],s[c]=s[g]+A*D*.5,s[c+1]=s[g+1]+p*D*.5,s[c+2]=s[g+2]+d*D*.5,o[c]=T>.007?-E/T:1,o[c+1]=m,o[c+2]=y):(r[c]=A,r[c+1]=p,r[c+2]=d,s[c]=A*D,s[c+1]=p*D,s[c+2]=d*D,o[c]=T>.007?-E/T:1,o[c+1]=m,o[c+2]=y),l>0&&h>0){var S=(this._segmentsW+1)*h+l,C=(this._segmentsW+1)*h+l-1,P=(this._segmentsW+1)*(h-1)+l-1,I=(this._segmentsW+1)*(h-1)+l;h==this._segmentsH?(r[c]=r[g],r[c+1]=r[g+1],r[c+2]=r[g+2],i[u++]=S,i[u++]=P,i[u++]=I):1==h?(i[u++]=S,i[u++]=C,i[u++]=P):(i[u++]=S,i[u++]=C,i[u++]=P,i[u++]=S,i[u++]=P,i[u++]=I)}c+=a}}}else if(e==n.ElementsType.LINE){var O=t,N=this._segmentsH*this._segmentsW*2+this._segmentsW,L=new Float32Array(6*N),M=new Float32Array(N);for(c=0,u=0,h=0;h<=this._segmentsH;++h){b=Math.PI*h/this._segmentsH,v=-this._radius*Math.cos(b),x=this._radius*Math.sin(b);for(l=0;l<=this._segmentsW;++l){w=2*Math.PI*l/this._segmentsW,A=x*Math.cos(w),E=x*Math.sin(w);if(this._yUp?(p=-v,d=E):(p=E,d=v),l>0&&(L[c++]=A,L[c++]=p,L[c++]=d,M[u++]=1,h>0)){var F=1==h?3-(6*(this._segmentsW-l)+12*l):3-12*this._segmentsW;L[c]=L[c+++F],L[c]=L[c+++F],L[c]=L[c+++F],L[c++]=A,L[c++]=p,L[c++]=d,M[u++]=1}l<this._segmentsW&&(L[c++]=A,L[c++]=p,L[c++]=d)}}O.setPositions(L),O.setThickness(M)}},e.prototype._pBuildUVs=function(t,e){var i,r,s,o,a=(this._segmentsH+1)*(this._segmentsW+1);if(e==n.ElementsType.TRIANGLE){a=(this._segmentsH+1)*(this._segmentsW+1);var l=t;l.uvs&&a==l.numVertices?l.invalidateVertices(l.uvs):l.setUVs(new Float32Array(2*a)),s=l.uvs.get(a),o=l.uvs.stride;var h=0;for(r=0;r<=this._segmentsH;++r)for(i=0;i<=this._segmentsW;++i)s[h]=i/this._segmentsW*this._scaleU,s[h+1]=r/this._segmentsH*this._scaleV,h+=o}else n.ElementsType.LINE},e}(p),f=e.ConfigManager.instance.addStore("scene",{ALLOW_FORCE_MSAA:8,MSAA_MINIMAL_IMAGE_SIZE:300,ALLOW_APPROXIMATION:0,USE_UNSAFE_CACHE_AS_BITMAP:!1,USE_UNSAFE_SCALE_9_SLICE:!1,USE_UNSAFE_FILTERS:!1,USE_UNSAFE_BLENDS:!1,REMAP_BLEND_MODE:!0,BLEND_MODE_REMAP_TABLE:(h={},h[i.BlendMode.DARKEN]=i.BlendMode.MULTIPLY,h),CPU_COPY_PIXELS_COUNT:4096,FONT_TESSELATION_QUALITY:.1,USE_UNSAFE_FNT:!1,TEXT_SHAPE_ROUND_PRECISION:.1}),g=function(t){function s(){var s=t.call(this)||this;return s._renderObjects={},s._containerNodes={},s._mouseChildren=!0,s._sessionID=-1,s._avmDepthID=-1,s._alignmentMode=r.AlignmentMode.REGISTRATION_POINT,s._visible=!0,s._maskId=-1,s._mouseEnabled=!0,s._maskMode=!1,s.isSlice9ScaledMC=!1,s.isSlice9ScaledSprite=!1,s.isAVMScene=!1,s.placeObjectTag=null,s._blendMode=i.BlendMode.LAYER,s.castsShadows=!0,s._filters=null,s.orientationMode=r.OrientationMode.DEFAULT,s.zOffset=0,s.hasDispatchedAddedToStage=!1,s.cursorType="",s._isInFocus=!1,s._tabEnabled=!1,s._tabIndex=-1,s._avmDepthID=-1,s._onInvalidatePropertiesDelegate=function(t){return s._onInvalidateProperties(t)},s._onInvalidateImagesDelegate=function(t){return s._onInvalidateImages(t)},s._transform=new e.Transform(null),s._transform.addEventListener(e.TransformEvent.INVALIDATE_MATRIX3D,(function(t){return s._invalidateHierarchicalProperty(r.HierarchicalProperty.SCENE_TRANSFORM)})),s._transform.addEventListener(e.TransformEvent.INVALIDATE_COLOR_TRANSFORM,(function(t){return s._invalidateHierarchicalProperty(r.HierarchicalProperty.COLOR_TRANSFORM)})),s._defaultBoundingVolume=s._getDefaultBoundingVolume(),s}return l(s,t),s.prototype.getScriptPrecedence=function(){if(!this._parent)return[];var t=this._parent.getScriptPrecedence();return this.placeObjectTag&&t.push(this.placeObjectTag.actionBlocksPrecedence),t},s.prototype.getMouseCursor=function(){return"initial"},Object.defineProperty(s.prototype,"tabEnabled",{get:function(){return this._tabEnabled},set:function(t){this._tabEnabled=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"tabIndex",{get:function(){return this._tabIndex},set:function(t){this._tabIndex=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"isInFocus",{get:function(){return this._isInFocus},set:function(t){this._isInFocus=t},enumerable:!1,configurable:!0}),s.prototype.setFocus=function(t,e,i){this._isInFocus!=t&&(this._isInFocus=t)},Object.defineProperty(s.prototype,"alignmentMode",{get:function(){return this._alignmentMode},set:function(t){this._alignmentMode!=t&&(this._alignmentMode=t,this._invalidateHierarchicalProperty(r.HierarchicalProperty.SCENE_TRANSFORM))},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"alpha",{get:function(){return this._transform.colorTransform.alphaMultiplier},set:function(t){this._transform.colorTransform.alphaMultiplier=t,this._transform.invalidateColorTransform()},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"blendMode",{get:function(){return f.USE_UNSAFE_BLENDS?f.REMAP_BLEND_MODE&&f.BLEND_MODE_REMAP_TABLE[this._blendMode]||this._blendMode:""},set:function(t){this._blendMode!==t&&(this._blendMode=t,t===i.BlendMode.OVERLAY&&this._transform.invalidateColorTransform())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"defaultBoundingVolume",{get:function(){return this._defaultBoundingVolume},set:function(t){this._defaultBoundingVolume!=t&&(this._defaultBoundingVolume=t,this._boundsPrimitive&&(this._boundsPrimitive.dispose(),this._boundsPrimitive=null),this.invalidate())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"cacheAsBitmap",{get:function(){return this._bitmapCache},set:function(t){t!==this._bitmapCache&&f.USE_UNSAFE_CACHE_AS_BITMAP&&(t&&console.warn("[@scene/DisplayObject] Unsafe cacheAsBitmap is enabled!You can disable it by `Settings.USE_UNSAFE_CACHE_AS_BITMAP = false`",this.id),this._bitmapCache=t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"eulers",{get:function(){return this._eulers||(this._eulers=new e.Vector3D),this._eulers.x=this.rotationX,this._eulers.y=this.rotationY,this._eulers.z=this.rotationZ,this._eulers},set:function(t){this._transform.rotation.x=t.x,this._transform.rotation.y=t.y,this._transform.rotation.z=t.z,this._transform.invalidateMatrix3D()},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"filters",{get:function(){return this._filters},set:function(t){f.USE_UNSAFE_FILTERS&&(this._filters=t,this._invalidateStyle())},enumerable:!1,configurable:!0}),s.prototype.updateFilters=function(t){console.warn("[scene/DisplayObject] - updateFilters is just a stub")},Object.defineProperty(s.prototype,"index",{get:function(){return this._parent?this._parent.getChildIndex(this):0},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"loader",{get:function(){return this._loader},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mask",{set:function(t){this.scriptMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"maskMode",{get:function(){return this._maskMode},set:function(t){this._maskMode!=t&&(this._maskMode=t,this._maskId=t?this.id:-1,this._updateMaskMode())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"pickObject",{get:function(){return this._pickObject},set:function(t){this._pickObject!=t&&(this._pickObject=t==this?null:t.pickObjectFromTimeline?t.clone():t,this._pickObject&&(this._pickObject.mouseChildren=!1,this._pickObject.mouseEnabled=!1))},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mouseEnabled",{get:function(){return this._mouseEnabled},set:function(t){this._mouseEnabled!=t&&(this._mouseEnabled=t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mouseX",{get:function(){return this._mouseX},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mouseY",{get:function(){return this._mouseY},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"name",{get:function(){return this._pName?this._pName:""},set:function(t){this._pName=t},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"registrationPoint",{get:function(){return this._registrationMatrix3D?new e.Vector3D(-this._registrationMatrix3D._rawData[12]*this.scaleX,-this._registrationMatrix3D._rawData[13]*this.scaleY,-this._registrationMatrix3D._rawData[14]*this.scaleZ):null},set:function(t){if(t)this._registrationMatrix3D||(this._registrationMatrix3D=new e.Matrix3D),this._registrationMatrix3D._rawData[12]=-t.x/this._transform.scale.x,this._registrationMatrix3D._rawData[13]=-t.y/this._transform.scale.y,this._registrationMatrix3D._rawData[14]=-t.z/this._transform.scale.z;else{if(!this._registrationMatrix3D)return;this._registrationMatrix3D._rawData[12]=0,this._registrationMatrix3D._rawData[13]=0,this._registrationMatrix3D._rawData[14]=0,this._registrationMatrix3D.isIdentity()&&(this._registrationMatrix3D=null)}this._invalidateHierarchicalProperty(r.HierarchicalProperty.SCENE_TRANSFORM)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"registrationScale",{get:function(){return this._registrationMatrix3D?new e.Vector3D(this._registrationMatrix3D._rawData[0],this._registrationMatrix3D._rawData[5],this._registrationMatrix3D._rawData[10]):null},set:function(t){if(t)this._registrationMatrix3D||(this._registrationMatrix3D=new e.Matrix3D),this._registrationMatrix3D._rawData[0]=t.x,this._registrationMatrix3D._rawData[5]=t.y,this._registrationMatrix3D._rawData[10]=t.z;else{if(!this._registrationMatrix3D)return;this._registrationMatrix3D._rawData[0]=1,this._registrationMatrix3D._rawData[5]=1,this._registrationMatrix3D._rawData[10]=1,this._registrationMatrix3D.isIdentity()&&(this._registrationMatrix3D=null)}this._invalidateHierarchicalProperty(r.HierarchicalProperty.SCENE_TRANSFORM)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"root",{get:function(){return this._root},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"rotationX",{get:function(){return this._transform.rotation.x},set:function(t){this.rotationX!=t&&(this._transform.rotation.x=t,this._transform.invalidateMatrix3D())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"rotationY",{get:function(){return this._transform.rotation.y},set:function(t){this.rotationY!=t&&(this._transform.rotation.y=t,this._transform.invalidateMatrix3D())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"rotationZ",{get:function(){return this._transform.rotation.z},set:function(t){this.rotationZ!=t&&(this._transform.rotation.z=t,this._transform.invalidateMatrix3D())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"scale9Grid",{get:function(){return this._scale9Grid},set:function(t){this._scale9Grid=t,this._invalidateHierarchicalProperty(r.HierarchicalProperty.SCALE9)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"scaleX",{get:function(){return this._transform.scale.x},set:function(t){this._setScaleX(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"scaleY",{get:function(){return this._transform.scale.y},set:function(t){this._setScaleY(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"scaleZ",{get:function(){return this._transform.scale.z},set:function(t){this._setScaleZ(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"skewX",{get:function(){return this._transform.skew.x},set:function(t){this.skewX!=t&&(this._transform.skew.x=t,this._transform.invalidateMatrix3D())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"skewY",{get:function(){return this._transform.skew.y},set:function(t){this.skewY!=t&&(this._transform.skew.y=t,this._transform.invalidateMatrix3D())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"skewZ",{get:function(){return this._transform.skew.z},set:function(t){this.skewZ!=t&&(this._transform.skew.z=t,this._transform.invalidateMatrix3D())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(t){if(this._scrollRect=t,!t&&this._scrollRectPrimitive){var e=this.masks.indexOf(this._scrollRectPrimitive);this.masks.splice(e,1),this._scrollRectPrimitive=null}this._transform.invalidatePosition(),this._scrollRectPrimitiveDirty=!0},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"material",{get:function(){return this._material},set:function(t){this._material!=t&&(this._material=t,this._invalidateMaterial())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"style",{get:function(){return this._style},set:function(t){this._style!=t&&(this._style&&(this._style.removeEventListener(n.StyleEvent.INVALIDATE_PROPERTIES,this._onInvalidatePropertiesDelegate),this._style.removeEventListener(n.StyleEvent.INVALIDATE_IMAGES,this._onInvalidateImagesDelegate)),this._style=t,this._style&&(this._style.addEventListener(n.StyleEvent.INVALIDATE_PROPERTIES,this._onInvalidatePropertiesDelegate),this._style.addEventListener(n.StyleEvent.INVALIDATE_IMAGES,this._onInvalidateImagesDelegate)),this._invalidateStyle())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"boundsVisible",{get:function(){return this._boundsVisible},set:function(t){t!=this._boundsVisible&&(this._boundsVisible=t,this.invalidate())},enumerable:!1,configurable:!0}),s.prototype.getScrollRectPrimitive=function(){return this._scrollRectPrimitiveDirty&&(this._scrollRectPrimitiveDirty=!1,this._scrollRectPrimitive||(this._scrollRectPrimitive=new y,this._scrollRectPrimitive.maskMode=!0,this.masks||(this.masks=[]),this.masks.push(this._scrollRectPrimitive)),this._scrollRectPrimitive.graphics.clear(),this._scrollRectPrimitive.graphics.beginFill(255,1),this._scrollRectPrimitive.graphics.drawRect(0,0,this._scrollRect.width,this._scrollRect.height),this._scrollRectPrimitive.graphics.endFill()),this._scrollRectPrimitive},s.prototype.getBoundsPrimitive=function(t){if(null==this._boundsPrimitive){switch(this._defaultBoundingVolume){case r.BoundingVolumeType.BOX:case r.BoundingVolumeType.BOX_BOUNDS:case r.BoundingVolumeType.BOX_BOUNDS_FAST:case r.BoundingVolumeType.BOX_FAST:this._boundsPrefab=new d(null,n.ElementsType.LINE),this._boundsPrimitive=this._boundsPrefab.getNewObject();break;case r.BoundingVolumeType.SPHERE:case r.BoundingVolumeType.SPHERE_BOUNDS:case r.BoundingVolumeType.SPHERE_BOUNDS_FAST:case r.BoundingVolumeType.SPHERE_FAST:this._boundsPrefab=new _(null,n.ElementsType.LINE),this._boundsPrimitive=this._boundsPrefab.getNewObject()}this._boundsPrefabDirty=!0}return this._boundsPrefabDirty&&this._updateBoundsPrefab(t),this._boundsPrimitive},Object.defineProperty(s.prototype,"transform",{get:function(){return this._transform},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!=t&&(this._visible=t,this._invalidateHierarchicalProperty(r.HierarchicalProperty.VISIBLE))},enumerable:!1,configurable:!0}),s.prototype._mergeMasks=function(t,e){if(t||e)return!t&&e?[e]:(e&&!t.includes(e)&&t.push(e),t)},s.prototype._setMasks=function(t){var e=this._masks?this._masks:[];if(t)for(var i=t.length-1;i>=0;i--){var r=t[i];if(r){var s=e.indexOf(r);-1!=s?e.splice(s,1):r.maskMode=!0}else console.warn("[DisplayObject] Timeline mask has null value, skipping it"),t.splice(i,1)}for(i=e.length-1;i>=0;i--)e[i].maskMode=!1;this._masks=t},Object.defineProperty(s.prototype,"scriptMask",{get:function(){return this._scriptMask},set:function(t){if(t!==this._scriptMask){if(this._scriptMask){var e=this._masks.indexOf(this._scriptMask);-1!==e&&(this._masks.splice(e,1),this._scriptMask.maskMode=!1)}this._scriptMask=t,this._masks=this._mergeMasks(this._masks,t),t&&(t.maskMode=!0),this._invalidateHierarchicalProperty(r.HierarchicalProperty.MASKS)}},enumerable:!1,configurable:!0}),s.prototype.updateTimelineMask=function(t){this._setMasks(this._mergeMasks(t,this._scriptMask)),this._invalidateHierarchicalProperty(r.HierarchicalProperty.MASKS)},Object.defineProperty(s.prototype,"masks",{get:function(){return this._masks},set:function(t){if(this._masks!=t){if(t&&t.length){for(var e=t.length,i=!1,s=0;s<e;s++)i=i||t[s]===this._scriptMask;this._scriptMask&&!i&&(this._scriptMask=null)}else this._scriptMask=null;this._setMasks(t),this._invalidateHierarchicalProperty(r.HierarchicalProperty.MASKS)}},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"mouseChildren",{get:function(){return this._mouseChildren},set:function(t){this._mouseChildren!=t&&(this._mouseChildren=t,this._invalidateHierarchicalProperty(r.HierarchicalProperty.MOUSE_ENABLED))},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"x",{get:function(){return this._transform.position.x},set:function(t){this._transform.position.x!=t&&(this._transform.matrix3D._rawData[12]=t,this._transform.invalidatePosition())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"y",{get:function(){return this._transform.position.y},set:function(t){this._transform.position.y!=t&&(this._transform.matrix3D._rawData[13]=t,this._transform.invalidatePosition())},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"z",{get:function(){return this._transform.position.z},set:function(t){this._transform.position.z!=t&&(this._transform.matrix3D._rawData[14]=t,this._transform.invalidatePosition())},enumerable:!1,configurable:!0}),s.prototype.advanceFrame=function(){},s.prototype.getEntity=function(){this._iController&&this._iController.update()},s.prototype._initNode=function(t){},s.prototype.clone=function(){var t=new s;return this.copyTo(t),t},s.prototype.copyTo=function(t){var e;t.defaultBoundingVolume=this._defaultBoundingVolume,this._registrationMatrix3D&&(t._registrationMatrix3D=this._registrationMatrix3D.clone()),t.mouseChildren=this._mouseChildren,t.material=this._material,t.style=this._style,t.pickObject=this._pickObject,t.pickObjectFromTimeline=this.pickObjectFromTimeline,t.boundsVisible=this._boundsVisible,t.name=this._pName,t.mouseEnabled=this._mouseEnabled,t.extra=this.extra,t.maskMode=this._maskMode,t.castsShadows=this.castsShadows,t.assetNamespace=this.assetNamespace,t._symbol=this._symbol,t.avm1Symbol=this.avm1Symbol,t.isAVMScene=this.isAVMScene,t.isSlice9ScaledMC=this.isSlice9ScaledMC,t.scale9Grid=null===(e=this.scale9Grid)||void 0===e?void 0:e.clone(),this._masks&&(t._masks=this._masks.slice(),t._scriptMask=this._scriptMask,t._invalidateHierarchicalProperty(r.HierarchicalProperty.MASKS)),this._transform.copyRawDataTo(t._transform)},s.prototype.dispose=function(){this.disposeValues()},s.prototype.disposeValues=function(){this._parent&&this._parent.removeChild(this),this.material=null,this._adapter&&(this._adapter.dispose(),this._adapter=null),this._pickObject=null,this._masks=null,this._scriptMask=null},s.prototype.lookAt=function(t,e){void 0===e&&(e=null),this.transform.lookAt(t,e)},s.prototype.movePivot=function(t,i,s){0==t&&0==i&&0==s||(this._registrationMatrix3D||(this._registrationMatrix3D=new e.Matrix3D),this._registrationMatrix3D._rawData[12]-=t/this._transform.scale.x,this._registrationMatrix3D._rawData[13]-=i/this._transform.scale.y,this._registrationMatrix3D._rawData[14]-=s/this._transform.scale.z,this._invalidateHierarchicalProperty(r.HierarchicalProperty.SCENE_TRANSFORM))},s.prototype.reset=function(){this.visible=!0,this.noTimelineUpdate||this._transform.clearMatrix3D(),this._transform.clearColorTransform(),this.masks=null,this.maskMode=!1},s.prototype.isOnDisplayList=function(){for(var t=this;t;){if(t.isAVMScene)return!0;t=t.parent}return!1},s.prototype._setParent=function(t){this._parent=t},s.prototype._invalidateHierarchicalProperty=function(t){for(var e in this._containerNodes)this._containerNodes[e].invalidateHierarchicalProperty(t)},Object.defineProperty(s.prototype,"maskId",{get:function(){return this._maskId},enumerable:!1,configurable:!0}),s.prototype._setScaleX=function(t){this.scaleX!=t&&(this._transform.scale.x=t,this._transform.invalidateMatrix3D())},s.prototype._setScaleY=function(t){this.scaleY!=t&&(this._transform.scale.y=t,this._transform.invalidateMatrix3D())},s.prototype._setScaleZ=function(t){this.scaleZ!=t&&(this._transform.scale.z=t,this._transform.invalidateMatrix3D())},s.prototype._updateBoundsPrefab=function(t){if(this._boundsPrefab instanceof d){var i=t.getBoundingVolume(null,this._defaultBoundingVolume).getBox();if(null==i)return;this._boundsPrefab.width=i.width,this._boundsPrefab.height=i.height,this._boundsPrefab.depth=i.depth,this._boundsPrimitive.registrationPoint=new e.Vector3D(-(i.x+i.width/2)*this._boundsPrimitive.transform.scale.x,-(i.y+i.height/2)*this._boundsPrimitive.transform.scale.y,-(i.z+i.depth/2)*this._boundsPrimitive.transform.scale.z)}else if(this._boundsPrefab instanceof _){var r=t.getBoundingVolume(null,this._defaultBoundingVolume).getSphere();if(null==r)return;this._boundsPrefab.radius=r.radius,this._boundsPrimitive.registrationPoint=new e.Vector3D(-r.x*this._boundsPrimitive.transform.scale.x,-r.y*this._boundsPrimitive.transform.scale.y,-r.z*this._boundsPrimitive.transform.scale.z)}},s.prototype._updateMaskMode=function(){this._maskMode&&(this._mouseEnabled=!1),this._invalidateHierarchicalProperty(r.HierarchicalProperty.MASK_ID)},s.prototype._invalidateMaterial=function(){for(var t in this._renderObjects)this._renderObjects[t]._onInvalidateMaterial()},s.prototype._invalidateStyle=function(){for(var t in this._renderObjects)this._renderObjects[t]._onInvalidateStyle()},s.prototype.invalidateElements=function(){for(var t in this._renderObjects)this._renderObjects[t]._onInvalidateElements()},s.prototype._onInvalidateProperties=function(t){this._invalidateStyle()},s.prototype._onInvalidateImages=function(t){this.invalidate()},s.prototype._getDefaultBoundingVolume=function(){return r.BoundingVolumeType.BOX_BOUNDS_FAST},s}(e.AssetBase),m=function(t){function i(){var e=t.call(this)||this;return e._children=[],e.doingSwap=!1,e.tabChildren=!1,e}return l(i,t),Object.defineProperty(i.prototype,"assetType",{get:function(){return i.assetType},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"animator",{get:function(){return this._animator},set:function(t){this._animator&&this._animator.removeOwner(this),this._animator=t,this._animator&&this._animator.addOwner(this)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!1,configurable:!0}),i.prototype.advanceFrame=function(){for(var t=0;t<this._children.length;t++)this._children[t].advanceFrame()},i.prototype.addChild=function(t){return this.addChildAt(t,this._children.length)},i.prototype.addChildAt=function(t,e){for(var i in t.parent&&t.parent.removeChild(t),this._children.splice(e,0,t),t._setParent(this),this._abstractionPool)this._containerNodes[i].addChildAt(t,e);return t},i.prototype.addChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=t.length,r=0;r<i;r++)this.addChild(t[r])},i.prototype.clone=function(){var t=new i;return this.copyTo(t),t},i.prototype.copyTo=function(e){t.prototype.copyTo.call(this,e),this._animator&&(e.animator=this._animator.clone());for(var i=this._children.length,r=0;r<i;++r){var s=this._children[r].adapter.clone().adaptee;e.addChild(s)}},i.prototype.contains=function(t){return this._children.indexOf(t)>=0},i.prototype.disposeValues=function(){this._animator&&this._animator.dispose();for(var e=this._children.length-1;e>=0;e--)this.removeChild(this._children[e]);t.prototype.disposeValues.call(this)},i.prototype.getChildAt=function(t){var i=this._children[t];if(null==i)throw new e.RangeError("Index does not exist in the child list of the caller");return i},i.prototype.getChildByName=function(t){for(var e=this._children.length,i=0;i<e;++i)if(this._children[i].name==t)return this._children[i];return null},i.prototype.getChildIndex=function(t){var e=this._children.indexOf(t);if(-1==e)throw i.NO_CHILD_ERROR;return e},i.prototype.getObjectsUnderPoint=function(t){return new Array},i.prototype.removeChild=function(t){if(null==t)throw new e.ArgumentError("Parameter child cannot be null");return this.removeChildAt(this.getChildIndex(t)),t},i.prototype.removeChildAt=function(t){return this.removeChildAtInternal(t)},i.prototype.removeChildren=function(t,i){if(void 0===t&&(t=0),void 0===i&&(i=2147483647),t<0)throw new e.RangeError("beginIndex is out of range of the child list");if(i>this._children.length)throw new e.RangeError("endIndex is out of range of the child list");for(var r=i-1;r>=t;r--)this.removeChildAtInternal(r)},i.prototype.setChildIndex=function(t,i){var r=this.getChildIndex(t);if(r<0)throw new e.ArgumentError("Parameter child must be child of this object");if(i>this._children.length-1)throw new e.RangeError("Parameter index is out of range of the child list");r!=i&&(this.removeChildAt(r),this.addChildAt(t,i),t._sessionID>=0&&this._sessionID_childs&&(delete this._sessionID_childs[t._sessionID],t._sessionID=-1))},i.prototype.swapChildren=function(t,e){t.parent==this&&e.parent==this&&this.swapChildrenAt(this.getChildIndex(t),this.getChildIndex(e))},i.prototype.swapChildrenAt=function(t,e){if(t!=e){if(t>=this._children.length||e>=this._children.length)throw"[scene/DisplayobjectContainer] - swapChildrenAt - Range Error";var i,r;t<e?(r=this.removeChildAt(e),i=this.removeChildAt(t),this.addChildAt(r,t),this.addChildAt(i,e)):(i=this.removeChildAt(t),r=this.removeChildAt(e),this.addChildAt(i,e),this.addChildAt(r,t)),this._sessionID_childs&&(this._children[t]._sessionID>=0&&(delete this._sessionID_childs[this._children[t]._sessionID],this._children[t]._sessionID,this._children[t]._avmDepthID),this._children[e]._sessionID>=0&&(delete this._sessionID_childs[this._children[e]._sessionID],this._children[e]._sessionID,this._children[t]._avmDepthID))}},i.prototype._initNode=function(t){for(var e=0;e<this._children.length;++e)t.addChildAt(this._children[e],e)},i.prototype.removeChildAtInternal=function(t){var e=this._children.splice(t,1)[0];for(var i in e.adapter&&e.adapter.dispatchStaticEvent&&e.adapter.dispatchStaticEvent("removed",e.adapter),this.isOnDisplayList()&&e.adapter.dispatch_REMOVED_FROM_STAGE&&e.adapter.dispatch_REMOVED_FROM_STAGE(e),e._setParent(null),this._abstractionPool)this._containerNodes[i].removeChildAt(t);return e},i.prototype._updateMaskMode=function(){this.maskMode&&(this.mouseChildren=!1),t.prototype._updateMaskMode.call(this)},i.assetType="[asset DisplayObjectContainer]",i.NO_CHILD_ERROR=new e.ArgumentError("Child parameter is not a child of the caller"),i}(g),y=function(t){function e(e,i){void 0===e&&(e=null),void 0===i&&(i=null);var r=t.call(this)||this;return r.graphics=e,r.material=i,r}return l(e,t),e.getNewSprite=function(t,i){if(void 0===t&&(t=null),void 0===i&&(i=null),e._sprites.length){var r=e._sprites.pop();return r.graphics=t,r.material=i,r}return new e(t,i)},e.clearPool=function(){e._sprites=[]},Object.defineProperty(e.prototype,"assetType",{get:function(){return e.assetType},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"graphics",{get:function(){return this._graphics||(this.graphics=s.Graphics.getGraphics()),this._graphics},set:function(t){this._graphics!=t&&(this._graphics&&this._graphics.removeOwner(this),this._graphics=t,this._graphics&&this._graphics.addOwner(this),this.invalidate())},enumerable:!1,configurable:!0}),e.prototype.getEntity=function(){return t.prototype.getEntity.call(this),this._iSourcePrefab&&this._iSourcePrefab._iValidate(),this._graphics},e.prototype.dispose=function(){this.disposeValues(),e._sprites.push(this)},e.prototype.disposeValues=function(){t.prototype.disposeValues.call(this)},e.prototype.clone=function(){var t=e.getNewSprite();return this.copyTo(t),t},e.prototype.copyTo=function(e,i){void 0===i&&(i=!1),t.prototype.copyTo.call(this,e),e._iSourcePrefab=this._iSourcePrefab,this._graphics&&this._graphics.copyTo(e.graphics,i)},e.prototype.bakeTransformations=function(){this._graphics.applyTransformation(this.transform.matrix3D),this.transform.clearMatrix3D()},e._sprites=[],e.assetType="[asset Sprite]",e}(m),b=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._frameCaches={},e}return l(i,t),i.getNewMorphSprite=function(t,e){if(void 0===t&&(t=null),void 0===e&&(e=null),i._morphSprites.length){var r=i._morphSprites.pop();return r.graphics=t||s.Graphics.getGraphics(),r.material=e,r}return new i(t,e)},Object.defineProperty(i.prototype,"assetType",{get:function(){return i.assetType},enumerable:!1,configurable:!0}),i.prototype.reset=function(){t.prototype.reset.call(this),this.setRatio(0)},i.prototype._blendStyle=function(t,i,r,n){var o,a,l,h=1-n,c=n,u=t.style.fillStyle,p=i.style.fillStyle;if(t.style.data_type!=i.style.data_type)throw"Error in morph data - different styles of pathes";switch(u.data_type){case s.SolidFillStyle.data_type:var d=p;a=h*(w=u).alpha+c*d.alpha,o=e.ColorUtils.interpolateFloat32Color(w.color,d.color,n),l=new s.SolidFillStyle(o,a);break;case s.GradientFillStyle.data_type:for(var _=[],f=[],g=[],m=(d=p,(w=u).colors.length),y=0;y<m;y++)_[_.length]=e.ColorUtils.interpolateFloat32Color(w.colors[y],d.colors[y],n),g[g.length]=h*w.alphas[y]+c*d.alphas[y],f[f.length]=h*w.ratios[y]+c*d.ratios[y];var b=w.matrix,v=d.matrix;(x=new e.Matrix).a=b.a*h+v.a*c,x.b=b.b*h+v.b*c,x.c=b.c*h+v.c*c,x.d=b.d*h+v.d*c,x.tx=b.tx*h+v.tx*c,x.ty=b.ty*h+v.ty*c,l=new s.GradientFillStyle(w.type,_,g,f,x,w.spreadMethod,w.interpolationMethod,w.focalPointRatio);break;case s.BitmapFillStyle.data_type:var x;d=p,b=(w=u).matrix,v=d.matrix;(x=new e.Matrix).a=b.a*h+v.a*c,x.b=b.b*h+v.b*c,x.c=b.c*h+v.c*c,x.d=b.d*h+v.d*c,x.tx=b.tx*h+v.tx*c,x.ty=b.ty*h+v.ty*c,l=new s.BitmapFillStyle(w.material,x,w.repeat,w.smooth)}if(t.style.data_type===s.GraphicsStrokeStyle.data_type){var w=t.style,A=(d=i.style,h*w.thickness+c*d.thickness);r.style=new s.GraphicsStrokeStyle(l,A,w.jointstyle,w.capstyle,w.miterLimit,w.scaleMode)}else r.style=new s.GraphicsFillStyle(l)},i.prototype._blendContours=function(t,e,i,r){var n=1-r,o=r,a=t.commands.length;if(e.commands.length!==a)throw"Error in morph data - different number of contour";for(var l=0,h=0,c=0,u=0,p=0,d=0,_=t.data,f=e.data,g=0;g<a;g++){var m=t.commands[g],y=e.commands[g];switch(m){case s.GraphicsPathCommand.MOVE_TO:if(y!=s.GraphicsPathCommand.MOVE_TO)throw"Error in morph data - both shapes must start with Move too command";c=_[l++],u=_[l++],p=f[h++],d=f[h++],i.moveTo(n*c+o*p,n*u+o*d);break;case s.GraphicsPathCommand.LINE_TO:if(y==s.GraphicsPathCommand.LINE_TO)c=_[l++],u=_[l++],p=f[h++],d=f[h++],i.lineTo(n*c+o*p,n*u+o*d);else if(y==s.GraphicsPathCommand.CURVE_TO){var b=c+(_[l++]-c)/2,v=u+(_[l++]-u)/2;i.curveTo(n*b+o*f[h++],n*v+o*f[h++],n*_[l-2]+o*f[h++],n*_[l-1]+o*f[h++]),c=_[l-2],u=_[l-1],p=f[h-2],d=f[h-1]}break;case s.GraphicsPathCommand.CURVE_TO:if(y==s.GraphicsPathCommand.LINE_TO){b=p+(f[h++]-p)/2,v=d+(f[h++]-d)/2;i.curveTo(n*_[l++]+o*b,n*_[l++]+o*v,n*_[l++]+o*f[h-2],n*_[l++]+o*f[h-1]),c=_[l-2],u=_[l-1],p=f[h-2],d=f[h-1]}else y==s.GraphicsPathCommand.CURVE_TO&&(i.curveTo(n*_[l++]+o*f[h++],n*_[l++]+o*f[h++],n*_[l++]+o*f[h++],n*_[l++]+o*f[h++]),c=_[l-2],u=_[l-1],p=f[h-2],d=f[h-1])}}},i.prototype.setRatio=function(t){var e=65535*t|0,i=this._graphics;if(this._ratio!==e){if(this._ratio=e,i.buildQueueTags?i.buildQueueTags(!0):(i.endFill(),i.clear()),i.start.length!==i.end.length)throw"Error in morph data - different number of pathes";for(var r=i.start.length,n=0;n<r;n++){var o=new s.GraphicsPath,a=i.start[n],l=i.end[n];this._blendStyle(a,l,o,t),this._blendContours(a,l,o,t),i.add_queued_path(o,!0)}i._endFillInternal(!0)}},i.prototype.dispose=function(){this.disposeValues(),this._frameCaches={},i._morphSprites.push(this)},i.prototype.clone=function(){var t=i.getNewMorphSprite();return this.copyTo(t),t},i.assetType="[asset MorphSprite]",i._morphSprites=new Array,i}(y),v=["",i.BlendMode.NORMAL,i.BlendMode.LAYER,i.BlendMode.MULTIPLY,i.BlendMode.SCREEN,i.BlendMode.LIGHTEN,i.BlendMode.DARKEN,i.BlendMode.DIFFERENCE,i.BlendMode.ADD,i.BlendMode.SUBTRACT,i.BlendMode.INVERT,i.BlendMode.ALPHA,i.BlendMode.ERASE,i.BlendMode.OVERLAY,i.BlendMode.HARDLIGHT];var x=function(){function t(t){this.factory=t,this._update_indices=[],this._update_frames=[],this.isButton=!1,this._initalMcID=-1,this.numKeyFrames=0,this.keyframe_indices=[],this.avm1Exports={},this.avm1InitActions={},this.avm1ButtonActions=[],this.graphicsPool={},this.audioPool={},this.placeObjectTagsForSessionIDs={},this._labels={},this._framescripts={},this._framescripts_translated={},this.keyframe_to_frameidx={}}return t.prototype.resetScripts=function(){this._framescripts={},this._framescripts_translated={}},t.prototype.init=function(){if(null!=this.frame_command_indices&&null!=this.frame_recipe&&null!=this.keyframe_durations){var t=0,e=0,i=0,r=0,s=0,n=0;this.keyframe_firstframes=[],this.keyframe_constructframes=[],this.keyframe_indices=[],this.keyframe_to_frameidx={},this.keyframe_to_frameidx[0]=0;var o=0;for(e=0;e<this.numKeyFrames;e++)for(this.keyframe_to_frameidx[e]=o,o+=r=this.keyframe_durations[e],1&this.frame_recipe[e]&&(n=s),this.keyframe_firstframes[s]=t,this.keyframe_constructframes[s++]=n,i=0;i<r;i++)this.keyframe_indices[t++]=e}},t.prototype.add_framescript=function(t,e,i,r){if(void 0===r&&(r=!1),!(this._initalMcID>=0&&i.id!=this._initalMcID)){if(this._initalMcID=i.id,this._framescripts[e]||(this._framescripts[e]=[]),Array.isArray(t))for(var s=0;s<t.length;s++)this._framescripts[e][this._framescripts[e].length]=t[s];else this._framescripts[e].push(t);this._framescripts_translated[e]=!r}},t.prototype.get_script_for_frame=function(t,e,i){if(void 0===i&&(i=!1),e>=0&&this._framescripts[e]){if(i&&!this._framescripts_translated[e]){var r=t.className?t.className:t.name;this._framescripts[e]=this.factory.createFrameScripts(this._framescripts[e],e,r,t.id),this._framescripts_translated[e]=!0}return this._framescripts[e]}return null},Object.defineProperty(t.prototype,"numFrames",{get:function(){return this.keyframe_indices.length},enumerable:!1,configurable:!0}),t.prototype.getKeyframeIndexForFrameIndex=function(t){return this.keyframe_indices[t]},t.prototype.getChildInstance=function(t,e){return this.factory.createChildInstanceForTimeline(this,t,e)},t.prototype.extractHitArea=function(t){t.reset(!1),this.gotoFrame(t,this.numFrames-1,!1);for(var e,i,r=t.numChildren,s=new m;r>0;)r--,(e=(i=t.getChildAt(r)).clone()).x=i.x,e.scaleX=i.scaleX,e.y=i.y,e.scaleY=i.scaleY,e.rotationZ=i.rotationZ,s.addChild(e);return s.pickObjectFromTimeline=!0,t.pickObject=s,t.reset(!1),s},t.prototype.getCurrentFrameLabel=function(t){var e=this.keyframe_to_frameidx[t.constructedKeyFrameIndex];for(var i in this._labels)if(this._labels[i].keyFrameIndex==t.constructedKeyFrameIndex&&e==t.currentFrameIndex)return this._labels[i].name;return null},t.prototype.getCurrentLabel=function(t){var e=null,i=-1;for(var r in this._labels){var s=this._labels[r].keyFrameIndex;s>i&&s<=t.constructedKeyFrameIndex&&(i=s,e=this._labels[r].name)}return e},t.prototype.jumpToLabel=function(t,e,i){if(void 0===i&&(i=0),this._labels[e]){var r=this._labels[e].keyFrameIndex;r>=0&&(t.currentFrameIndex=this.keyframe_firstframes[r]+i)}else console.warn("[TIMELINE] - jumpToLabel with invalid label",t,e,i)},t.prototype.getScriptForLabel=function(t,e,i){void 0===i&&(i=!1);var r=this._labels[e.toLowerCase()].keyFrameIndex;if(r<0)return null;var s=this.keyframe_firstframes[r];return s>=0&&this._framescripts[s]?this.get_script_for_frame(t,s,i):null},t.prototype.gotoFrame=function(t,e,i,r,s){void 0===i&&(i=!0),void 0===r&&(r=!1),void 0===s&&(s=!1);var n=t.constructedKeyFrameIndex,o=this.keyframe_indices[e];if(n!=o||s)if(n+1!=o){var a=this.keyframe_constructframes[o],l=a,h=o>n;h&&n>a&&(l=n+1),t.adapter.constructFrame(this,l,o,h,e,r,i),this.applyCollectedUpdateCommands(t),t.constructedKeyFrameIndex=o}else this.constructNextFrame(t,i,!0);else t.adapter.queueFrameScripts(this,e,i)},t.prototype.applyCollectedUpdateCommands=function(t){var e,i=this._update_indices.length;for(e=0;e<i;e++)this.update_childs(t,this._update_indices[e],this._update_frames[e])},t.prototype.constructNextFrame=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var r=t.currentFrameIndex,s=this.keyframe_indices[r];if(e&&t.adapter.queueFrameScripts(this,r,i),t.constructedKeyFrameIndex!=s){t.constructedKeyFrameIndex=s;var n=this.frame_command_indices[s],o=this.frame_recipe[s];1&o?t.adapter.removeAllTimelineChilds():2&o&&this.remove_childs_continous(t,n++),4&o&&this.add_childs_continous(t,n++),8&o&&this.update_childs(t,n++),16&o&&this.start_sounds(t,n++)}},t.prototype.remove_childs_continous=function(t,e){for(var i=this.command_index_stream[e],r=i+this.command_length_stream[e],s=i;s<r;s++)t.adapter.removeTimelineChildAt(this.remove_child_stream[s])},t.prototype.add_childs_continous=function(t,e){for(var i,r=this.command_index_stream[e],s=r+this.command_length_stream[e],n=r;n<s;n++)if(i=3*n,void 0!==this.add_child_stream[i]){var o=this.factory.createChildInstanceForTimeline(this,this.add_child_stream[i+2],this.add_child_stream[i]);t.adapter.addTimelineChildAtDepth(o,this.add_child_stream[i+1])}else console.warn("[Timeline] - add_childs_continous - could not find child-id in child_stream for idx",i,this.add_child_stream)},t.prototype.start_sounds=function(t,e){for(var i=this.command_index_stream[e],r=i+this.comman