!function(){"use strict";var extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},CompressionMethod,m;function __extends(t,e){function i(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}m=CompressionMethod=CompressionMethod||{},m[m.None=0]="None",m[m.Deflate=1]="Deflate",m[m.LZMA=2]="LZMA";var SWFFile=(n.prototype.mapSWFVersionToFPVersion=function(){var t={6:"FP6",7:"FP7",8:"FP8",9:"FP9",10:"FP10",11:"FP10_2",12:"FP10_3",13:"FP11_0",14:"FP11_1",15:"FP11_2",16:"FP11_3",17:"FP11_4",18:"FP11_5",19:"FP11_6",20:"FP11_7",21:"FP11_8",22:"FP11_9",23:"FP12",24:"FP13",25:"FP14",26:"FP15",27:"FP16",28:"FP17",29:"FP18",30:"FP19",31:"FP20",32:"FP21",33:"FP22",34:"FP23",35:"FP24",36:"FP25",37:"FP26",38:"FP27",39:"FP28",40:"FP29",41:"FP30",42:"FP31"};this.fpVersion=t[this.swfVersion]?t[this.swfVersion]:"unmappedSWFVersion:"+this.swfVersion},n),ErrorBase=(Object.defineProperty(p.prototype,"message",{get:function(){return this._messsage},set:function(t){this._messsage=t},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"errorID",{get:function(){return this._errorID},enumerable:!0,configurable:!0}),p),AbstractMethodError=(v=ErrorBase,__extends(w,v),w),EventBase=(z.prototype.clone=function(){return new z(this.type)},z),AssetEvent=(B=EventBase,__extends(C,B),Object.defineProperty(C.prototype,"asset",{get:function(){return this._asset},enumerable:!0,configurable:!0}),Object.defineProperty(C.prototype,"prevName",{get:function(){return this._prevName},enumerable:!0,configurable:!0}),C.prototype.clone=function(){return new C(this.type,this._asset,this._prevName)},C.INVALIDATE="invalidate",C.CLEAR="clear",C.RENAME="rename",C.ENTER_FRAME="enterFrame",C.EXIT_FRAME="exitFrame",C.ASSET_CONFLICT_RESOLVED="assetConflictResolved",C.ASSET_COMPLETE="assetComplete",C.TEXTURE_SIZE_ERROR="textureSizeError",C),EventDispatcher=(I.prototype.addEventListener=function(t,e){var i=this._listenerObjects[t];void 0===i&&(i=this._listenerObjects[t]=new ListenerObject),i.addEventListener(e)},I.prototype.removeEventListener=function(t,e){var i=this._listenerObjects[t];i&&(i.removeEventListener(e),0==i.numListeners&&delete this._listenerObjects[t])},I.prototype.dispatchEvent=function(t){var e=this._listenerObjects[t.type];e&&(t.target=this._t,e.dispatchEvent(t))},I.prototype.hasEventListener=function(t,e){return void 0!==this._listenerObjects[t]&&(null!=e?-1!==this._listenerObjects[t].getEventListenerIndex(e):0>(r<<2)&15]+n;return n}for(var i=this.position=0;ithis.length-this.position)&&(t=this.length-this.position),0>2,a=(3&n)<<4|(r=e.apply(i))>>4,l=(15&r)<<2|(o=e.apply(i))>>6,c=63&o,h+=u.charAt(s)+u.charAt(a)+u.charAt(l)+u.charAt(c),t-=3;return 2==t?(s=(n=e.apply(i))>>2,a=(3&n)<<4|(r=e.apply(i))>>4,l=(15&r)<<2,h+=u.charAt(s)+u.charAt(a)+u.charAt(l)+"="):1==t&&(s=(n=e.apply(i))>>2,a=(3&n)<<4,h+=u.charAt(s)+u.charAt(a)+"=="),h},ub.Base64Key="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ub),ByteArray=(ec=ByteArrayBase,__extends(fc,ec),fc.prototype.ensureWriteableSpace=function(t){this.ensureSpace(t+this.position)},fc.prototype.setArrayBuffer=function(t){this.ensureSpace(t.byteLength),this.length=t.byteLength;var e=new Int8Array(t);new Int8Array(this.arraybytes,0,this.length).set(e),this.position=0},fc.prototype.writeArrayBuffer=function(t){this.ensureWriteableSpace(t.byteLength);var e=new Int8Array(t);new Int8Array(this.arraybytes,this.length,t.byteLength).set(e),this.length+=t.byteLength,this.position=this.length},fc.prototype.writeByteArray=function(t){this.ensureWriteableSpace(t.length);var e=new Int8Array(t.arraybytes,0,t.length);new Int8Array(this.arraybytes,this.length,t.length).set(e),this.length+=t.length,this.position=this.length},fc.prototype.getBytesAvailable=function(){return this.length-this.position},fc.prototype.ensureSpace=function(t){var e,i,n;t>this.maxlength&&(e=t+255&-256,i=new ArrayBuffer(e),n=new Uint8Array(this.arraybytes,0,this.length),new Uint8Array(i,0,this.length).set(n),this.arraybytes=i,this.maxlength=e)},fc.prototype.writeObject=function(t){console.log("writeObject not implemented yet in core/ByteArray")},fc.prototype.readObject=function(){return console.log("readObject not implemented yet in core/ByteArray"),{}},fc.prototype.writeByte=function(t){this.ensureWriteableSpace(1),new Int8Array(this.arraybytes)[this.position++]=~~t,this.position>this.length&&(this.length=this.position)},fc.prototype.readByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;return new Int8Array(this.arraybytes)[this.position++]},fc.prototype.readBytes=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),null==i&&(i=t.length),t.ensureWriteableSpace(e+i);var n=new Int8Array(t.arraybytes),r=new Int8Array(this.arraybytes);n.set(r.subarray(this.position,this.position+i),e),this.position+=i,i+e>t.length&&(t.length+=i+e-t.length)},fc.prototype.writeUnsignedByte=function(t){this.ensureWriteableSpace(1),new Uint8Array(this.arraybytes)[this.position++]=255&~~t,this.position>this.length&&(this.length=this.position)},fc.prototype.readUnsignedByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;return new Uint8Array(this.arraybytes)[this.position++]},fc.prototype.writeUnsignedShort=function(t){var e,i;this.ensureWriteableSpace(2),0==(1&this.position)?new Uint16Array(this.arraybytes)[this.position>>1]=65535&~~t:(new Uint16Array(this.unalignedarraybytestemp,0,1)[0]=65535&~~t,e=new Uint8Array(this.arraybytes,this.position,2),i=new Uint8Array(this.unalignedarraybytestemp,0,2),e.set(i)),this.position+=2,this.position>this.length&&(this.length=this.position)},fc.prototype.readUTFBytes=function(t){for(var e="",i=this.position+t,n=new DataView(this.arraybytes);this.positionthis.length+2)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(1&this.position)){var t=new Uint16Array(this.arraybytes),e=this.position>>1;return this.position+=2,t[e]}t=new Uint16Array(this.unalignedarraybytestemp,0,1);var i=new Uint8Array(this.arraybytes,this.position,2);return new Uint8Array(this.unalignedarraybytestemp,0,2).set(i),this.position+=2,t[0]},fc.prototype.writeUnsignedInt=function(t){var e,i;this.ensureWriteableSpace(4),0==(3&this.position)?new Uint32Array(this.arraybytes)[this.position>>2]=4294967295&~~t:(new Uint32Array(this.unalignedarraybytestemp,0,1)[0]=4294967295&~~t,e=new Uint8Array(this.arraybytes,this.position,4),i=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(i)),this.position+=4,this.position>this.length&&(this.length=this.position)},fc.prototype.writeInt=function(t){var e,i;this.ensureWriteableSpace(4),0==(3&this.position)?new Int32Array(this.arraybytes)[this.position>>2]=~~t:(new Int32Array(this.unalignedarraybytestemp,0,1)[0]=~~t,e=new Uint8Array(this.arraybytes,this.position,4),i=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(i)),this.position+=4,this.position>this.length&&(this.length=this.position)},fc.prototype.readUnsignedInt=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(3&this.position)){var t=new Uint32Array(this.arraybytes),e=this.position>>2;return this.position+=4,t[e]}t=new Uint32Array(this.unalignedarraybytestemp,0,1);var i=new Uint8Array(this.arraybytes,this.position,4);return new Uint8Array(this.unalignedarraybytestemp,0,4).set(i),this.position+=4,t[0]},fc.prototype.writeFloat=function(t){var e,i;this.ensureWriteableSpace(4),0==(3&this.position)?new Float32Array(this.arraybytes)[this.position>>2]=t:(new Float32Array(this.unalignedarraybytestemp,0,1)[0]=t,e=new Uint8Array(this.arraybytes,this.position,4),i=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(i)),this.position+=4,this.position>this.length&&(this.length=this.position)},fc.prototype.readFloat=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;if(0==(3&this.position)){var t=new Float32Array(this.arraybytes),e=this.position>>2;return this.position+=4,t[e]}t=new Float32Array(this.unalignedarraybytestemp,0,1);var i=new Uint8Array(this.arraybytes,this.position,4);return new Uint8Array(this.unalignedarraybytestemp,0,4).set(i),this.position+=4,t[0]},fc),ParserUtils=(md.arrayBufferToBase64=function(t,e){for(var i="",n=new Uint8Array(t),r=n.byteLength,o=0;o>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},sf.f32_RGBA_To_f32_ARGB=function(t){return(255&t)<<24|(4278190080&t)>>>24<<16|(16711680&t)>>>16<<8|(65280&t)>>>8},sf.f32_RGB_To_f32_ARGB=function(t){return(255&t)<<24|(4278190080&t)>>>24<<16|(16711680&t)>>>16<<8|(65280&t)>>>8},sf.prototype.getAlphaFromF32RGBA=function(t){return 255&t},sf.ARGBtoFloat32=function(t,e,i,n){return t<<24|e<<16|i<<8|n},sf.componentToHex=function(t){var e=t.toString(16);return 1==e.length?"0"+e:e},sf.RGBToHexString=function(t){return"#"+sf.componentToHex(t[1])+sf.componentToHex(t[2])+sf.componentToHex(t[3])},sf.ARGBToHexString=function(t){return"#"+sf.componentToHex(t[0])+sf.componentToHex(t[1])+sf.componentToHex(t[2])+sf.componentToHex(t[3])},sf.interpolateFloat32Color=function(t,e,i){var n=1-i;return((4278190080&t)>>>24)*n+((4278190080&e)>>>24)*i<<24|((16711680&t)>>>16)*n+((16711680&e)>>>16)*i<<16|((65280&t)>>>8)*n+((65280&e)>>>8)*i<<8|(255&t)*n+(255&e)*i},sf),ColorTransform=(Jf.prototype.concat=function(t){this._rawData[0]*=t._rawData[0],this._rawData[1]*=t._rawData[1],this._rawData[2]*=t._rawData[2],this._rawData[3]*=t._rawData[3],this._rawData[4]+=t._rawData[4],this._rawData[5]+=t._rawData[5],this._rawData[6]+=t._rawData[6],this._rawData[7]+=t._rawData[7]},Object.defineProperty(Jf.prototype,"alphaMultiplier",{get:function(){return this._rawData[3]},set:function(t){this._rawData[3]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"alphaOffset",{get:function(){return this._rawData[7]},set:function(t){this._rawData[7]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"blueMultiplier",{get:function(){return this._rawData[2]},set:function(t){this._rawData[2]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"blueOffset",{get:function(){return this._rawData[6]},set:function(t){this._rawData[6]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"greenMultiplier",{get:function(){return this._rawData[1]},set:function(t){this._rawData[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"greenOffset",{get:function(){return this._rawData[5]},set:function(t){this._rawData[5]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"redMultiplier",{get:function(){return this._rawData[0]},set:function(t){this._rawData[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"redOffset",{get:function(){return this._rawData[4]},set:function(t){this._rawData[4]=t},enumerable:!0,configurable:!0}),Object.defineProperty(Jf.prototype,"color",{get:function(){return this._rawData[4]<<16|this._rawData[5]<<8|this._rawData[6]},set:function(t){var e=ColorUtils.float32ColorToARGB(t);this._rawData[4]=e[1],this._rawData[5]=e[2],this._rawData[6]=e[3],this._rawData[0]=1,this._rawData[1]=1,this._rawData[2]=1},enumerable:!0,configurable:!0}),Jf.prototype.copyRawDataFrom=function(t){var e=this._rawData;e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7]},Jf.prototype.clear=function(){this._rawData[0]=1,this._rawData[1]=1,this._rawData[2]=1,this._rawData[3]=1,this._rawData[4]=0,this._rawData[5]=0,this._rawData[6]=0,this._rawData[7]=0},Jf.prototype.clone=function(){var t=new Jf;return t.copyFrom(this),t},Jf.prototype.copyFrom=function(t){var e=t._rawData,i=this._rawData;i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7]},Jf.prototype.copyTo=function(t){t.copyFrom(this)},Jf.prototype.prepend=function(t){this._rawData[4]+=t._rawData[4]*this._rawData[0],this._rawData[5]+=t._rawData[5]*this._rawData[1],this._rawData[6]+=t._rawData[6]*this._rawData[2],this._rawData[7]+=t._rawData[7]*this._rawData[3],this.redMultiplier*=t.redMultiplier,this.greenMultiplier*=t.greenMultiplier,this.blueMultiplier*=t.blueMultiplier,this.alphaMultiplier*=t.alphaMultiplier},Jf.prototype._isRenderable=function(){return 0!=this._rawData[3]||0=t&&this.y<=e&&this.y+this.height>=e&&this.z<=i&&this.z+this.depth>=i},bk.prototype.containsPoint=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y&&this.z<=t.z&&this.z+this.depth>=t.z},bk.prototype.containsBox=function(t){return this.x<=t.x&&this.x+this.width>=t.x+t.width&&this.y<=t.y&&this.y+this.height>=t.y+t.height&&this.z<=t.z&&this.z+this.depth>=t.z+t.depth},bk.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.z=t.z,this.width=t.width,this.height=t.height,this.depth=t.depth},bk.prototype.equals=function(t){return this.x==t.x&&this.y==t.y&&this.z==t.z&&this.width==t.width&&this.height==t.height&&this.depth==t.depth},bk.prototype.inflate=function(t,e,i){this.x-=t/2,this.y-=e/2,this.z-=i/2,this.width+=t/2,this.height+=e/2,this.depth+=i/2},bk.prototype.inflatePoint=function(t){this.x-=t.x/2,this.y-=t.y/2,this.z-=t.z/2,this.width+=t.x/2,this.height+=t.y/2,this.depth+=t.z/2},bk.prototype.intersection=function(t){if(this.intersects(t)){var e=new bk;return this.x>t.x?(e.x=this.x,e.width=t.x-this.x+t.width,e.width>this.width&&(e.width=this.width)):(e.x=t.x,e.width=this.x-t.x+this.width,e.width>t.width&&(e.width=t.width)),this.y>t.y?(e.y=this.y,e.height=t.y-this.y+t.height,e.height>this.height&&(e.height=this.height)):(e.y=t.y,e.height=this.y-t.y+this.height,e.height>t.height&&(e.height=t.height)),this.z>t.z?(e.z=this.z,e.depth=t.z-this.z+t.depth,e.depth>this.depth&&(e.depth=this.depth)):(e.z=t.z,e.depth=this.z-t.z+this.depth,e.depth>t.depth&&(e.depth=t.depth)),e}return new bk},bk.prototype.intersects=function(t){return this.x+this.width>=t.x&&this.x<=t.x+t.width&&this.y+this.height>=t.y&&this.y<=t.y+t.height&&this.z+this.depth>=t.z&&this.z<=t.z+t.depth},bk.prototype.rayIntersection=function(t,e,i){if(void 0===i&&(i=null),this.containsPoint(t))return 0;var n,r,o,s,a,l=this.width/2,c=this.height/2,h=this.depth/2,u=this.x+l,p=this.y+c,d=this.z+h,_=t.x-u,f=t.y-p,m=t.z-d,g=e.x,y=e.y,b=e.z;return g<0&&0<(s=(l-_)/g)&&(o=m+s*b,(r=f+s*y)>-c&&r-c&&r-l&&n-l&&n-c&&r-c&&rthis.x+this.width&&(i=this.x+this.width),e.x=i,(i=t.y)this.y&&(i=this.y),e.y=i,(i=t.z)this.z+this.depth&&(i=this.z+this.depth),e.z=i,e},bk.prototype.offset=function(t,e,i){this.x+=t,this.y+=e,this.z+=i},bk.prototype.offsetPosition=function(t){this.x+=t.x,this.y+=t.y,this.z+=t.z},bk.prototype.identity=function(){this.x=0,this.y=0,this.z=0,this.width=0,this.height=0,this.depth=0},bk.prototype.setTo=function(t,e,i,n,r,o){this.x=t,this.y=e,this.z=i,this.width=n,this.height=r,this.depth=o},bk.prototype.toString=function(){return"[Box] (x="+this.x+", y="+this.y+", z="+this.z+", width="+this.width+", height="+this.height+", depth="+this.depth+")"},bk.prototype.union=function(t,e){var i,n,r;return void 0===e&&(e=null),null==e&&(e=new bk),null==t?e.copyFrom(this):(this.xi.y&&e.x>n.z?(s.x=Math.sqrt(1+e.x-i.y-n.z)/2,s.w=(i.z-n.y)/(4*s.x),s.y=(e.y+i.x)/(4*s.x),s.z=(n.x+e.z)/(4*s.x)):i.y>n.z?(s.y=Math.sqrt(1+i.y-e.x-n.z)/2,s.x=(e.y+i.x)/(4*s.y),s.w=(n.x-e.z)/(4*s.y),s.z=(i.z+n.y)/(4*s.y)):(s.z=Math.sqrt(1+n.z-e.x-i.y)/2,s.x=(n.x+e.z)/(4*s.z),s.y=(i.z+n.y)/(4*s.z),s.w=(e.y-i.x)/(4*s.z));break;case Orientation3D.EULER_ANGLES:s.y=Math.asin(-e.z),1!=e.z&&-1!=e.z?(s.x=Math.atan2(i.z,n.z),s.z=Math.atan2(e.y,e.x)):(s.z=0,s.x=Math.atan2(i.x,i.y))}return this._components[0].copyFrom(this.position),this._components},Ql.prototype.deltaTransformVector=function(t,e){void 0===e&&(e=null);var i=t.x,n=t.y,r=t.z;e=e||new Vector3D;var o=this._rawData,s=e._rawData;return s[0]=i*o[0]+n*o[4]+r*o[8],s[1]=i*o[1]+n*o[5]+r*o[9],s[2]=i*o[2]+n*o[6]+r*o[10],s[3]=i*o[3]+n*o[7]+r*o[11],e},Ql.prototype.deltaTransformVectors=function(t,e){for(var i=this._rawData,n=i[0],r=i[1],o=i[2],s=i[4],a=i[5],l=i[6],c=i[8],h=i[9],u=i[10],p=0,d=t.length,_=0;_=t&&i[1]<=e&&i[1]+i[3]>=e},Dv.prototype.containsPoint=function(t){var e=this._rawData,i=t._rawData;return e[0]<=i[0]&&e[0]+e[2]>=i[0]&&e[1]<=i[1]&&e[1]+e[3]>=i[1]},Dv.prototype.containsRect=function(t){var e=this._rawData,i=t._rawData;return e[0]<=i[0]&&e[0]+e[2]>=i[0]+i[2]&&e[1]<=i[1]&&e[1]+e[3]>=i[1]+i[3]},Dv.prototype.copyFrom=function(t){var e=this._rawData,i=t._rawData;e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3]},Dv.prototype.equals=function(t){var e=this._rawData,i=t._rawData;return e[0]==i[0]&&e[1]==i[1]&&e[2]==i[2]&&e[3]==i[3]},Dv.prototype.inflate=function(t,e){var i=this._rawData;i[0]-=t/2,i[1]-=e/2,i[2]+=t/2,i[3]+=e/2},Dv.prototype.inflatePoint=function(t){var e=this._rawData;e[0]-=t.x/2,e[1]-=t.y/2,e[2]+=t.x/2,e[3]+=t.y/2},Dv.prototype.intersection=function(t){var e=this._rawData,i=t._rawData;if(this.intersects(t)){var n=new Dv,r=n._rawData;return e[0]>i[0]?(r[0]=e[0],r[2]=i[0]-e[0]+i[2],r[2]>e[2]&&(r[2]=e[2])):(r[0]=i[0],r[2]=e[0]-i[0]+e[2],r[2]>i[2]&&(r[2]=i[2])),e[1]>i[1]?(r[1]=e[1],r[3]=i[1]-e[1]+i[3],r[3]>e[3]&&(r[3]=e[3])):(r[1]=i[1],r[3]=e[1]-i[1]+e[3],r[3]>i[3]&&(r[3]=i[3])),n}return new Dv},Dv.prototype.intersects=function(t){var e=this._rawData,i=t._rawData;return e[0]+e[2]>i[0]&&e[0]i[1]&&e[1]=this._repeatCount?(this.stop(),this.dispatchEvent(new TimerEvent(TimerEvent.TIMER)),this.dispatchEvent(new TimerEvent(TimerEvent.TIMER_COMPLETE))):this.dispatchEvent(new TimerEvent(TimerEvent.TIMER))},yC),xC,sA,kz,dy,Hx,Bx,vx,Lw,et,bt,Ys,Ts,Ms,Is,Es,As,qr,og,jg,Le,ec;function yC(t,e){void 0===e&&(e=0);var i=xC.call(this)||this;if(i._repeatCount=0,i._currentCount=0,i._running=!1,i._delay=t,i._repeatCount=e,isNaN(t)||t<0)throw new ErrorBase("Delay is negative or not a number");return i}function uC(t){void 0===t&&(t=null),this.method=URLRequestMethod.GET,this.async=!0,this._url=t}function QB(){}function tA(){var t,e=sA.call(this)||this;return e._loaderSessionsGarbage=new Array,e._assets=new Array,e._assetDictionary=new Object,e._loaderSessions=new Array,e.conflictStrategy=ConflictStrategy.IGNORE.create(),e.conflictPrecedence=ConflictPrecedence.FAVOR_NEW,e._onAssetRenameDelegate=function(t){return e._onAssetRename(t)},e._onAssetConflictResolvedDelegate=function(t){return e._onAssetConflictResolved(t)},e._onLoaderStartDelegate=function(t){return e._onLoaderStart(t)},e._onLoaderCompleteDelegate=function(t){return e._onLoaderComplete(t)},e._onTextureSizeErrorDelegate=function(t){return e._onTextureSizeError(t)},e._onAssetCompleteDelegate=function(t){return e._onAssetComplete(t)},e._onLoadErrorDelegate=function(t){return e._onLoadError(t)},e._onParseErrorDelegate=function(t){return e._onParseError(t)},e._errorDelegateSelector=((t={})[URLLoaderEvent.LOAD_ERROR]=e._onLoadErrorDelegate,t[ParserEvent.PARSE_ERROR]=e._onParseErrorDelegate,t),e}function lz(t){void 0===t&&(t=0);var e=kz.call(this)||this;return e._materialMode=t,e._stack=new Array,e._onReadyForDependenciesDelegate=function(t){return e._onReadyForDependencies(t)},e._onParseCompleteDelegate=function(t){return e._onParseComplete(t)},e._onParseErrorDelegate=function(t){return e._onParseError(t)},e._onLoadProgressDelegate=function(t){return e._onLoadProgress(t)},e._onLoadCompleteDelegate=function(t){return e._onLoadComplete(t)},e._onLoadErrorDelegate=function(t){return e._onLoadError(t)},e._onTextureSizeErrorDelegate=function(t){return e._onTextureSizeError(t)},e._onAssetCompleteDelegate=function(t){return e._onAssetComplete(t)},e}function Vy(t,e){void 0===t&&(t=!0),void 0===e&&(e=null),this._includeDependencies=t,this._dependencyBaseUrl=e||"",this._embeddedDataByUrl={},this._remappedUrls={},this._materialMode=Vy.UNDEFINED,this._externalAssetMode=Vy.PRELOADED}function Jy(t,e,i,n,r,o,s,a){void 0===o&&(o=!1),void 0===s&&(s=!1),void 0===a&&(a=0),this._assets=[],this._dependencies=[],this._id=t,this._sub_id=a,this._request=e,this._data=i,this._parser=n,this._parentParser=r,this._retrieveAsRawData=o,this._suppressAssetEvents=s}function ey(){var t=dy.call(this)||this;return t._bytesLoaded=0,t._bytesTotal=0,t._dataFormat=URLLoaderDataFormat.TEXT,t._loadError=!1,t}function Xx(t){void 0===t&&(t=null),this._variables=new Object,null!==t&&this.decode(t)}function Wx(){}function Vx(){}function Tx(t){}function Ix(t){void 0===t&&(t=".");var e=Hx.call(this)||this;return e._separator=t,e._next_suffix={},e}function Cx(){return Bx.call(this)||this}function wx(){return vx.call(this)||this}function hx(){}function gx(){}function Uw(t,e,i,n){this._assets=t,this.filter(e,i,n)}function Mw(t,e){var i=Lw.call(this)||this;return i._invalid=!0,i._asset=t,i._pool=e,i._onClearDelegate=function(t){return i.onClear(t)},i._onInvalidateDelegate=function(t){return i.onInvalidate(t)},i._asset&&(i._asset.addEventListener(AssetEvent.CLEAR,i._onClearDelegate),i._asset.addEventListener(AssetEvent.INVALIDATE,i._onInvalidateDelegate)),i}function Dv(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this._rawData=new Float32Array(4);var r=this._rawData;r[0]=t,r[1]=e,r[2]=i,r[3]=n}function Ht(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),this.x=0,this.y=0,this.z=0,this.w=1,this.x=t,this.y=e,this.z=i,this.w=n}function Ft(){}function kt(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.a=t,this.b=e,this.c=i,this.d=n,this._iAlignment=0==t&&0==e?kt.ALIGN_XY_AXIS:0==e&&0==i?kt.ALIGN_YZ_AXIS:0==t&&0==i?kt.ALIGN_XZ_AXIS:kt.ALIGN_ANY}function jt(){}function ft(t,e){var i=et.call(this,t)||this;return i._urlLoader=e,i}function ct(t){return bt.call(this,t)||this}function Zs(t,e){var i=Ys.call(this,t)||this;return i._projection=e,i}function Us(t,e){void 0===e&&(e="");var i=Ts.call(this,t)||this;return i._message=e,i}function Ns(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null);var r=Ms.call(this,t)||this;return r._url=e,r._content=i,r._assets=n,r}function Js(t,e){return void 0===t&&(t=null),void 0===e&&(e=0),Is.call(this,t||"RangeError",e)||this}function Fs(t,e){return void 0===t&&(t=""),void 0===e&&(e=0),Es.call(this,"PartialImplementationError - this function is in development. Required Dependency: "+t,e)||this}function Bs(t,e){return void 0===t&&(t="DocumentError"),void 0===e&&(e=0),As.call(this,t,e)||this}function rr(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=qr.call(this)||this;return i._inverseConcatenatedMatrix3D=new Matrix3D,i._matrix=null,i._rotation=new Vector3D,i._scale=new Vector3D(1,1,1),i._skew=new Vector3D,i._tempVector3D=new Vector3D,i._rawData=t||new Float32Array(24),i._matrix3D=new Matrix3D(new Float32Array(i._rawData.buffer,0,16)),i._colorTransform=new ColorTransform(new Float32Array(i._rawData.buffer,64,8)),i._concatenatedMatrix3D=e||i._matrix3D,null==t&&(i._matrix3D.identity(),i._colorTransform.clear()),i._components=new Array(4),i._components[1]=i._rotation,i._components[2]=i._skew,i._components[3]=i._scale,i.invalidateComponents(),i}function Ql(t){void 0===t&&(t=null),this._position=new Vector3D,this._positionDirty=!0,null!=t?this._rawData=t:(this._rawData=new Float32Array(16),this.identity())}function ol(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.radius=n}function nl(){}function ml(){}function bk(t,e,i,n,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=0),this.x=t,this.y=e,this.z=i,this.width=n,this.height=r,this.depth=o}function Ji(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),this._rawData=new Float32Array(4);var r=this._rawData;r[0]=t,r[1]=e,r[2]=i,r[3]=n}function Ug(t,e,i,n,r,o){var s;void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),this.rawData=new Float32Array(6),t instanceof Float32Array?this.copyRawDataFrom(t):((s=this.rawData)[0]=Number(t),s[1]=e,s[2]=i,s[3]=n,s[4]=r,s[5]=o)}function sg(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._rawData=new Float32Array(2),this._rawData[0]=t,this._rawData[1]=e}function pg(t,e){return void 0===t&&(t=null),void 0===e&&(e=0),og.call(this,t||"ArgumentError",e)||this}function kg(t,e){var i=jg.call(this,t)||this;return i._transform=e,i}function Jf(t,e,i,n,r,o,s,a){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),t instanceof Float32Array?this._rawData=t:(this._rawData=new Float32Array(8),this.redMultiplier=Number(t),this.greenMultiplier=e,this.blueMultiplier=i,this.alphaMultiplier=n,this.redOffset=r,this.greenOffset=o,this.blueOffset=s,this.alphaOffset=a)}function sf(){}function df(t){t instanceof Blob?this._blob=t:this._buffer=t instanceof ByteArray?t.arraybytes:t}function Me(t,e){void 0===e&&(e=0);var i=Le.call(this)||this;return i._volume=1,i._pan=0,i._audioChannels=[],i._loopsToPlay=0,i._isPlaying=!1,i._channelsPlaying=0,i._data=t,i._channelGroup=e,i}function xe(){}function Td(t,e,i){var n=this;void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=1),this._isPlaying=!1,this._isLooping=!1,this._groupID=0,this._groupVolume=1,this._groupPan=0,this._startTime=0,this._groupID=t,this._groupVolume=e,this._groupPan=i,this._audio=new Audio,this._audio.ontimeupdate=function(t){return n._onTimeUpdate(t)}}function md(){}function fc(t){void 0===t&&(t=4);var e=ec.call(this)||this;return e._mode="Typed array",e.maxlength=Math.max(t+255&-256,4),e.arraybytes=new ArrayBuffer(e.maxlength),e.unalignedarraybytestemp=new ArrayBuffer(16),e}function ub(){this.position=0,this.length=0,this._mode=""}function getTimer(){return Date.now()}var ParserBase=(FC=EventDispatcher,__extends(GC,FC),GC.supportsType=function(t){throw new AbstractMethodError},Object.defineProperty(GC.prototype,"content",{get:function(){return this._pContent},enumerable:!0,configurable:!0}),Object.defineProperty(GC.prototype,"parsingFailure",{get:function(){return this._parsingFailure},set:function(t){this._parsingFailure=t},enumerable:!0,configurable:!0}),Object.defineProperty(GC.prototype,"parsingPaused",{get:function(){return this._parsingPaused},enumerable:!0,configurable:!0}),Object.defineProperty(GC.prototype,"parsingComplete",{get:function(){return this._parsingComplete},enumerable:!0,configurable:!0}),Object.defineProperty(GC.prototype,"materialMode",{get:function(){return this._materialMode},set:function(t){this._materialMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(GC.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),Object.defineProperty(GC.prototype,"dataFormat",{get:function(){return this._dataFormat},enumerable:!0,configurable:!0}),GC.prototype.parseAsync=function(t,e){void 0===e&&(e=30),this._data=t,this._pStartParsing(e)},GC.prototype.parseSync=function(t){this._data=t;for(var e=GC.MORE_TO_PARSE;e==GC.MORE_TO_PARSE;)e=this._pProceedParsing();return this._pContent},Object.defineProperty(GC.prototype,"dependencies",{get:function(){return this._dependencies},enumerable:!0,configurable:!0}),GC.prototype._iResolveDependency=function(t){throw new AbstractMethodError},GC.prototype._iResolveDependencyFailure=function(t){throw new AbstractMethodError},GC.prototype._iResolveDependencyName=function(t,e){return e.name},GC.prototype._iResumeParsing=function(){this._parsingPaused=!1,this._timer&&this._timer.start(),this._isParsing||this._pOnInterval()},GC.prototype._pFinalizeAsset=function(t,e){void 0===e&&(e=null),t.name=e||t.name||t.assetType,this.dispatchEvent(new AssetEvent(AssetEvent.ASSET_COMPLETE,t))},GC.prototype._pProceedParsing=function(){throw new AbstractMethodError},GC.prototype._pDieWithError=function(t){void 0===t&&(t="Unknown parsing error"),this._timer&&(this._timer.removeEventListener(TimerEvent.TIMER,this._pOnIntervalDelegate),this._timer.stop(),this._timer=null),this.dispatchEvent(new ParserEvent(ParserEvent.PARSE_ERROR,t))},GC.prototype._pAddDependency=function(t,e,i,n,r,o,s){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===s&&(s=0);var a=new ResourceDependency(t,e,n,i,this,r,o,s);return this._dependencies.push(a),a},GC.prototype._pPauseAndRetrieveDependencies=function(){this._pPauseParsing(),this.dispatchEvent(new ParserEvent(ParserEvent.READY_FOR_DEPENDENCIES))},GC.prototype._pPauseParsing=function(){this._timer&&this._timer.stop(),this._parsingPaused=!0},GC.prototype._pHasTime=function(){return getTimer()-this._lastFrameTimethis.byteLength+4)throw"ByteArray out of bounds read. Position="+this.bytePosition+", Length="+this.byteLength;var t=this.bytePosition>>2;return this.bytePosition+=4,this._int32Array[t]},oF.prototype.writeUnsignedInt=function(t){this._ensureSpace(this.bytePosition+4),this._uint32Array[this.bytePosition>>2]=4294967295&~~t,this.bytePosition+=4},oF.prototype.writeInt=function(t){this._ensureSpace(this.bytePosition+4),this._int32Array[this.bytePosition>>2]=~~t,this.bytePosition+=4},oF.prototype.readUnsignedInt=function(){if(this.bytePosition>this.byteLength+4)throw"ByteArray out of bounds read. Position="+this.bytePosition+", Length="+this.byteLength;var t=this.bytePosition>>2;return this.bytePosition+=4,this._uint32Array[t]},oF.prototype.writeFloat=function(t){this._ensureSpace(this.bytePosition+4),this._float32Array[this.bytePosition>>2]=t,this.bytePosition+=4},oF.prototype.readFloat=function(){if(this.bytePosition>this.byteLength+4)throw"ByteArray out of bounds read. Positon="+this.bytePosition+", Length="+this.byteLength;var t=this.bytePosition>>2;return this.bytePosition+=4,this._float32Array[t]},oF.prototype._ensureSpace=function(t){var e,i;this.byteLengththis.length&&(this.length=this.position)},XF.prototype.readByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;return this._bytes[this.position++]},XF.prototype.writeUnsignedByte=function(t){var e=~~t;this._bytes[this.position++]=255&e,this.position>this.length&&(this.length=this.position)},XF.prototype.readUnsignedByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;return this._bytes[this.position++]},XF.prototype.writeUnsignedShort=function(t){var e=~~t;this._bytes[this.position++]=255&e,this._bytes[this.position++]=e>>8&255,this.position>this.length&&(this.length=this.position)},XF.prototype.readUnsignedShort=function(){if(this.position+2>this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;var t=this._bytes[this.position]|this._bytes[this.position+1]<<8;return this.position+=2,t},XF.prototype.writeUnsignedInt=function(t){var e=~~t;this._bytes[this.position++]=255&e,this._bytes[this.position++]=e>>>8&255,this._bytes[this.position++]=e>>>16&255,this._bytes[this.position++]=e>>>24&255,this.position>this.length&&(this.length=this.position)},XF.prototype.readUnsignedInt=function(){if(this.position+4>this.length)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;var t=this._bytes[this.position]|this._bytes[this.position+1]<<8|this._bytes[this.position+2]<<16|this._bytes[this.position+3]<<24;return this.position+=4,t>>>0},XF.prototype.writeFloat=function(t){this.writeUnsignedInt(this.toFloatBits(Number(t)))},XF.prototype.toFloatBits=function(t){if(0==t)return 0;var e=0,e=t<0?(t=-t,1):0,i=Math.log(t)/Math.log(2),i=Math.floor(i);return t*=Math.pow(2,23-i),e<<31>>>0|(i+=127)<<23|Math.floor(t)-8388608},XF.prototype.readFloat=function(t){return this.fromFloatBits(this.readUnsignedInt())},XF.prototype.fromFloatBits=function(t){if(0==t)return 0;var e=t>>>23&255,i=8388607&t|8388608,n=Math.pow(2,e-127-23)*i;return t>>>31!=0&&(n=-n),n},XF),CSS=(qG.setElementSize=function(t,e,i){t&&(t.style.width=e+"px",t.style.height=i+"px",t.width=e,t.height=i)},qG.setElementWidth=function(t,e){t&&(t.style.width=e+"px",t.width=e)},qG.setElementHeight=function(t,e){t&&(t.style.height=e+"px",t.height=e)},qG.setElementX=function(t,e){t&&(t.style.position="absolute",t.style.left=e+"px")},qG.setElementY=function(t,e){t&&(t.style.position="absolute",t.style.top=e+"px")},qG.getElementVisibility=function(t){return!!t&&"visible"==t.style.visibility},qG.setElementVisibility=function(t,e){t&&(t.style.visibility=e?"visible":"hidden")},qG.setElementAlpha=function(t,e){t instanceof HTMLCanvasElement&&(t.getContext("2d").globalAlpha=e)},qG.setElementPosition=function(t,e,i,n){void 0===n&&(n=!1),t&&(t.style.position=n?"absolute":"relative",t.style.left=e+"px",t.style.top=i+"px")},qG),RequestAnimationFrame=(LG.prototype.setCallback=function(t,e){this._callback=t,this._callbackContext=e},LG.prototype.start=function(){this._prevTime=this._getTimer(),this._active=!0,window&&(window.requestAnimationFrame?window.requestAnimationFrame(this._rafUpdateFunction):window.mozRequestAnimationFrame?window.requestAnimationFrame=window.mozRequestAnimationFrame:window.webkitRequestAnimationFrame?window.requestAnimationFrame=window.webkitRequestAnimationFrame:window.oRequestAnimationFrame&&(window.requestAnimationFrame=window.oRequestAnimationFrame))},LG.prototype.stop=function(){this._active=!1},Object.defineProperty(LG.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),LG.prototype._tick=function(){this._currentTime=this._getTimer(),this._dt=this._currentTime-this._prevTime,this._argsArray[0]=this._dt,this._callback.apply(this._callbackContext,this._argsArray),window.requestAnimationFrame(this._rafUpdateFunction),this._prevTime=this._currentTime},LG),XmlUtils=(RG.getChildrenWithTag=function(t,e){var i=document.createDocumentFragment();if(t)for(var n=t.childNodes.length,r=0;r/g),r=null;-1!=n&&(r=t.slice(n).match(/([\w\.\-\+]+)/gi),t=t.slice(0,n));var o=t.match(/([\w\.\+\[\]]+)/gi);if(!o||o.length<1)3<=t.length&&console.log("Warning: bad line "+e+": "+t);else switch(o[0]){case"part":this.addHeader(o[1],Number(o[2]));break;case"endpart":if(!this.cur)throw"Unexpected endpart";return this.cur.data.position=0,void(this.cur=null);default:if(!this.cur)return void console.log("Warning: bad line "+e+": "+t+" (Outside of any part definition)");if("comment"==this.cur.name)return;var s=OpcodeMap.map[o[0]];if(!s)throw"Bad opcode "+o[0]+" "+e+": "+t;this.emitOpcode(this.cur,s.opcode);var a=1;if(s.dest&&"none"!=s.dest){if(!this.emitDest(this.cur,o[a++],s.dest))throw"Bad destination register "+o[a-1]+" "+e+": "+t}else this.emitZeroDword(this.cur);if(s.a&&"none"!=s.a.format){if(!this.emitSource(this.cur,o[a++],s.a))throw"Bad source register "+o[a-1]+" "+e+": "+t}else this.emitZeroQword(this.cur);if(s.b&&"none"!=s.b.format){if("sampler"==s.b.format){if(!this.emitSampler(this.cur,o[a++],s.b,r))throw"Bad sampler register "+o[a-1]+" "+e+": "+t}else if(!this.emitSource(this.cur,o[a++],s.b))throw"Bad source register "+o[a-1]+" "+e+": "+t}else this.emitZeroQword(this.cur)}}},PH.prototype.emitHeader=function(t){switch(t.data.writeUnsignedByte(160),t.data.writeUnsignedInt(t.version),16<=t.version&&t.data.writeUnsignedByte(0),t.data.writeUnsignedByte(161),t.name){case"fragment":t.data.writeUnsignedByte(1);break;case"vertex":t.data.writeUnsignedByte(0);break;case"cpu":t.data.writeUnsignedByte(2);break;default:t.data.writeUnsignedByte(255)}},PH.prototype.emitOpcode=function(t,e){t.data.writeUnsignedInt(e)},PH.prototype.emitZeroDword=function(t){t.data.writeUnsignedInt(0)},PH.prototype.emitZeroQword=function(t){t.data.writeUnsignedInt(0),t.data.writeUnsignedInt(0)},PH.prototype.emitDest=function(t,e,i){var n=e.match(/([fov]?[tpocidavs])(\d*)(\.[xyzw]{1,4})?/i);if(!RegMap.map[n[1]])return!1;var r={num:n[2]?n[2]:0,code:RegMap.map[n[1]].code,mask:this.stringToMask(n[3])};return t.data.writeUnsignedShort(r.num),t.data.writeUnsignedByte(r.mask),t.data.writeUnsignedByte(r.code),!0},PH.prototype.stringToMask=function(t){if(!t)return 15;var e=0;return-1!=t.indexOf("x")&&(e|=1),-1!=t.indexOf("y")&&(e|=2),-1!=t.indexOf("z")&&(e|=4),-1!=t.indexOf("w")&&(e|=8),e},PH.prototype.stringToSwizzle=function(t){if(!t)return 228;var e={x:0,y:1,z:2,w:3},i=0;if("."!=t.charAt(0))throw"Missing . for swizzle";return 1>l.shift&l.mask)&&console.log("Warning, duplicate sampler option"),s|=l.mask<=float(%b)) {;\n",0,!1,!0,!0,null,null,null,!0,null,null),new OpLUT("if (float(%a)>=1),161!=t.readUnsignedByte())throw"Bad AGAL: Missing 0xa1 magic byte.";switch(e.progid=t.readUnsignedByte(),e.progid){case 1:e.type="fragment";break;case 0:e.type="vertex";break;case 2:e.type="cpu";break;default:e.type=""}for(var i=new Description,n=[];t.position>4,t.readmode&=15,t.special=n.readUnsignedByte(),t.wrap=t.special>>4,t.special&=15,t.mipmap=n.readUnsignedByte(),t.filter=t.mipmap>>4,t.mipmap&=15,i.samplers[t.regnum]=t):(t.indexregtype=n.readUnsignedByte(),t.indexselect=n.readUnsignedByte(),t.indirectflag=n.readUnsignedByte()),t.indirectflag&&(i.hasindirect=!0),!t.indirectflag&&e)for(var r=0;r>u&1))continue;var d=this.regtostring(t.tokens[s].dest.regtype,t.tokens[s].dest.regnum,t,r),_="float";d+="."+(m=["x","y","z","w"][u])}else if(d=this.regtostring(t.tokens[s].dest.regtype,t.tokens[s].dest.regnum,t,r),15!=t.tokens[s].dest.mask){var f=0,m="";switch(1&t.tokens[s].dest.mask&&(f++,m+="x"),2&t.tokens[s].dest.mask&&(f++,m+="y"),4&t.tokens[s].dest.mask&&(f++,m+="z"),8&t.tokens[s].dest.mask&&(f++,m+="w"),d+="."+m,f){case 1:_="float";break;case 2:_="vec2";break;case 3:_="vec3";break;default:throw"Unexpected destination mask"}}else _="vec4",m="xyzw";p=(p=(p=p.replace("%dest",d)).replace("%cast",_)).replace("%dm",m)}var g,y,b=15;!c.ndwm&&c.dest&&t.tokens[s].dest&&(b=t.tokens[s].dest.mask),t.tokens[s].a&&(p=p.replace("%a",this.sourcetostring(t.tokens[s].a,0,b,c.scalar,t,r))),t.tokens[s].b&&(p=p.replace("%b",this.sourcetostring(t.tokens[s].b,u,b,c.scalar,t,r)),5==t.tokens[s].b.regtype)&&(g=["2D","Cube","3D"][t.tokens[s].b.dim],y=["vec2","vec3","vec3"][t.tokens[s].b.dim],p=(p=(p=p.replace("%texdim",g)).replace("%texsize",y)).replace("%lod","")),n+=p}}return"vertex"==t.header.type&&(n+=" gl_Position = vec4(outpos.x, outpos.y, outpos.z*2.0 - outpos.w, outpos.w);\n"),l&&"fragment"==t.header.type&&(i="#extension GL_OES_standard_derivatives : enable\n"+i),t.writedepth&&(n+=" gl_FragDepth = clamp(tmp_FragDepth,0.0,1.0);\n"),i+(n+"}\n")},eJ.prototype.regtostring=function(t,e,i,n){switch(t){case 0:return"va"+e;case 1:return i.header.type[0]+"c["+e+"]";case 2:return n+"t"+e;case 3:return"vertex"==i.header.type?"outpos":"gl_FragColor";case 4:return"vi"+e;case 5:return"fs"+e;case 6:return"tmp_FragDepth";default:throw"Unknown register type"}},eJ.prototype.sourcetostring=function(t,e,i,n,r,o){var s,a,l=["x","y","z","w"];return t.indirectflag?(s="vcarrr[int("+this.regtostring(t.indexregtype,t.regnum,r,o)+"."+l[t.indexselect]+")",(a=e+t.indexoffset)<0&&(s+=a.toString()),0>0&3]:(228==t.swizzle&&15==i||(s+=".",1&i&&(s+=l[t.swizzle>>0&3]),2&i&&(s+=l[t.swizzle>>2&3]),4&i&&(s+=l[t.swizzle>>4&3]),8&i&&(s+=l[t.swizzle>>6&3])),s)},eJ.maxvertexconstants=128,eJ.maxfragconstants=28,eJ.maxtemp=8,eJ.maxstreams=8,eJ.maxtextures=8,eJ),ContextGLBlendFactor,ContextGLClearMask,ContextGLCompareMode,ContextGLDrawMode,ContextGLMipFilter,ContextGLProfile,ContextGLProgramType,ContextGLStencilAction,ContextGLTextureFilter,ContextGLTextureFormat,ContextGLTriangleFace,ContextGLVertexBufferFormat,ContextGLWrapMode,ContextMode,qH,ZJ,YJ,XJ,WJ,VJ,UJ,TJ,SJ,RJ,QJ,PJ,OJ,NJ,MJ;function eJ(){}function UI(){}function SI(t){}function PH(){this.r={},this.cur=new Part}function OH(){}function KH(){}function FH(){}function rH(t,e){var i=qH.call(this,t)||this;return i._avmVersion=e,i}MJ=ContextGLBlendFactor=ContextGLBlendFactor||{},MJ[MJ.DESTINATION_ALPHA=0]="DESTINATION_ALPHA",MJ[MJ.DESTINATION_COLOR=1]="DESTINATION_COLOR",MJ[MJ.ONE=2]="ONE",MJ[MJ.ONE_MINUS_DESTINATION_ALPHA=3]="ONE_MINUS_DESTINATION_ALPHA",MJ[MJ.ONE_MINUS_DESTINATION_COLOR=4]="ONE_MINUS_DESTINATION_COLOR",MJ[MJ.ONE_MINUS_SOURCE_ALPHA=5]="ONE_MINUS_SOURCE_ALPHA",MJ[MJ.ONE_MINUS_SOURCE_COLOR=6]="ONE_MINUS_SOURCE_COLOR",MJ[MJ.SOURCE_ALPHA=7]="SOURCE_ALPHA",MJ[MJ.SOURCE_COLOR=8]="SOURCE_COLOR",MJ[MJ.ZERO=9]="ZERO",NJ=ContextGLClearMask=ContextGLClearMask||{},NJ[NJ.COLOR=1]="COLOR",NJ[NJ.DEPTH=2]="DEPTH",NJ[NJ.STENCIL=4]="STENCIL",NJ[NJ.ALL=7]="ALL",OJ=ContextGLCompareMode=ContextGLCompareMode||{},OJ[OJ.ALWAYS=0]="ALWAYS",OJ[OJ.EQUAL=1]="EQUAL",OJ[OJ.GREATER=2]="GREATER",OJ[OJ.GREATER_EQUAL=3]="GREATER_EQUAL",OJ[OJ.LESS=4]="LESS",OJ[OJ.LESS_EQUAL=5]="LESS_EQUAL",OJ[OJ.NEVER=6]="NEVER",OJ[OJ.NOT_EQUAL=7]="NOT_EQUAL",PJ=ContextGLDrawMode=ContextGLDrawMode||{},PJ[PJ.TRIANGLES=0]="TRIANGLES",PJ[PJ.LINES=1]="LINES",QJ=ContextGLMipFilter=ContextGLMipFilter||{},QJ[QJ.MIPLINEAR=0]="MIPLINEAR",QJ[QJ.MIPNEAREST=1]="MIPNEAREST",QJ[QJ.MIPNONE=2]="MIPNONE",RJ=ContextGLProfile=ContextGLProfile||{},RJ[RJ.BASELINE=0]="BASELINE",RJ[RJ.BASELINE_CONSTRAINED=1]="BASELINE_CONSTRAINED",RJ[RJ.BASELINE_EXTENDED=2]="BASELINE_EXTENDED",SJ=ContextGLProgramType=ContextGLProgramType||{},SJ[SJ.FRAGMENT=0]="FRAGMENT",SJ[SJ.SAMPLER=1]="SAMPLER",SJ[SJ.VERTEX=2]="VERTEX",TJ=ContextGLStencilAction=ContextGLStencilAction||{},TJ[TJ.DECREMENT_SATURATE=0]="DECREMENT_SATURATE",TJ[TJ.DECREMENT_WRAP=1]="DECREMENT_WRAP",TJ[TJ.INCREMENT_SATURATE=2]="INCREMENT_SATURATE",TJ[TJ.INCREMENT_WRAP=3]="INCREMENT_WRAP",TJ[TJ.INVERT=4]="INVERT",TJ[TJ.KEEP=5]="KEEP",TJ[TJ.SET=6]="SET",TJ[TJ.ZERO=7]="ZERO",UJ=ContextGLTextureFilter=ContextGLTextureFilter||{},UJ[UJ.LINEAR=0]="LINEAR",UJ[UJ.NEAREST=1]="NEAREST",VJ=ContextGLTextureFormat=ContextGLTextureFormat||{},VJ[VJ.BGRA=0]="BGRA",VJ[VJ.BGRA_PACKED=1]="BGRA_PACKED",VJ[VJ.BGR_PACKED=2]="BGR_PACKED",VJ[VJ.COMPRESSED=3]="COMPRESSED",VJ[VJ.COMPRESSED_ALPHA=4]="COMPRESSED_ALPHA",WJ=ContextGLTriangleFace=ContextGLTriangleFace||{},WJ[WJ.BACK=0]="BACK",WJ[WJ.FRONT=1]="FRONT",WJ[WJ.FRONT_AND_BACK=2]="FRONT_AND_BACK",WJ[WJ.NONE=3]="NONE",XJ=ContextGLVertexBufferFormat=ContextGLVertexBufferFormat||{},XJ[XJ.FLOAT_1=0]="FLOAT_1",XJ[XJ.FLOAT_2=1]="FLOAT_2",XJ[XJ.FLOAT_3=2]="FLOAT_3",XJ[XJ.FLOAT_4=3]="FLOAT_4",XJ[XJ.BYTE_1=4]="BYTE_1",XJ[XJ.BYTE_2=5]="BYTE_2",XJ[XJ.BYTE_3=6]="BYTE_3",XJ[XJ.BYTE_4=7]="BYTE_4",XJ[XJ.UNSIGNED_BYTE_1=8]="UNSIGNED_BYTE_1",XJ[XJ.UNSIGNED_BYTE_2=9]="UNSIGNED_BYTE_2",XJ[XJ.UNSIGNED_BYTE_3=10]="UNSIGNED_BYTE_3",XJ[XJ.UNSIGNED_BYTE_4=11]="UNSIGNED_BYTE_4",XJ[XJ.SHORT_1=12]="SHORT_1",XJ[XJ.SHORT_2=13]="SHORT_2",XJ[XJ.SHORT_3=14]="SHORT_3",XJ[XJ.SHORT_4=15]="SHORT_4",XJ[XJ.UNSIGNED_SHORT_1=16]="UNSIGNED_SHORT_1",XJ[XJ.UNSIGNED_SHORT_2=17]="UNSIGNED_SHORT_2",XJ[XJ.UNSIGNED_SHORT_3=18]="UNSIGNED_SHORT_3",XJ[XJ.UNSIGNED_SHORT_4=19]="UNSIGNED_SHORT_4",YJ=ContextGLWrapMode=ContextGLWrapMode||{},YJ[YJ.CLAMP=0]="CLAMP",YJ[YJ.REPEAT=1]="REPEAT",ZJ=ContextMode=ContextMode||{},ZJ[ZJ.AUTO=0]="AUTO",ZJ[ZJ.WEBGL=1]="WEBGL",ZJ[ZJ.FLASH=2]="FLASH",ZJ[ZJ.GLES=3]="GLES",ZJ[ZJ.NATIVE=4]="NATIVE",ZJ[ZJ.SOFTWARE=5]="SOFTWARE";var SamplerState=function(){},ImageEvent=($J=EventBase,__extends(_J,$J),Object.defineProperty(_J.prototype,"image",{get:function(){return this._image},enumerable:!0,configurable:!0}),_J.INVALIDATE_MIPMAPS="invalidateMipmaps",_J),StageEvent=(dK=EventBase,__extends(eK,dK),Object.defineProperty(eK.prototype,"stage",{get:function(){return this._stage},enumerable:!0,configurable:!0}),eK.prototype.clone=function(){return new eK(this.type,this._stage)},eK.STAGE_ERROR="stageError",eK.CONTEXT_CREATED="contextCreated",eK.CONTEXT_DISPOSED="contextDisposed",eK.CONTEXT_RECREATED="contextRecreated",eK.INVALIDATE_SIZE="invalidateSize",eK),RTTEvent=(iK=EventBase,__extends(jK,iK),Object.defineProperty(jK.prototype,"rttManager",{get:function(){return this._rttManager},enumerable:!0,configurable:!0}),jK.prototype.clone=function(){return new jK(this.type,this._rttManager)},jK.RESIZE="rttManagerResize",jK),ImageBase=(nK=AssetBase,__extends(oK,nK),Object.defineProperty(oK.prototype,"format",{get:function(){return this._pFormat},enumerable:!0,configurable:!0}),oK.prototype.invalidateMipmaps=function(){this.dispatchEvent(new ImageEvent(ImageEvent.INVALIDATE_MIPMAPS,this))},oK),_Stage_ImageBase=(qK=AbstractionBase,__extends(rK,qK),rK.prototype.getTexture=function(){return this._texture||(this._createTexture(),this._invalid=!0),this._texture},rK.prototype.getType=function(){throw new AbstractMethodError},rK.prototype.onClear=function(t){qK.prototype.onClear.call(this,t),this._texture&&(this._texture.dispose(),this._texture=null)},rK.prototype.activate=function(t,e){void 0===e&&(e=null);var i=!(!(e=e||ImageUtils.getDefaultSampler()).mipmap||this._stage.globalDisableMipmap)&&e.mipmap;this._stage.setSamplerAt(t,e),this._stage.context.setTextureAt(t,this.getTexture()),!this._mipmap&&i&&(this._mipmap=!0,this._invalidMipmaps=!0),this._invalidMipmaps&&(this._invalidMipmaps=!1,i&&this._texture.generateMipmaps())},rK.prototype._createTexture=function(){throw new AbstractMethodError},rK.prototype._onInvalidateMipmaps=function(t){this._invalidMipmaps=!0},rK),OpCodes=(BK.trueValue=32,BK.falseValue=33,BK.intMask=63,BK.drawTriangles=41,BK.setProgramConstant=42,BK.setProgram=43,BK.present=44,BK.clear=45,BK.initProgram=46,BK.initVertexBuffer=47,BK.initIndexBuffer=48,BK.configureBackBuffer=49,BK.uploadArrayIndexBuffer=50,BK.uploadArrayVertexBuffer=51,BK.uploadAGALBytesProgram=52,BK.setVertexBufferAt=53,BK.uploadBytesIndexBuffer=54,BK.uploadBytesVertexBuffer=55,BK.setColorMask=56,BK.setDepthTest=57,BK.disposeProgram=58,BK.disposeContext=59,BK.disposeVertexBuffer=61,BK.disposeIndexBuffer=63,BK.initTexture=64,BK.setTextureAt=65,BK.uploadBytesTexture=66,BK.disposeTexture=67,BK.setCulling=68,BK.setScissorRect=69,BK.clearScissorRect=70,BK.setBlendFactors=71,BK.setRenderToTexture=72,BK.clearTextureAt=73,BK.clearVertexBufferAt=74,BK.setStencilActions=75,BK.setStencilReferenceValue=76,BK.initCubeTexture=77,BK.disposeCubeTexture=78,BK.uploadBytesCubeTexture=79,BK.clearRenderToTexture=80,BK.enableErrorChecking=81,BK.drawVertices=82,BK.getFrameBufferForTexture=83,BK.uploadProgram=84,BK.disableCulling=85,BK.disableBlending=86,BK.setSamplerStateAt=87,BK.enableStencil=88,BK.disableStencil=89,BK.setStencilActionsMasks=90,BK.uploadTextureFromURL=92,BK.startSound=101,BK.stopSound=102,BK.updateSound=103,BK),GLESAssetBase=(Object.defineProperty(CK.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),CK),TextureBaseGLES=(FK=GLESAssetBase,__extends(GK,FK),GK.prototype.dispose=function(){this._context._createBytes.writeInt(OpCodes.disposeTexture),this._context._createBytes.writeInt(this.id)},Object.defineProperty(GK.prototype,"glTexture",{get:function(){return this._glTexture},enumerable:!0,configurable:!0}),GK.prototype.generateMipmaps=function(){},GK),CubeTextureGLES=(LK=TextureBaseGLES,__extends(MK,LK),MK.prototype.uploadFromArray=function(t,e,i,n){if(t.length!=this._size*this._size*4)throw new Error("Array is not the correct length for texture dimensions");t instanceof Array&&(t=new Uint8Array(t))},MK.prototype.uploadCompressedTextureFromArray=function(t,e,i){},Object.defineProperty(MK.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),MK),IndexBufferGLES=(ZK=GLESAssetBase,__extends($K,ZK),$K.prototype.uploadFromArray=function(t,e,i){},$K.prototype.uploadFromByteArray=function(t,e,i){},$K.prototype.dispose=function(){},Object.defineProperty($K.prototype,"numIndices",{get:function(){return this._numIndices},enumerable:!0,configurable:!0}),Object.defineProperty($K.prototype,"glBuffer",{get:function(){return this._buffer},enumerable:!0,configurable:!0}),$K),GLESConnector=(Object.defineProperty(kL,"gles",{get:function(){if(!kL._gles)throw"Error: Set GlesConnector.gles before calling methods on ContextGLES!";return kL._gles},set:function(t){kL._gles=t},enumerable:!0,configurable:!0}),kL._gles=null,kL),ProgramGLES=(mL=GLESAssetBase,__extends(nL,mL),nL.prototype.upload=function(t,e){var i=0!=this._gl.getShaderPrecisionFormat(this._gl.VERTEX_SHADER,this._gl.HIGH_FLOAT).precision?"highp":"mediump",n=0!=this._gl.getShaderPrecisionFormat(this._gl.FRAGMENT_SHADER,this._gl.HIGH_FLOAT).precision?"highp":"mediump",r=nL._aglslParser.parse(nL._tokenizer.decribeAGALByteArray(t),i),o=nL._aglslParser.parse(nL._tokenizer.decribeAGALByteArray(e),n),s=new Byte32Array;s.writeInt(1),s.writeInt(OpCodes.uploadProgram),s.writeInt(this.id),s.writeUTFBytes(r),s.writeUTFBytes(o),s.bytePosition=0;var a=new Int32Array(s.byteLength/4);s.readInt32Array(a),GLESConnector.gles.sendGLESCommands(a.buffer)},nL.prototype.getUniformLocation=function(t,e){return null},nL.prototype.getAttribLocation=function(t){return 0},nL.prototype.dispose=function(){this._context._createBytes.writeInt(OpCodes.disposeProgram),this._context._createBytes.writeInt(this.id)},nL.prototype.focusProgram=function(){},Object.defineProperty(nL.prototype,"glProgram",{get:function(){return this._program},enumerable:!0,configurable:!0}),nL._tokenizer=new AGALTokenizer,nL._aglslParser=new AGLSLParser,nL._uniformLocationNameDictionary=["fc","fs","vc"],nL),TextureGLES=(DL=TextureBaseGLES,__extends(EL,DL),Object.defineProperty(EL.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(EL.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),Object.defineProperty(EL.prototype,"frameBuffer",{get:function(){return this._frameBuffer},enumerable:!0,configurable:!0}),EL.prototype.uploadFromArray=function(t,e,i){if(void 0===e&&(e=0),t.length!=this._width*this._height*4)throw new Error("Array is not the correct length for texture dimensions");t instanceof Array&&(t=new Uint8Array(t));var n=new Byte32Array;n.writeInt(1),n.writeInt(OpCodes.uploadBytesTexture|e<<8),n.writeInt(this.id),n.writeFloat(this._width),n.writeFloat(this._height),n.writeInt(t.buffer.byteLength),n.writeInt32Array(new Int32Array(t.buffer)),n.bytePosition=0;var r=new Int32Array(n.byteLength/4);n.readInt32Array(r),GLESConnector.gles.sendGLESCommands(r.buffer)},EL.prototype.uploadFromURL=function(t,e,i){void 0===e&&(e=0);var n=new Byte32Array;n.writeInt(1),n.writeInt(OpCodes.uploadTextureFromURL|e<<8),n.writeInt(this.id);var r=t.url.replace(/[^a-zA-Z0-9]/g,"");console.log("urlRequest.url "+r),n.writeUTFBytes(r),n.bytePosition=0;var o=new Int32Array(n.byteLength/4);n.readInt32Array(o),GLESConnector.gles.sendGLESCommands(o.buffer)},EL.prototype.uploadCompressedTextureFromArray=function(t,e,i){},EL),VertexBufferGLES=(ZL=GLESAssetBase,__extends($L,ZL),$L.prototype.uploadFromArray=function(t,e,i){},$L.prototype.uploadFromByteArray=function(t,e,i){var n=new Byte32Array;n.writeInt(1),n.writeInt(OpCodes.uploadArrayVertexBuffer),n.writeInt(this.id),n.writeInt(e),n.writeInt(t.byteLength),n.writeInt32Array(new Int32Array(t)),n.bytePosition=0;var r=new Int32Array(n.byteLength/4);n.readInt32Array(r),GLESConnector.gles.sendGLESCommands(r.buffer)},Object.defineProperty($L.prototype,"numVertices",{get:function(){return this._numVertices},enumerable:!0,configurable:!0}),Object.defineProperty($L.prototype,"dataPerVertex",{get:function(){return this._dataPerVertex},enumerable:!0,configurable:!0}),Object.defineProperty($L.prototype,"glBuffer",{get:function(){return this._buffer},enumerable:!0,configurable:!0}),$L.prototype.dispose=function(){this._context._createBytes.writeInt(OpCodes.disposeVertexBuffer),this._context._createBytes.writeInt(this.id)},$L),ContextGLES=(nM.startSound=function(t,e,i,n){nM._soundBytes.writeInt(OpCodes.startSound|(n?1:0)<<8),nM._soundBytes.writeFloat(i),nM._soundBytes.writeInt(e),nM._soundBytes.writeUTFBytes(t)},nM.stopSound=function(t){nM._soundBytes.writeInt(OpCodes.stopSound),nM._soundBytes.writeInt(t)},nM.updateSound=function(t,e,i){nM._soundBytes.writeInt(OpCodes.updateSound|(i?1:0)<<8),nM._soundBytes.writeFloat(e),nM._soundBytes.writeInt(t)},Object.defineProperty(nM.prototype,"container",{get:function(){return this._container},enumerable:!0,configurable:!0}),Object.defineProperty(nM.prototype,"standardDerivatives",{get:function(){return this._standardDerivatives},enumerable:!0,configurable:!0}),Object.defineProperty(nM.prototype,"glVersion",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(nM.prototype,"pixelRatio",{get:function(){return 1},enumerable:!0,configurable:!0}),nM.prototype.enableStencil=function(){this._cmdBytes.writeInt(OpCodes.enableStencil)},nM.prototype.disableStencil=function(){this._cmdBytes.writeInt(OpCodes.disableStencil)},nM.prototype.gl=function(){return this._gl},nM.prototype.clear=function(t,e,i,n,r,o,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=1),void 0===o&&(o=0),void 0===s&&(s=ContextGLClearMask.ALL),this._cmdBytes.writeInt(OpCodes.clear),this._cmdBytes.writeFloat(t),this._cmdBytes.writeFloat(e),this._cmdBytes.writeFloat(i),this._cmdBytes.writeFloat(n),this._cmdBytes.writeInt(r),this._cmdBytes.writeInt(o),this._cmdBytes.writeInt(s)},nM.prototype.configureBackBuffer=function(t,e,i,n){void 0===n&&(n=!0),this._width=t,this._height=e,this._cmdBytes.writeInt(OpCodes.configureBackBuffer|(n?1:0)<<8),this._cmdBytes.writeFloat(t),this._cmdBytes.writeFloat(e)},nM.prototype.createCubeTexture=function(t,e,i,n){return new CubeTextureGLES(this,this._gl,t,this._cubeTextureCnt++)},nM.prototype.createIndexBuffer=function(t){return new IndexBufferGLES(this,this._gl,t,this._indexBufferCnt++)},nM.prototype.createProgram=function(){return new ProgramGLES(this,this._gl,this._programCnt++)},nM.prototype.createTexture=function(t,e,i,n,r){return new TextureGLES(this,this._gl,t,e,this._textureCnt++)},nM.prototype.createVertexBuffer=function(t,e){return new VertexBufferGLES(this,this._gl,t,e,this._vertexBufferCnt++)},nM.prototype.dispose=function(){this._cmdBytes.writeInt(OpCodes.disposeContext),this.execute()},nM.prototype.drawToBitmapImage2D=function(t){},nM.prototype.drawIndices=function(t,e,i,n){},nM.prototype.drawVertices=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=-1),this._cmdBytes.writeInt(OpCodes.drawVertices|this._drawModeDictionary[t]<<8),this._cmdBytes.writeInt(e),this._cmdBytes.writeInt(i)},nM.prototype.present=function(){this.execute()},nM.prototype.setBlendFactors=function(t,e){this._blendEnabled=!0,this._blendSourceFactor=this._blendFactorDictionary[t],this._blendDestinationFactor=this._blendFactorDictionary[e],this.updateBlendStatus()},nM.prototype.setColorMask=function(t,e,i,n){this._cmdBytes.writeInt(OpCodes.setColorMask),this._cmdBytes.writeInt((t?1:0)|(e?1:0)<<8|(i?1:0)<<16|(n?1:0)<<24)},nM.prototype.setCulling=function(t,e){var i;void 0===e&&(e=CoordinateSystem.LEFT_HANDED),t!=ContextGLTriangleFace.NONE?(i=this.translateTriangleFace(t,e),this._cmdBytes.writeInt(OpCodes.setCulling|i<<8)):this._cmdBytes.writeInt(OpCodes.disableCulling)},nM.prototype.setDepthTest=function(t,e){this._cmdBytes.writeInt(OpCodes.setDepthTest|(t?1:0)<<8|this._compareModeDictionary[e]<<16)},nM.prototype.setStencilActionsMasks=function(t,e,i,n,r,o,s){void 0===n&&(n="keep"),void 0===r&&(r="keep"),void 0===o&&(o="keep");var a=this._compareModeDictionary[t],l=this._stencilActionDictionary[o],c=this._stencilActionDictionary[r],h=this._stencilActionDictionary[n];this._cmdBytes.writeInt(OpCodes.setStencilActionsMasks|a<<8),this._cmdBytes.writeInt(e),this._cmdBytes.writeInt(i|l<<8|c<<16|h<<24)},nM.prototype.setStencilActions=function(t,e,i,n,r,o){void 0===t&&(t=ContextGLTriangleFace.FRONT_AND_BACK),void 0===e&&(e=ContextGLCompareMode.ALWAYS),void 0===i&&(i=ContextGLStencilAction.KEEP),void 0===n&&(n=ContextGLStencilAction.KEEP),void 0===r&&(r=ContextGLStencilAction.KEEP),void 0===o&&(o=CoordinateSystem.LEFT_HANDED);var s=this._compareModeDictionary[e],a=this.stencilTriangleFace[t],l=this._stencilActionDictionary[r],c=this._stencilActionDictionary[n],h=this._stencilActionDictionary[i];this._cmdBytes.writeInt(OpCodes.setStencilActions|a<<8),this._cmdBytes.writeInt(s|l<<8|c<<16|h<<24)},nM.prototype.setStencilReferenceValue=function(t,e,i){void 0===e&&(e=255),void 0===i&&(i=255),this._cmdBytes.writeInt(OpCodes.setStencilReferenceValue),this._cmdBytes.writeInt(t),this._cmdBytes.writeInt(e),this._cmdBytes.writeInt(i)},nM.prototype.setProgram=function(t){this._cmdBytes.writeInt(OpCodes.setProgram),this._cmdBytes.writeInt(t.id)},nM.prototype.setProgramConstantsFromArray=function(t,e){this._cmdBytes.writeInt(OpCodes.setProgramConstant|t<<8),this._cmdBytes.writeInt(e.length),this._cmdBytes.writeFloat32Array(e)},nM.prototype.setScissorRectangle=function(t){t?(this._cmdBytes.writeInt(OpCodes.setScissorRect),this._cmdBytes.writeFloat(t.x),this._cmdBytes.writeFloat(t.y),this._cmdBytes.writeFloat(t.width),this._cmdBytes.writeFloat(t.height)):this._cmdBytes.writeInt(OpCodes.clearScissorRect)},nM.prototype.setTextureAt=function(t,e){e?(this._cmdBytes.writeInt(OpCodes.setTextureAt|t<<8),this._cmdBytes.writeInt(e.id)):this._cmdBytes.writeInt(OpCodes.clearTextureAt|t<<8)},nM.prototype.setSamplerStateAt=function(t,e,i,n){this._cmdBytes.writeInt(OpCodes.setSamplerStateAt|t<<8),this._cmdBytes.writeInt(this._wrapDictionary[e]|this._filterDictionary[i]<<8|this._mipmapFilterDictionary[i][n]<<16)},nM.prototype.setVertexBufferAt=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=4),e?(this._cmdBytes.writeInt(OpCodes.setVertexBufferAt|t<<8|n<<16|e.dataPerVertex<<24),this._cmdBytes.writeInt(e.id),this._cmdBytes.writeInt(i)):this._cmdBytes.writeInt(OpCodes.clearVertexBufferAt|t<<8)},nM.prototype.setRenderToTexture=function(t,e,i,n,r){void 0===e&&(e=!1),null==t?this._cmdBytes.writeInt(OpCodes.clearRenderToTexture):(this._cmdBytes.writeInt(OpCodes.setRenderToTexture|(e?1:0)<<8),this._cmdBytes.writeInt(t.id))},nM.prototype.setRenderToBackBuffer=function(){this._cmdBytes.writeInt(OpCodes.clearRenderToTexture)},nM.prototype.copyToTexture=function(t,e,i){},nM.prototype.updateBlendStatus=function(){this._blendEnabled?this._cmdBytes.writeInt(OpCodes.setBlendFactors|this._blendSourceFactor<<8|this._blendDestinationFactor<<16):this._cmdBytes.writeUnsignedInt(OpCodes.disableBlending)},nM.prototype.translateTriangleFace=function(t,e){switch(t){case ContextGLTriangleFace.BACK:return e==CoordinateSystem.LEFT_HANDED?2:1;case ContextGLTriangleFace.FRONT:return e==CoordinateSystem.LEFT_HANDED?1:2;case ContextGLTriangleFace.FRONT_AND_BACK:return 0;default:throw"Unknown ContextGLTriangleFace type."}},nM.prototype.execute=function(){var t,e,i;4>0&3)]),2&h&&(l[1+s]=c[a+(n.swizzle>>2&3)]),4&h&&(l[2+s]=c[a+(n.swizzle>>4&3)]),8&h&&(l[3+s]=c[a+(n.swizzle>>6&3)])},wP.m44=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask;1&p&&(c[s]=h[a]*u[l]+h[1+a]*u[1+l]+h[2+a]*u[2+l]+u[3+l]),2&p&&(c[1+s]=h[a]*u[4+l]+h[1+a]*u[5+l]+h[2+a]*u[6+l]+u[7+l]),4&p&&(c[2+s]=h[a]*u[8+l]+h[1+a]*u[9+l]+h[2+a]*u[10+l]+u[11+l]),8&p&&(c[3+s]=h[a]*u[12+l]+h[1+a]*u[13+l]+h[2+a]*u[14+l]+u[15+l])},wP.sample=function(t,e,i,n,r){var o=i._textures[r];if(o.isTexture(TextureSoftware))return wP.sampleSimpleTexture(t,e,i,n,r);if(o.isTexture(CubeTextureSoftware))return wP.sampleCubeTexture(t,e,i,n,r);throw new ArgumentError("Cannot sample provided texture type")},wP.sampleCubeTexture=function(t,e,i,n,r){var o=4*n.regnum,s=wP.getSourceTarget(t,e,n,i),a=s[o+(n.swizzle>>0&3)],l=s[o+(n.swizzle>>2&3)],c=s[o+(n.swizzle>>4&3)],h=0,u=0,p=0,d=Math.abs(a),_=Math.abs(l),f=Math.abs(c),m=Math.max(d,_,f);m==d?p=0<=a?(h=0,u=.5-c/a*.5,.5-l/a*.5):(h=1,u=.5-c/a*.5,.5+l/a*.5):m==_?(u=0<=l?(h=2,.5+a/l*.5):(h=3,.5-a/l*.5),p=.5+c/l*.5):m==f&&(p=0<=c?(h=4,u=.5+a/c*.5,.5-l/c*.5):(h=5,u=.5+a/c*.5,.5+l/c*.5));var g=i._textures[r],y=i._samplerStates[r]||this._defaultSamplerState,b=y.wrap==ContextGLWrapMode.REPEAT;return y.mipfilter,ContextGLMipFilter.MIPLINEAR,y.filter==ContextGLTextureFilter.LINEAR?wP.sampleBilinear(u,p,g.getData(h),g.size,g.size,b,wP._colorValue0):wP.sampleNearest(u,p,g.getData(h),g.size,g.size,b,wP._colorValue0)},wP.sampleSimpleTexture=function(t,e,i,n,r){var o=4*n.regnum,s=wP.getSourceTarget(t,e,n,i),a=s[o+(n.swizzle>>0&3)],l=s[o+(n.swizzle>>2&3)];if(r>=i._textures.length||null==i._textures[r])throw new ArgumentError("textureIndex contains no texture");var c=i._textures[r],h=i._samplerStates[r]||this._defaultSamplerState,u=h.wrap==ContextGLWrapMode.REPEAT;if(h.mipfilter==ContextGLMipFilter.MIPLINEAR&&1>0&3)]),d=Math.abs(t.derivativeX[o+(n.swizzle>>2&3)]),_=Math.abs(t.derivativeY[o+(n.swizzle>>0&3)]),f=Math.abs(t.derivativeY[o+(n.swizzle>>2&3)]),m=Math.log(Math.max(c.width*Math.sqrt(p*p+d*d),c.height*Math.sqrt(_*_+f*f)))/Math.LN2;if(0>0&3)]+u[l+(_>>0&3)]),2&p&&(c[1+s]=h[a+(d>>2&3)]+u[l+(_>>2&3)]),4&p&&(c[2+s]=h[a+(d>>4&3)]+u[l+(_>>4&3)]),8&p&&(c[3+s]=h[a+(d>>6&3)]+u[l+(_>>6&3)])},wP.sub=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask,d=n.swizzle,_=r.swizzle;1&p&&(c[s]=h[a+(d>>0&3)]-u[l+(_>>0&3)]),2&p&&(c[1+s]=h[a+(d>>2&3)]-u[l+(_>>2&3)]),4&p&&(c[2+s]=h[a+(d>>4&3)]-u[l+(_>>4&3)]),8&p&&(c[3+s]=h[a+(d>>6&3)]-u[l+(_>>6&3)])},wP.mul=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask,d=n.swizzle,_=r.swizzle;1&p&&(c[s]=h[a+(d>>0&3)]*u[l+(_>>0&3)]),2&p&&(c[1+s]=h[a+(d>>2&3)]*u[l+(_>>2&3)]),4&p&&(c[2+s]=h[a+(d>>4&3)]*u[l+(_>>4&3)]),8&p&&(c[3+s]=h[a+(d>>6&3)]*u[l+(_>>6&3)])},wP.div=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask,d=n.swizzle,_=r.swizzle;1&p&&(c[s]=h[a+(d>>0&3)]/u[l+(_>>0&3)]),2&p&&(c[1+s]=h[a+(d>>2&3)]/u[l+(_>>2&3)]),4&p&&(c[2+s]=h[a+(d>>4&3)]/u[l+(_>>4&3)]),8&p&&(c[3+s]=h[a+(d>>6&3)]/u[l+(_>>6&3)])},wP.rcp=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=1/c[a+(u>>0&3)]),2&h&&(l[1+s]=1/c[a+(u>>2&3)]),4&h&&(l[2+s]=1/c[a+(u>>4&3)]),8&h&&(l[3+s]=1/c[a+(u>>6&3)])},wP.min=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask,d=n.swizzle,_=r.swizzle;1&p&&(c[s]=Math.min(h[a+(d>>0&3)],u[l+(_>>0&3)])),2&p&&(c[1+s]=Math.min(h[a+(d>>2&3)],u[l+(_>>2&3)])),4&p&&(c[2+s]=Math.min(h[a+(d>>4&3)],u[l+(_>>4&3)])),8&p&&(c[3+s]=Math.min(h[a+(d>>6&3)],u[l+(_>>6&3)]))},wP.max=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask,d=n.swizzle,_=r.swizzle;1&p&&(c[s]=Math.max(h[a+(d>>0&3)],u[l+(_>>0&3)])),2&p&&(c[1+s]=Math.max(h[a+(d>>2&3)],u[l+(_>>2&3)])),4&p&&(c[2+s]=Math.max(h[a+(d>>4&3)],u[l+(_>>4&3)])),8&p&&(c[3+s]=Math.max(h[a+(d>>6&3)],u[l+(_>>6&3)]))},wP.frc=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=c[a+(u>>0&3)]-Math.floor(c[a+(u>>0&3)])),2&h&&(l[1+s]=c[a+(u>>2&3)]-Math.floor(c[a+(u>>2&3)])),4&h&&(l[2+s]=c[a+(u>>4&3)]-Math.floor(c[a+(u>>4&3)])),8&h&&(l[3+s]=c[a+(u>>6&3)]-Math.floor(c[a+(u>>6&3)]))},wP.sqt=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.sqrt(c[a+(u>>0&3)])),2&h&&(l[1+s]=Math.sqrt(c[a+(u>>2&3)])),4&h&&(l[2+s]=Math.sqrt(c[a+(u>>4&3)])),8&h&&(l[3+s]=Math.sqrt(c[a+(u>>6&3)]))},wP.rsq=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=1/Math.sqrt(c[a+(u>>0&3)])),2&h&&(l[1+s]=1/Math.sqrt(c[a+(u>>2&3)])),4&h&&(l[2+s]=1/Math.sqrt(c[a+(u>>4&3)])),8&h&&(l[3+s]=1/Math.sqrt(c[a+(u>>6&3)]))},wP.pow=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask,d=n.swizzle,_=r.swizzle;1&p&&(c[s]=Math.pow(h[a+(d>>0&3)],u[l+(_>>0&3)])),2&p&&(c[1+s]=Math.pow(h[a+(d>>2&3)],u[l+(_>>2&3)])),4&p&&(c[2+s]=Math.pow(h[a+(d>>4&3)],u[l+(_>>4&3)])),8&p&&(c[3+s]=Math.pow(h[a+(d>>6&3)],u[l+(_>>6&3)]))},wP.log=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.log(c[a+(u>>0&3)])/Math.LN2),2&h&&(l[1+s]=Math.log(c[a+(u>>2&3)])/Math.LN2),4&h&&(l[2+s]=Math.log(c[a+(u>>4&3)])/Math.LN2),8&h&&(l[3+s]=Math.log(c[a+(u>>6&3)])/Math.LN2)},wP.exp=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.exp(c[a+(u>>0&3)])),2&h&&(l[1+s]=Math.exp(c[a+(u>>2&3)])),4&h&&(l[2+s]=Math.exp(c[a+(u>>4&3)])),8&h&&(l[3+s]=Math.exp(c[a+(u>>6&3)]))},wP.nrm=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle,p=c[a+(u>>0&3)],d=c[a+(u>>2&3)],_=c[a+(u>>4&3)],f=Math.sqrt(p*p+d*d+_*_);p/=f,d/=f,_/=f,1&h&&(l[s]=p),2&h&&(l[1+s]=d),4&h&&(l[2+s]=_)},wP.sin=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.sin(c[a+(u>>0&3)])),2&h&&(l[1+s]=Math.sin(c[a+(u>>2&3)])),4&h&&(l[2+s]=Math.sin(c[a+(u>>4&3)])),8&h&&(l[3+s]=Math.sin(c[a+(u>>6&3)]))},wP.cos=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.cos(c[a+(u>>0&3)])),2&h&&(l[1+s]=Math.cos(c[a+(u>>2&3)])),4&h&&(l[2+s]=Math.cos(c[a+(u>>4&3)])),8&h&&(l[3+s]=Math.cos(c[a+(u>>6&3)]))},wP.crs=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=i.mask,u=n.swizzle,p=r.swizzle,d=wP.getSourceTarget(t,e,n,o),_=d[a+(u>>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=wP.getSourceTarget(t,e,r,o),y=g[l+(p>>0&3)],b=g[l+(p>>2&3)],v=g[l+(p>>4&3)];1&h&&(c[s]=f*v-m*b),2&h&&(c[1+s]=m*y-_*v),4&h&&(c[2+s]=_*b-f*y)},wP.dp3=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=i.mask,u=n.swizzle,p=r.swizzle,d=wP.getSourceTarget(t,e,n,o),_=d[a+(u>>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=wP.getSourceTarget(t,e,r,o),y=g[l+(p>>0&3)],b=g[l+(p>>2&3)],v=g[l+(p>>4&3)];1&h&&(c[s]=_*y+f*b+m*v),2&h&&(c[1+s]=_*y+f*b+m*v),4&h&&(c[2+s]=_*y+f*b+m*v),8&h&&(c[3+s]=_*y+f*b+m*v)},wP.dp4=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=i.mask,u=n.swizzle,p=r.swizzle,d=wP.getSourceTarget(t,e,n,o),_=d[a+(u>>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=d[a+(u>>6&3)],y=wP.getSourceTarget(t,e,r,o),b=y[l+(p>>0&3)],v=y[l+(p>>2&3)],x=y[l+(p>>4&3)],A=y[l+(p>>6&3)];1&h&&(c[s]=_*b+f*v+m*x+g*A),2&h&&(c[1+s]=_*b+f*v+m*x+g*A),4&h&&(c[2+s]=_*b+f*v+m*x+g*A),8&h&&(c[3+s]=_*b+f*v+m*x+g*A)},wP.abs=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.abs(c[a+(u>>0&3)])),2&h&&(l[1+s]=Math.abs(c[a+(u>>2&3)])),4&h&&(l[2+s]=Math.abs(c[a+(u>>4&3)])),8&h&&(l[3+s]=Math.abs(c[a+(u>>6&3)]))},wP.neg=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=-c[a+(u>>0&3)]),2&h&&(l[1+s]=-c[a+(u>>2&3)]),4&h&&(l[2+s]=-c[a+(u>>4&3)]),8&h&&(l[3+s]=-c[a+(u>>6&3)])},wP.sat=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=wP.getSourceTarget(t,e,n,o),h=i.mask,u=n.swizzle;1&h&&(l[s]=Math.max(0,Math.min(1,c[a+(u>>0&3)]))),2&h&&(l[1+s]=Math.max(0,Math.min(1,c[a+(u>>2&3)]))),4&h&&(l[2+s]=Math.max(0,Math.min(1,c[a+(u>>4&3)]))),8&h&&(l[3+s]=Math.max(0,Math.min(1,c[a+(u>>6&3)])))},wP.m33=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask;1&p&&(c[s]=h[a]*u[l]+h[1+a]*u[1+l]+h[2+a]*u[2+l]),2&p&&(c[1+s]=h[a]*u[4+l]+h[1+a]*u[5+l]+h[2+a]*u[6+l]),4&p&&(c[2+s]=h[a]*u[8+l]+h[1+a]*u[9+l]+h[2+a]*u[10+l])},wP.m34=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=wP.getSourceTarget(t,e,n,o),u=wP.getSourceTarget(t,e,r,o),p=i.mask;1&p&&(c[s]=h[a]*u[l]+h[1+a]*u[1+l]+h[2+a]*u[2+l]+u[3+l]),2&p&&(c[1+s]=h[a]*u[4+l]+h[1+a]*u[5+l]+h[2+a]*u[6+l]+u[7+l]),4&p&&(c[2+s]=h[a]*u[8+l]+h[1+a]*u[9+l]+h[2+a]*u[10+l]+u[11+l])},wP.ddx=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=t.derivativeX,h=i.mask,u=n.swizzle;1&h&&(l[s]=c[a+(u>>0&3)]),2&h&&(l[1+s]=c[a+(u>>2&3)]),4&h&&(l[2+s]=c[a+(u>>4&3)]),8&h&&(l[3+s]=c[a+(u>>6&3)])},wP.ddy=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=t.derivativeY,h=i.mask,u=n.swizzle;1&h&&(l[s]=c[a+(u>>0&3)]),2&h&&(l[1+s]=c[a+(u>>2&3)]),4&h&&(l[2+s]=c[a+(u>>4&3)]),8&h&&(l[3+s]=c[a+(u>>6&3)])},wP.sge=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=i.mask,u=n.swizzle,p=r.swizzle,d=wP.getSourceTarget(t,e,n,o),_=d[a+(u>>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=d[a+(u>>6&3)],y=wP.getSourceTarget(t,e,r,o),b=y[l+(p>>0&3)],v=y[l+(p>>2&3)],x=y[l+(p>>4&3)],A=y[l+(p>>6&3)];1&h&&(c[s]=b<=_?1:0),2&h&&(c[1+s]=v<=f?1:0),4&h&&(c[2+s]=x<=m?1:0),8&h&&(c[3+s]=A<=g?1:0)},wP.slt=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*r.regnum,c=wP.getDestTarget(t,e,i),h=i.mask,u=n.swizzle,p=r.swizzle,d=wP.getSourceTarget(t,e,n,o),_=d[a+(u>>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=d[a+(u>>6&3)],y=wP.getSourceTarget(t,e,r,o),b=y[l+(p>>0&3)],v=y[l+(p>>2&3)],x=y[l+(p>>4&3)],A=y[l+(p>>6&3)];1&h&&(c[s]=_>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=d[a+(u>>6&3)],y=wP.getSourceTarget(t,e,r,o),b=y[l+(p>>0&3)],v=y[l+(p>>2&3)],x=y[l+(p>>4&3)],A=y[l+(p>>6&3)];1&h&&(c[s]=_==b?1:0),2&h&&(c[1+s]=f==v?1:0),4&h&&(c[2+s]=m==x?1:0),8&h&&(c[3+s]=g==A?1:0)},wP.sne=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=4*n.regnum,c=wP.getDestTarget(t,e,i),h=i.mask,u=n.swizzle,p=r.swizzle,d=wP.getSourceTarget(t,e,n,o),_=d[a+(u>>0&3)],f=d[a+(u>>2&3)],m=d[a+(u>>4&3)],g=d[a+(u>>6&3)],y=wP.getSourceTarget(t,e,r,o),b=y[l+(p>>0&3)],v=y[l+(p>>2&3)],x=y[l+(p>>4&3)],A=y[l+(p>>6&3)];1&h&&(c[s]=_!=b?1:0),2&h&&(c[1+s]=f!=v?1:0),4&h&&(c[2+s]=m!=x?1:0),8&h&&(c[3+s]=g!=A?1:0)},wP.sgn=function(t,e,i,n,r,o){var s=4*i.regnum,a=4*n.regnum,l=wP.getDestTarget(t,e,i),c=i.mask,h=n.swizzle,u=wP.getSourceTarget(t,e,n,o),p=u[a+(h>>0&3)],d=u[a+(h>>2&3)],_=u[a+(h>>4&3)],f=u[a+(h>>6&3)];1&c&&(l[s]=p<0?-1:0>0&3)]<0&&(t.discard=!0)},wP._defaultSamplerState=new SoftwareSamplerState,wP._tokenizer=new AGALTokenizer,wP._opCodeFunc=[wP.mov,wP.add,wP.sub,wP.mul,wP.div,wP.rcp,wP.min,wP.max,wP.frc,wP.sqt,wP.rsq,wP.pow,wP.log,wP.exp,wP.nrm,wP.sin,wP.cos,wP.crs,wP.dp3,wP.dp4,wP.abs,wP.neg,wP.sat,wP.m33,wP.m44,wP.m34,null,null,null,null,null,null,null,null,null,null,null,null,null,wP.kil,wP.tex,wP.sge,wP.slt,wP.sgn,wP.seq,wP.sne],wP._colorValue0=new Float32Array(4),wP._colorValue1=new Float32Array(4),wP._colorInterpolated0=new Float32Array(4),wP._colorInterpolated1=new Float32Array(4),wP),BlendModeSoftware=(n_.destinationAlpha=function(t,e,i,n){t[0]=e[0]*i[3]/255,t[1]=e[1]*i[3]/255,t[2]=e[2]*i[3]/255,t[3]=e[3]*i[3]/255},n_.destinationColor=function(t,e,i,n){t[0]=e[0]*i[0]/255,t[1]=e[1]*i[1]/255,t[2]=e[2]*i[2]/255,t[3]=e[3]*i[3]/255},n_.one=function(t,e,i,n){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]},n_.oneMinusDestinationAlpha=function(t,e,i,n){t[0]=e[0]*(1-i[3]/255),t[1]=e[1]*(1-i[3]/255),t[2]=e[2]*(1-i[3]/255),t[3]=e[3]*(1-i[3]/255)},n_.oneMinusDestinationColor=function(t,e,i,n){t[0]=e[0]*(1-i[0]/255),t[1]=e[1]*(1-i[1]/255),t[2]=e[2]*(1-i[2]/255),t[3]=e[3]*(1-i[3]/255)},n_.oneMinusSourceAlpha=function(t,e,i,n){t[0]=e[0]*(1-n[3]/255),t[1]=e[1]*(1-n[3]/255),t[2]=e[2]*(1-n[3]/255),t[3]=e[3]*(1-n[3]/255)},n_.oneMinusSourceColor=function(t,e,i,n){t[0]=e[0]*(1-n[0]/255),t[1]=e[1]*(1-n[1]/255),t[2]=e[2]*(1-n[2]/255),t[3]=e[3]*(1-n[3]/255)},n_.sourceAlpha=function(t,e,i,n){t[0]=e[0]*n[3]/255,t[1]=e[1]*n[3]/255,t[2]=e[2]*n[3]/255,t[3]=e[3]*n[3]/255},n_.sourceColor=function(t,e,i,n){t[0]=e[0]*n[0]/255,t[1]=e[1]*n[1]/255,t[2]=e[2]*n[2]/255,t[3]=e[3]*n[3]/255},n_.zero=function(t,e,i,n){},n_),DepthCompareModeSoftware=(a0.always=function(t,e){return!0},a0.equal=function(t,e){return t==e},a0.greater=function(t,e){return e>>r,s=t.height>>>r;t._mipmapSelector=r,t._frameBuffer[r]?this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,t._frameBuffer[r]):this.initFrameBuffer(t,i,r),e?(this._gl.enable(this._gl.STENCIL_TEST),this._gl.enable(this._gl.DEPTH_TEST)):(this._gl.disable(this._gl.STENCIL_TEST),this._gl.disable(this._gl.DEPTH_TEST)),this._gl.viewport(0,0,o,s)},V4.prototype.initFrameBuffer=function(t,e,i){var n,r,o,s=t._width>>>i,a=t._height>>>i,l=t._frameBuffer[i]=this._gl.createFramebuffer(),c=t._renderBufferDepth[i]=this._gl.createRenderbuffer();t._mipmapSelector=i,this._gl.bindTexture(this._gl.TEXTURE_2D,t._glTexture),this._gl instanceof WebGLRenderingContext||!ContextWebGLFlags.PREF_MULTISAMPLE||e<1?(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,l),this._gl.bindRenderbuffer(this._gl.RENDERBUFFER,c),this._gl.renderbufferStorage(this._gl.RENDERBUFFER,this._gl.DEPTH_STENCIL,t._width,t._height),this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER,this._gl.COLOR_ATTACHMENT0,this._gl.TEXTURE_2D,t._glTexture,0),this._gl.framebufferRenderbuffer(this._gl.FRAMEBUFFER,this._gl.DEPTH_STENCIL_ATTACHMENT,this._gl.RENDERBUFFER,c),t._multisampled=!1):(n=t._frameBufferDraw[i]=this._gl.createFramebuffer(),r=Math.log(Math.min(t._width,t._height))/Math.LN2|1,this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,n),t._texStorageFlag||(this._gl.texStorage2D(this._gl.TEXTURE_2D,r,this._gl.RGBA8,s,a),t._texStorageFlag=!0),this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER,this._gl.COLOR_ATTACHMENT0,this._gl.TEXTURE_2D,t._glTexture,t._mipmapSelector),this._gl.bindTexture(this._gl.TEXTURE_2D,null),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,l),this._gl.bindRenderbuffer(this._gl.RENDERBUFFER,c),this._gl.renderbufferStorageMultisample(this._gl.RENDERBUFFER,e,this._gl.DEPTH24_STENCIL8,s,a),this._gl.framebufferRenderbuffer(this._gl.FRAMEBUFFER,this._gl.DEPTH_STENCIL_ATTACHMENT,this._gl.RENDERBUFFER,c),o=t._renderBuffer[i]=this._gl.createRenderbuffer(),this._gl.bindRenderbuffer(this._gl.RENDERBUFFER,o),this._gl.renderbufferStorageMultisample(this._gl.RENDERBUFFER,e,this._gl.RGBA8,s,a),this._gl.framebufferRenderbuffer(this._gl.FRAMEBUFFER,this._gl.COLOR_ATTACHMENT0,this._gl.RENDERBUFFER,o),t._multisampled=!0),this._gl.bindRenderbuffer(this._gl.RENDERBUFFER,null)},V4.prototype.presentFrameBuffer=function(t){var e,i;this._gl instanceof WebGLRenderingContext||!t._multisampled||(e=t._width>>>t._mipmapSelector,i=t._height>>>t._mipmapSelector,t._frameBuffer[t._mipmapSelector]!==t._frameBufferDraw[t._mipmapSelector]?(this._gl.bindFramebuffer(this._gl.READ_FRAMEBUFFER,t._frameBuffer[t._mipmapSelector]),this._gl.bindFramebuffer(this._gl.DRAW_FRAMEBUFFER,t._frameBufferDraw[t._mipmapSelector]),this._gl.clearBufferfv(this._gl.COLOR,0,[0,0,0,0]),this._gl.blitFramebuffer(0,0,e,i,0,0,e,i,this._gl.COLOR_BUFFER_BIT,this._gl.NEAREST)):console.error("Framebuffer loop `presentFrameBuffer`"))},V4.prototype.presentFrameBufferTo=function(t,e,i,n){var r=e.textureFramebuffer;r||(this.initFrameBuffer(e,0,0),this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,null),r=e.textureFramebuffer),t._frameBuffer[0]!==r?(!t||!t._multisampled||this._gl instanceof WebGLRenderingContext?(this._gl.bindFramebuffer(this._gl.FRAMEBUFFER,t._frameBuffer[0]),this.unsafeCopyToTexture(e,i,n)):r&&(this._gl.bindFramebuffer(this._gl.READ_FRAMEBUFFER,t._frameBuffer[0]),this._gl.bindFramebuffer(this._gl.DRAW_FRAMEBUFFER,r),this._gl.blitFramebuffer(0|i.x,0|i.y,i.width+i.x|0,i.height+i.y|0,0|n.x,0|n.y,n.x+i.width|0,n.y+i.height|0,this._gl.COLOR_BUFFER_BIT,this._gl.NEAREST)),this.blitTextureToRenderbuffer(e),this.restoreRenderTarget()):console.error("Framebuffer loop `presentFrameBufferTo`")},V4.prototype.blitTextureToRenderbuffer=function(t){var e,i;t._multisampled&&this._gl instanceof WebGL2RenderingContext&&(t._frameBuffer[t._mipmapSelector]!==t._frameBufferDraw[t._mipmapSelector]?(e=t._width>>>t._mipmapSelector,i=t._height>>>t._mipmapSelector,this._gl.bindFramebuffer(this._gl.DRAW_FRAMEBUFFER,t._frameBuffer[t._mipmapSelector]),this._gl.bindFramebuffer(this._gl.READ_FRAMEBUFFER,t._frameBufferDraw[t._mipmapSelector]),this._gl.clearBufferfv(this._gl.COLOR,0,[0,0,0,0]),this._gl.blitFramebuffer(0,0,e,i,0,0,e,i,this._gl.COLOR_BUFFER_BIT,this._gl.NEAREST)):console.error("Framebuffer loop `blitTextureToRenderbuffer`"))},V4.prototype.disposeTexture=function(e){var i=this;this._renderTarget!==e?(this._gl.deleteTexture(e._glTexture),Object.keys(e._frameBuffer).forEach(function(t){return i._gl.deleteFramebuffer(e._frameBuffer[t])}),Object.keys(e._frameBufferDraw).forEach(function(t){return i._gl.deleteFramebuffer(e._frameBufferDraw[t])}),Object.keys(e._renderBuffer).forEach(function(t){return i._gl.deleteRenderbuffer(e._renderBuffer[t])}),Object.keys(e._renderBufferDepth).forEach(function(t){return i._gl.deleteRenderbuffer(e._renderBufferDepth[t])})):console.error("[Context] Trying to dispose a active tendertarget!")},V4.prototype.updateBlendStatus=function(){this._blendEnabled?(this._gl.enable(this._gl.BLEND),this._gl.blendEquation(this._gl.FUNC_ADD),this._gl.blendFunc(this._blendSourceFactor,this._blendDestinationFactor)):this._gl.disable(this._gl.BLEND)},V4.prototype.translateTriangleFace=function(t,e){switch(t){case ContextGLTriangleFace.BACK:return e==CoordinateSystem.LEFT_HANDED?this._gl.FRONT:this._gl.BACK;case ContextGLTriangleFace.FRONT:return e==CoordinateSystem.LEFT_HANDED?this._gl.BACK:this._gl.FRONT;case ContextGLTriangleFace.FRONT_AND_BACK:return this._gl.FRONT_AND_BACK;default:throw"Unknown ContextGLTriangleFace type."}},V4.MAX_SAMPLERS=8,V4.modulo=0,V4),VertexBufferProperties=function(t,e,i){this.size=t,this.type=e,this.normalized=i},ShaderRegisterElement=(I7.prototype.toString=function(){return this._toStr},Object.defineProperty(I7.prototype,"regName",{get:function(){return this._regName},enumerable:!0,configurable:!0}),Object.defineProperty(I7.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),I7.COMPONENTS=["x","y","z","w"],I7),RegisterPool=(M7.prototype.requestFreeVectorReg=function(){for(var t=0;t\nmul "+t+", "+t+", "+e+".xyzw\nadd "+t+", "+t+", "+i+".xyzw\nmov oc, "+t+"\n"},N8.prototype.getMainInputTexture=function(t){return this._mainInputTexture},N8.prototype.activate=function(t,e,i){var n=this._positionIndex,r=this._vertexConstantData,o=this.destPoint,s=this.rect,a=this._target,l=this._mainInputTexture;r[n+0]=(2*o.x+s.width)/a.width-1,r[n+1]=(2*o.y+s.height)/a.height-1,r[n+2]=s.width/a.width,r[n+3]=s.height/a.height,r[n+4]=2*s.x/l.width,r[n+5]=2*s.y/l.height,r[n+6]=s.width/l.width,r[n+7]=s.height/l.height;var c=EMPTY_TRANSFORM;if(this.transform){(c=this._fragConstantData).set(this.transform._rawData);for(var h=0;h<4;h++)c[h+4]/=255}var u=t.context;u.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,r),u.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,c)},N8.prototype.deactivate=function(t){},N8),Filter3DBase=(Object.defineProperty(l9.prototype,"requireDepthRender",{get:function(){return this._requireDepthRender},enumerable:!0,configurable:!0}),l9.prototype.addTask=function(t){this._tasks.push(t),null==this._requireDepthRender&&(this._requireDepthRender=t.requireDepthRender)},Object.defineProperty(l9.prototype,"tasks",{get:function(){return this._tasks},enumerable:!0,configurable:!0}),l9.prototype.getMainInputTexture=function(t){return this._tasks[0].getMainInputTexture(t)},Object.defineProperty(l9.prototype,"textureWidth",{get:function(){return this._textureWidth},set:function(t){this._textureWidth=t;for(var e=0;e>16&255)/255,this._thresholdRGBA.y=(t>>8&255)/255,this._thresholdRGBA.z=(255&t)/255,this._thresholdRGBA.w=(t>>24&255)/255)},enumerable:!0,configurable:!0}),Object.defineProperty(J9.prototype,"color",{get:function(){return this._color},set:function(t){var e;this._color!=t&&(e=((this._color=t)>>24&255)/255,this._colorRGBA.x=e*(t>>16&255)/255,this._colorRGBA.y=e*(t>>8&255)/255,this._colorRGBA.z=e*(255&t)/255,this._colorRGBA.w=e)},enumerable:!0,configurable:!0}),Object.defineProperty(J9.prototype,"mask",{get:function(){return this._mask},set:function(t){this._mask!=t&&(this._mask=t,this._maskRGBA.x=(t>>16&255)/255,this._maskRGBA.y=(t>>8&255)/255,this._maskRGBA.z=(255&t)/255,this._maskRGBA.w=(t>>24&255)/255)},enumerable:!0,configurable:!0}),Object.defineProperty(J9.prototype,"copySource",{get:function(){return this._copySource},set:function(t){this._copySource!=t&&(this._copySource=t,this.invalidateProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(J9.prototype,"sourceTexture",{get:function(){return this._mainInputTexture},set:function(t){this._mainInputTexture=t},enumerable:!0,configurable:!0}),J9.prototype.getVertexCode=function(){var t=this._registerCache.getFreeVertexVectorTemp(),e=this._registerCache.getFreeVertexConstant(),i=this._registerCache.getFreeVertexAttribute();this._positionIndex=i.index;var n=this._registerCache.getFreeVertexConstant(),r=this._registerCache.getFreeVertexAttribute();return this._uvIndex=r.index,this._uvVarying=this._registerCache.getFreeVarying(),"mul "+t+".xy, "+i+", "+e+".zw\nadd "+t+".xy, "+t+", "+e+".xy\nmov "+t+".w, "+i+".w\nmov op, "+t+"\nadd "+this._uvVarying+", "+r+", "+n+".xy\n"},J9.prototype.getFragmentCode=function(){var t=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(t,1);var e=this._registerCache.getFreeTextureReg();this._inputTextureIndex=e.index;var i=this._registerCache.getFreeFragmentConstant();this._fragmentConstantsIndex=i.index;var n,r,o,s=this._registerCache.getFreeFragmentConstant(),a=this._registerCache.getFreeFragmentConstant(),l=this._registerCache.getFreeFragmentConstant();return this._copySource?(r=this._registerCache.getFreeFragmentVectorTemp(),this._registerCache.addFragmentTempUsages(r,1),o=this._registerCache.getFreeFragmentVectorTemp(),this._registerCache.addFragmentTempUsages(o,1),n="tex "+t+", "+this._uvVarying+", "+e+" <2d,linear,clamp>\nmul "+r+", "+t+", "+a+"\ndp4 "+r+", "+r+", "+l+"\n"+this._op+r+", "+(this._th?i:r)+", "+(this._th?r:i)+"\nsub "+o+", "+l+".zzzz, "+r+"\nmul "+r+", "+r+", "+s+"\nmul "+o+", "+o+", "+t+"\nadd "+t+", "+r+", "+o+"\nmov oc, "+t+"\n",this._registerCache.removeFragmentTempUsage(o),this._registerCache.removeFragmentTempUsage(r)):n="tex "+t+", "+this._uvVarying+", "+e+" <2d,linear,clamp>\nmul "+t+", "+t+", "+a+"\ndp4 "+t+", "+t+", "+l+"\n"+this._op+t+", "+(this._th?i:t)+", "+(this._th?t:i)+"\nmul "+t+", "+t+", "+s+"\nmov oc, "+t+"\n",this._registerCache.removeFragmentTempUsage(t),n},J9.prototype.getMainInputTexture=function(t){return this._mainInputTexture},J9.prototype.activate=function(t,e,i){var n=this._positionIndex,r=this._vertexConstantData;r[n]=(2*this.destPoint.x+this.rect.width)/this._target.width-1,r[n+1]=(2*this.destPoint.y+this.rect.height)/this._target.height-1,r[n+2]=this.rect.width/this._target.width,r[n+3]=this.rect.height/this._target.height,r[n+4]=this.rect.x/this._mainInputTexture.width,r[n+5]=this.rect.y/this._mainInputTexture.height;var o=new Vector3D(this._thresholdRGBA.x*this._maskRGBA.x,this._thresholdRGBA.y*this._maskRGBA.y,this._thresholdRGBA.z*this._maskRGBA.z,this._thresholdRGBA.w*this._maskRGBA.w).dotProduct(this._decodeVector),n=this._fragmentConstantsIndex;(r=this._fragmentConstantData)[n]=o,r[n+1]=o,r[n+2]=o,r[n+3]=o,r[n+4]=this._colorRGBA.x,r[n+5]=this._colorRGBA.y,r[n+6]=this._colorRGBA.z,r[n+7]=this._colorRGBA.w,r[n+8]=this._maskRGBA.x,r[n+9]=this._maskRGBA.y,r[n+10]=this._maskRGBA.z,r[n+11]=this._maskRGBA.w;var s=t.context;s.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,this._vertexConstantData),s.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,this._fragmentConstantData)},J9.prototype.deactivate=function(t){},J9),ThresholdFilter3D=(naa=Filter3DBase,__extends(oaa,naa),Object.defineProperty(oaa.prototype,"rect",{get:function(){return this._thresholdTask.rect},set:function(t){this._thresholdTask.rect=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"destPoint",{get:function(){return this._thresholdTask.destPoint},set:function(t){this._thresholdTask.destPoint=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"operation",{get:function(){return this._thresholdTask.operation},set:function(t){this._thresholdTask.operation=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"threshold",{get:function(){return this._thresholdTask.threshold},set:function(t){this._thresholdTask.threshold=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"color",{get:function(){return this._thresholdTask.color},set:function(t){this._thresholdTask.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"mask",{get:function(){return this._thresholdTask.mask},set:function(t){this._thresholdTask.mask=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"copySource",{get:function(){return this._thresholdTask.copySource},set:function(t){this._thresholdTask.copySource=t},enumerable:!0,configurable:!0}),Object.defineProperty(oaa.prototype,"sourceTexture",{get:function(){return this._thresholdTask.sourceTexture},set:function(t){this._thresholdTask.sourceTexture=t},enumerable:!0,configurable:!0}),oaa),Stage=(yaa=EventDispatcher,__extends(zaa,yaa),Object.defineProperty(zaa.prototype,"glVersion",{get:function(){return this._context.glVersion},enumerable:!0,configurable:!0}),zaa.prototype.getProgramData=function(t,e){return this._programDataPool.getItem(t,e)},zaa.prototype.setRenderTarget=function(t,e,i,n){var r;void 0===e&&(e=!1),void 0===i&&(i=0),void 0===n&&(n=0),this._renderTarget===t&&i==this._renderSurfaceSelector&&n==this._renderMipmapSelector&&this._enableDepthAndStencil==e||(this._renderTarget=t,this._renderSurfaceSelector=i,this._renderMipmapSelector=n,this._enableDepthAndStencil=e,t?(r=this.getAbstraction(t),this._context.setRenderToTexture(r.getTexture(),e,this._antiAlias,i,n),0!=n&&1!=this._context.glVersion&&(r._invalidMipmaps=!1,r._mipmap=!0)):(this._context.setRenderToBackBuffer(),this.configureBackBuffer(this._width,this._height,this._antiAlias,this._enableDepthAndStencil)))},zaa.prototype.renderFilter=function(t,e){this._filterVertexBuffer||(this._filterVertexBuffer=this._context.createVertexBuffer(4,20)).uploadFromArray(new Float32Array([-1,-1,0,0,0,1,-1,1,0,1,1,1,1,1,2,-1,1,0,1,3]),0,4),this._filterIndexBuffer||(this._filterIndexBuffer=this._context.createIndexBuffer(6)).uploadFromArray(new Uint16Array([2,1,0,3,2,0]),0,6),this._filterSampler||(this._filterSampler=new ImageSampler(!1,!1,!1)),e.setRenderTargets(t,this);var i=this._filterIndexBuffer,n=this._filterVertexBuffer,r=e.tasks,o=r.length;(1e.width||n.y<-i.height||n.y>e.height||(s?(this._copyPixelFilter||(this._copyPixelFilter=new CopyPixelFilter3D),this._copyPixelFilter.sourceTexture=t,this._copyPixelFilter.rect=i,this._copyPixelFilter.destPoint=n,this.renderFilter(e,this._copyPixelFilter)):(i=i.clone(),(n=n.clone()).x<0&&(i.x-=n.x,i.width+=n.x,n.x=0),n.y<0&&(i.y-=n.y,i.height+=n.y,n.y=0),i.width>e.width-n.x&&(i.width=e.width-n.x),i.height>e.height-n.y&&(i.height=e.height-n.y),this.setRenderTarget(t,!1),this.setScissor(null),a=this.getAbstraction(e),this._context.copyToTexture(a.getTexture(),i,n)))},zaa.prototype.threshold=function(t,e,i,n,r,o,s,a,l){n.x<-i.width||n.x>e.width||n.y<-i.height||n.y>e.height||(this._thresholdFilter||(this._thresholdFilter=new ThresholdFilter3D),this._thresholdFilter.sourceTexture=t,this._thresholdFilter.rect=i,this._thresholdFilter.destPoint=n,this._thresholdFilter.operation=r,this._thresholdFilter.threshold=o,this._thresholdFilter.color=s,this._thresholdFilter.mask=a,this._thresholdFilter.copySource=l,this.renderFilter(e,this._thresholdFilter))},zaa.prototype.colorTransform=function(t,e,i,n){this._copyPixelFilter||(this._copyPixelFilter=new CopyPixelFilter3D),this._copyPixelFilter.sourceTexture=t,this._copyPixelFilter.rect=i,this._copyPixelFilter.destPoint=new Point(0,0),this._copyPixelFilter.colorTransform=n,this.renderFilter(e,this._copyPixelFilter),this._copyPixelFilter.colorTransform=null},zaa.prototype.getAbstraction=function(t){return this._abstractionPool[t.id]||(this._abstractionPool[t.id]=new zaa._abstractionClassPool[t.assetType](t,this))},zaa.prototype.clearAbstraction=function(t){delete this._abstractionPool[t.id]},zaa.registerAbstraction=function(t,e){zaa._abstractionClassPool[e.assetType]=t},zaa.prototype.requestContext=function(t,e,i,n){void 0===t&&(t=!1),void 0===e&&(e=ContextGLProfile.BASELINE),void 0===i&&(i=ContextMode.AUTO),void 0===n&&(n=!1),null!=this._usesSoftwareRendering&&(this._usesSoftwareRendering=t),this._profile=e;try{i==ContextMode.SOFTWARE?this._context=new ContextSoftware(this._container):i==ContextMode.GLES?this._context=new ContextGLES(this._container):this._context=new ContextWebGL(this._container,n)}catch(t){this.dispatchEvent(new StageEvent(StageEvent.STAGE_ERROR,this))}this._context&&this._callback(this._context)},Object.defineProperty(zaa.prototype,"width",{get:function(){return this._sizeDirty=!1,this._width},set:function(t){this._width!=t&&(this._container.style.width=t+"px",this._container.width=t*this._context.pixelRatio,this._width=t,this._backBufferDirty=!0,this._invalidateSize())},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"height",{get:function(){return this._sizeDirty=!1,this._height},set:function(t){this._height!=t&&(this._container.style.height=t+"px",this._container.height=t*this._context.pixelRatio,this._height=t,this._backBufferDirty=!0,this._invalidateSize())},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"x",{get:function(){return this._x},set:function(t){this._x!=t&&(CSS.setElementX(this._container,t),this._x=t)},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"y",{get:function(){return this._y},set:function(t){this._y!=t&&(CSS.setElementY(this._container,t),this._y=t)},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"visible",{get:function(){return CSS.getElementVisibility(this._container)},set:function(t){CSS.setElementVisibility(this._container,t)},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"container",{get:function(){return this._container},set:function(t){this._container=t,this._context&&(this._context.container=this._container)},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),zaa.prototype._invalidateSize=function(){this._sizeDirty||(this._sizeDirty=!0,this.dispatchEvent(new StageEvent(StageEvent.INVALIDATE_SIZE,this)))},Object.defineProperty(zaa.prototype,"profile",{get:function(){return this._profile},enumerable:!0,configurable:!0}),zaa.prototype.dispose=function(){for(var t in this._abstractionPool)this._abstractionPool[t].clear&&this._abstractionPool[t].clear();this._abstractionPool={},this._stageManager.iRemoveStage(this),this.freeContext(),this._stageManager=null,this._stageIndex=-1},zaa.prototype.configureBackBuffer=function(t,e,i,n){this.width=t,this.height=e,this._antiAlias=i,this._enableDepthAndStencil=n,this._context&&this._context.configureBackBuffer(t,e,i,n)},Object.defineProperty(zaa.prototype,"enableDepthAndStencil",{get:function(){return this._enableDepthAndStencil},set:function(t){this._enableDepthAndStencil!=t&&(this._enableDepthAndStencil=t,this._backBufferDirty=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"renderSurfaceSelector",{get:function(){return this._renderSurfaceSelector},enumerable:!0,configurable:!0}),zaa.prototype.clear=function(t,e,i,n,r,o,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=1),void 0===o&&(o=0),void 0===s&&(s=ContextGLClearMask.ALL),this._context&&(this._backBufferDirty&&null==this._renderTarget&&(this._backBufferDirty=!1,this.configureBackBuffer(this._width,this._height,this._antiAlias,this._enableDepthAndStencil)),this._context.clear(t,e,i,n,r,o,s),this._bufferClear=!0)},Object.defineProperty(zaa.prototype,"stageIndex",{get:function(){return this._stageIndex},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"usesSoftwareRendering",{get:function(){return this._usesSoftwareRendering},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"antiAlias",{get:function(){return this._antiAlias},set:function(t){this._antiAlias!=t&&(this._antiAlias=t,this._backBufferDirty=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(zaa.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t},enumerable:!0,configurable:!0}),zaa.prototype.registerProgram=function(t){for(var e=0;null!=this._programData[e];)e++;(this._programData[e]=t).id=e},zaa.prototype.unRegisterProgram=function(t){this._programData[t.id]=null,t.id=-1},zaa.prototype.freeContext=function(){this._context&&(this._context.dispose(),this.dispatchEvent(new StageEvent(StageEvent.CONTEXT_DISPOSED,this))),this._context=null,this._initialised=!1},zaa.prototype.onContextLost=function(t){},zaa.prototype.onContextRestored=function(t){},zaa.prototype.recoverFromDisposal=function(){return!!this._context},zaa.prototype._callback=function(t){this._context=t,this._container=this._context.container,this._width&&this._height&&this._context.configureBackBuffer(this._width,this._height,this._antiAlias,this._enableDepthAndStencil),this.dispatchEvent(new StageEvent(this._initialised?StageEvent.CONTEXT_RECREATED:StageEvent.CONTEXT_CREATED,this)),this._initialised=!0},zaa.prototype.setVertexBuffer=function(t,e,i,n,r,o){void 0===o&&(o=!1),this._context.setVertexBufferAt(t,e,r,this._bufferFormatDictionary[o?i+4:i][n])},zaa.prototype.setScissor=function(t){this._backBufferDirty&&null==this._renderTarget&&(this._backBufferDirty=!1,this.configureBackBuffer(this._width,this._height,this._antiAlias,this._enableDepthAndStencil)),this._context.setScissorRectangle(t)},zaa.prototype.setSamplerAt=function(t,e){var i=e.repeat?ContextGLWrapMode.REPEAT:ContextGLWrapMode.CLAMP,n=e.smooth&&!this.globalDisableSmooth?ContextGLTextureFilter.LINEAR:ContextGLTextureFilter.NEAREST,r=e.mipmap&&!this.globalDisableMipmap?ContextGLMipFilter.MIPLINEAR:ContextGLMipFilter.MIPNONE;this._context.setSamplerStateAt(t,i,n,r)},zaa._abstractionClassPool=new Object,zaa),ImageCube=(jca=ImageBase,__extends(kca,jca),Object.defineProperty(kca.prototype,"assetType",{get:function(){return kca.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(kca.prototype,"size",{get:function(){return this._size},set:function(t){this._size!=t&&this._setSize(this._size)},enumerable:!0,configurable:!0}),kca.prototype._setSize=function(t){this._size!=t&&this.clear(),this._size=t,this._testDimensions()},kca.prototype._testDimensions=function(){if(!ImageUtils.isDimensionValid(this._size))throw new Error("Invalid dimension: Width and height must be power of 2 and cannot exceed 2048")},kca.assetType="[image ImageCube]",kca),_Stage_ImageCube=(pca=_Stage_ImageBase,__extends(qca,pca),qca.prototype.getType=function(){return"cube"},qca.prototype._createTexture=function(){this._texture=this._stage.context.createCubeTexture(this._asset.size,ContextGLTextureFormat.BGRA,!1)},qca),pca,jca,yaa,naa,I9,B9,M8,p4,A3,jO,ZL,DL,mL,ZK,LK,FK,qK,nK,iK,dK,$J;function qca(){return null!==pca&&pca.apply(this,arguments)||this}function kca(t){var e=jca.call(this)||this;return e._size=t,e._testDimensions(),e}function zaa(t,e,i,n,r){void 0===r&&(r=ContextGLProfile.BASELINE);var o=yaa.call(this)||this;return o._abstractionPool=new Object,o._programData=new Array,o._x=0,o._y=0,o._stageIndex=-1,o._antiAlias=4,o._renderTarget=null,o._renderSurfaceSelector=0,o._renderMipmapSelector=0,o._initialised=!1,o._bufferFormatDictionary=new Array(5),o.globalDisableMipmap=!1,o.globalDisableSmooth=!1,o.numUsedStreams=0,o.numUsedTextures=0,o._programDataPool=new ProgramDataPool(o),o._container=t,o._container&&(o._container.addEventListener("webglcontextlost",function(t){return o.onContextLost(t)}),o._container.addEventListener("webglcontextrestored",function(t){return o.onContextRestored(t)})),o._stageIndex=e,o._stageManager=i,o._enableDepthAndStencil=!0,CSS.setElementX(o._container,0),CSS.setElementY(o._container,0),o._bufferFormatDictionary[1]=new Array(5),o._bufferFormatDictionary[1][1]=ContextGLVertexBufferFormat.BYTE_1,o._bufferFormatDictionary[1][2]=ContextGLVertexBufferFormat.BYTE_2,o._bufferFormatDictionary[1][3]=ContextGLVertexBufferFormat.BYTE_3,o._bufferFormatDictionary[1][4]=ContextGLVertexBufferFormat.BYTE_4,o._bufferFormatDictionary[2]=new Array(5),o._bufferFormatDictionary[2][1]=ContextGLVertexBufferFormat.SHORT_1,o._bufferFormatDictionary[2][2]=ContextGLVertexBufferFormat.SHORT_2,o._bufferFormatDictionary[2][3]=ContextGLVertexBufferFormat.SHORT_3,o._bufferFormatDictionary[2][4]=ContextGLVertexBufferFormat.SHORT_4,o._bufferFormatDictionary[4]=new Array(5),o._bufferFormatDictionary[4][1]=ContextGLVertexBufferFormat.FLOAT_1,o._bufferFormatDictionary[4][2]=ContextGLVertexBufferFormat.FLOAT_2,o._bufferFormatDictionary[4][3]=ContextGLVertexBufferFormat.FLOAT_3,o._bufferFormatDictionary[4][4]=ContextGLVertexBufferFormat.FLOAT_4,o._bufferFormatDictionary[5]=new Array(5),o._bufferFormatDictionary[5][1]=ContextGLVertexBufferFormat.UNSIGNED_BYTE_1,o._bufferFormatDictionary[5][2]=ContextGLVertexBufferFormat.UNSIGNED_BYTE_2,o._bufferFormatDictionary[5][3]=ContextGLVertexBufferFormat.UNSIGNED_BYTE_3,o._bufferFormatDictionary[5][4]=ContextGLVertexBufferFormat.UNSIGNED_BYTE_4,o._bufferFormatDictionary[6]=new Array(5),o._bufferFormatDictionary[6][1]=ContextGLVertexBufferFormat.UNSIGNED_SHORT_1,o._bufferFormatDictionary[6][2]=ContextGLVertexBufferFormat.UNSIGNED_SHORT_2,o._bufferFormatDictionary[6][3]=ContextGLVertexBufferFormat.UNSIGNED_SHORT_3,o._bufferFormatDictionary[6][4]=ContextGLVertexBufferFormat.UNSIGNED_SHORT_4,o.visible=!0,o}function oaa(){var t=naa.call(this)||this;return t._thresholdTask=new Filter3DThresholdTask,t.addTask(t._thresholdTask),t}function J9(){var t=I9.call(this)||this;return t._opDecode={"<":"slt ","<=":"sge ",">":"slt ",">=":"sge ","==":"seq ","!=":"sne "},t._thDecode={"<":!1,"<=":!0,">":!0,">=":!1,"==":!1,"!=":!1},t._operation="<",t._threshold=0,t._thresholdRGBA=new Vector3D,t._color=0,t._colorRGBA=new Vector3D,t._mask=0,t._maskRGBA=new Vector3D,t._copySource=!1,t._decodeVector=new Vector3D(65025,255,1,16581375),t.rect=new Rectangle,t.destPoint=new Point,t._vertexConstantData=new Float32Array([0,0,0,0,0,0,0,0]),t._fragmentConstantData=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,65025,255,1,16581375]),t}function C9(){var t=B9.call(this)||this;return t._copyPixelTask=new Filter3DCopyPixelTask,t.addTask(t._copyPixelTask),t}function l9(){this._textureScale=1,this._tasks=new Array}function N8(){var t=M8.call(this)||this;return t.rect=new Rectangle,t.destPoint=new Point,t._vertexConstantData=new Float32Array([0,0,0,0,0,0,0,0]),t._fragConstantData=EMPTY_TRANSFORM.slice(),t}function t8(t){void 0===t&&(t=!1),this._scaledTextureWidth=-1,this._scaledTextureHeight=-1,this._textureWidth=-1,this._textureHeight=-1,this._textureDimensionsInvalid=!0,this._program3DInvalid=!0,this._textureScale=1,this._requireDepthRender=t,this._registerCache=new ShaderRegisterCache(ContextGLProfile.BASELINE)}function l8(t){this._numUsedVertexConstants=0,this._numUsedFragmentConstants=0,this._numUsedStreams=0,this._numUsedTextures=0,this._numUsedVaryings=0,this._profile=t,this.reset()}function M7(t,e,i){void 0===i&&(i=!0),this._regName=t,this._regCount=e,this._persistent=i,this.initRegisters(t,e)}function I7(t,e,i){void 0===i&&(i=-1),this._component=i,this._regName=t,this._index=e,this._toStr=this._regName,0<=this._index&&(this._toStr+=this._index),-1this.MAX_SIZE&&(e=this.MAX_SIZE),e},Pfa.getDefaultImage2D=function(){return this._defaultBitmapImage2D||this.createDefaultImage2D(),this._defaultBitmapImage2D},Pfa.getDefaultImageCube=function(){return this._defaultBitmapImageCube||this.createDefaultImageCube(),this._defaultBitmapImageCube},Pfa.getDefaultSampler=function(){return this._defaultSampler||this.createDefaultSampler(),this._defaultSampler},Pfa.createDefaultImageCube=function(){this._defaultBitmapImage2D||this.createDefaultImage2D();for(var t=new BitmapImageCube(this._defaultBitmapImage2D.width),e=0;e<6;e++)t.drawBitmap(e,this._defaultBitmapImage2D.data,0,0,this._defaultBitmapImage2D.width,this._defaultBitmapImage2D.height);this._defaultBitmapImageCube=t},Pfa.createDefaultImage2D=function(){for(var t,e=new BitmapImage2D(8,8,!1,0),i=0;i<8;i++)for(t=0;t<8;t++)1&t^1&i&&e.setPixel(i,t,16777215);this._defaultBitmapImage2D=e},Pfa.createDefaultSampler=function(){this._defaultSampler=new ImageSampler},Pfa.MAX_SIZE=8192,Pfa),Image2D=(gga=ImageBase,__extends(hga,gga),Object.defineProperty(hga.prototype,"assetType",{get:function(){return hga.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(hga.prototype,"height",{get:function(){return this._rect.height},set:function(t){this._setSize(this._rect.width,t)},enumerable:!0,configurable:!0}),Object.defineProperty(hga.prototype,"alphaChannel",{get:function(){return this._alphaChannel},set:function(t){this._alphaChannel=t},enumerable:!0,configurable:!0}),Object.defineProperty(hga.prototype,"rect",{get:function(){return this._rect},enumerable:!0,configurable:!0}),Object.defineProperty(hga.prototype,"width",{get:function(){return this._rect.width},set:function(t){this._setSize(t,this._rect.height)},enumerable:!0,configurable:!0}),hga.prototype._setSize=function(t,e){t=Math.round(t),e=Math.round(e),this._rect.width==t&&this._rect.height==e||(this.clear(),this._rect.width=t,this._rect.height=e,this._testDimensions())},hga.prototype._testDimensions=function(){if(this._powerOfTwo&&(!ImageUtils.isDimensionValid(this._rect.width)||!ImageUtils.isDimensionValid(this._rect.height)))throw new Error("Invalid dimension: Width and height must be power of 2 and cannot exceed 2048")},Object.defineProperty(hga.prototype,"powerOfTwo",{get:function(){return this._powerOfTwo},set:function(t){this._powerOfTwo!=t&&(this._powerOfTwo=t,this._testDimensions())},enumerable:!0,configurable:!0}),hga.assetType="[image Image2D]",hga),_Stage_Image2D=(sga=_Stage_ImageBase,__extends(tga,sga),tga.prototype.getType=function(){return"2d"},tga.prototype._createTexture=function(){this._texture=this._stage.context.createTexture(this._asset.width,this._asset.height,ContextGLTextureFormat.BGRA,!0)},tga),sga,gga;function tga(){return null!==sga&&sga.apply(this,arguments)||this}function hga(t,e,i){void 0===i&&(i=!0);var n=gga.call(this)||this;return n._powerOfTwo=!0,n._rect=new Rectangle(0,0,Math.round(t),Math.round(e)),n._powerOfTwo=i,n._testDimensions(),n}function Pfa(){}function Jfa(){}function fastARGB_to_ABGR(t,e){return void 0===e&&(e=!0),((e?4278190080&t:4278190080)|(255&t)<<16|65280&t|(16711680&t)>>16&255)>>>0}Stage.registerAbstraction(_Stage_Image2D,Image2D);var BitmapImage2D=(wga=Image2D,__extends(xga,wga),xga.prototype.addMipLevel=function(t){this._customMipLevels||(this._customMipLevels=[]),this._customMipLevels.push(t)},Object.defineProperty(xga.prototype,"mipLevels",{get:function(){return this._customMipLevels},enumerable:!0,configurable:!0}),Object.defineProperty(xga.prototype,"assetType",{get:function(){return xga.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(xga.prototype,"transparent",{get:function(){return this._transparent},set:function(t){this._transparent=t},enumerable:!0,configurable:!0}),xga.prototype.clone=function(){var t=new xga(this._rect.width,this._rect.height,this._transparent,null,this._powerOfTwo);return t.setPixels(this._rect,this.data),t},xga.prototype.colorTransform=function(t,e){for(var i,n,r=this.data,o=0;o>>0)===e&&i||d!==e&&!i)&&(c=!0,o=p>>0,m=0,g=0;for(s[g++]=t,s[g++]=e;0>>0:0},xga.prototype.getPixelData=function(t,e,i){var n=4*(t+e*this._rect.width),r=this._data;i[0]=r[n++],i[1]=r[n++],i[2]=r[n++],i[3]=r[n]},xga.prototype.setPixelData=function(t,e,i){var n=4*(t+e*this._rect.width),r=this.data;r[0+n]=i[0],r[1+n]=i[1],r[2+n]=i[2],r[3+n]=this._transparent?i[3]:255,this._locked||this.invalidate()},xga.prototype.lock=function(){this._locked||(this._locked=!0)},xga.prototype.setArray=function(t,e){for(var i,n,r,o=this.data,s=0;s\nmul "+e+", "+this._uvVarying+", "+l+".zw\nadd "+e+", "+e+", "+l+".xy\ntex "+e+", "+e+", "+o+" <2d,linear,clamp>\nmul "+e+", "+e+", "+s+".xxx\nadd "+e+", "+e+", "+s+".xxx\n",this._blendMode){case"multiply":a+="mul oc, "+t+", "+e+"\n";break;case"add":a+="add oc, "+t+", "+e+"\n";break;case"subtract":a+="sub oc, "+t+", "+e+"\n";break;case"overlay":a+="sge "+i+", "+t+", "+s+".yyy\n",a+="sub "+t+", "+i+", "+t+"\n",a+="sub "+e+", "+e+", "+i+"\n",a+="mul "+e+", "+e+", "+t+"\n",a+="sub "+n+", "+i+", "+s+".yyy\n",a+="div "+e+", "+e+", "+n+"\n",a+="add oc, "+e+", "+i+"\n";break;case"normal":a+="mov oc, "+t+"\n";break;default:throw new Error("Unknown blend mode")}return a},Vja.prototype.activate=function(t,e,i){this._data[4]=-.5*(this._textureWidth-this._overlayWidth)/this._overlayWidth,this._data[5]=-.5*(this._textureHeight-this._overlayHeight)/this._overlayHeight,this._data[6]=this._textureWidth/this._overlayWidth,this._data[7]=this._textureHeight/this._overlayHeight,t.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,this._data),t.getAbstraction(this._overlayTexture).activate(this._overlayTextureIndex)},Vja.prototype.deactivate=function(t){t.context.setTextureAt(1,null)},Vja),Filter3DFXAATask=(mka=Filter3DTaskBase,__extends(nka,mka),Object.defineProperty(nka.prototype,"amount",{get:function(){return this._amount},set:function(t){this._amount!=t&&(this._amount=t,this.invalidateProgram(),this.updateBlurData())},enumerable:!0,configurable:!0}),Object.defineProperty(nka.prototype,"stepSize",{get:function(){return this._stepSize},set:function(t){this._stepSize!=t&&(this._stepSize=t,this.calculateStepSize(),this.invalidateProgram(),this.updateBlurData())},enumerable:!0,configurable:!0}),nka.prototype.getFragmentCode=function(){var t="fc0",e="ft0.xy",i="ft0.x",n="ft0.y",r="ft2.x",o="ft2.y",s="ft2.z",a="ft2.w",l="ft3.y",c="ft3.z",h="ft1",u="ft4.x",p=new Array;return p.push("tex",h,"v0","fs0","<2d wrap linear>","\n"),p.push("dp3","ft3.x",h,t,"\n"),p.push("mov",e,"v0","\n"),p.push("sub",e,e,"fc2.xy","\n"),p.push("tex",h,e,"fs0","<2d wrap linear>","\n"),p.push("dp3",r,h,t,"\n"),p.push("mov",e,"v0","\n"),p.push("add",e,e,"fc2.xy","\n"),p.push("tex",h,e,"fs0","<2d wrap linear>","\n"),p.push("dp3",a,h,t,"\n"),p.push("mov",e,"v0","\n"),p.push("sub",n,n,"fc2.y","\n"),p.push("add",i,i,"fc2.x","\n"),p.push("tex",h,e,"fs0","<2d wrap linear>","\n"),p.push("dp3",o,h,t,"\n"),p.push("mov",e,"v0","\n"),p.push("add",n,n,"fc2.y","\n"),p.push("sub",i,i,"fc2.x","\n"),p.push("tex",h,e,"fs0","<2d wrap linear>","\n"),p.push("dp3",s,h,t,"\n"),p.push("add",l,r,o,"\n"),p.push("add",c,s,a,"\n"),p.push("sub",u,l,c,"\n"),p.push("neg",u,u,"\n"),p.push("add",l,r,s,"\n"),p.push("add",c,o,a,"\n"),p.push("sub","ft4.y",l,c,"\n"),p.push("add",l,l,c,"\n"),p.push("mul",l,l,"fc3.y","\n"),p.push("mul",l,l,"fc1.x","\n"),p.push("max","ft5.x",l,"fc3.x","\n"),p.push("abs",l,u,"\n"),p.push("abs",c,"ft4.y","\n"),p.push("min",l,l,c,"\n"),p.push("add",l,l,"ft5.x","\n"),p.push("rcp","ft5.y",l,"\n"),p.push("mul",l,u,"ft5.y","\n"),p.push("mov",c,"fc3.z","\n"),p.push("neg",c,c,"\n"),p.push("max",l,l,c,"\n"),p.push("min",l,"fc3.z",l,"\n"),p.push("mul",u,l,"fc2.x","\n"),p.push("mul",l,"ft4.y","ft5.y","\n"),p.push("mov",c,"fc3.z","\n"),p.push("neg",c,c,"\n"),p.push("max",l,l,c,"\n"),p.push("min",l,"fc3.z",l,"\n"),p.push("mul","ft4.y",l,"fc2.y","\n"),p.push("mul","ft1.xy","ft4.xy","fc4.x","\n"),p.push("add",e,"v0","ft1.xy","\n"),p.push("tex","ft6",e,"fs0","<2d wrap linear>","\n"),p.push("mul","ft1.xy","ft4.xy","fc4.y","\n"),p.push("add",e,"v0","ft1.xy","\n"),p.push("tex",h,e,"fs0","<2d wrap linear>","\n"),p.push("add","ft6","ft6",h,"\n"),p.push("mul","ft6","ft6","fc1.y","\n"),p.push("mul","ft1.xy","ft4.xy","fc4.z","\n"),p.push("add",e,"v0","ft1.xy","\n"),p.push("tex","ft7",e,"fs0","<2d wrap linear>","\n"),p.push("mul","ft1.xy","ft4.xy","fc4.w","\n"),p.push("add",e,"v0","ft1.xy","\n"),p.push("tex",h,e,"fs0","<2d wrap linear>","\n"),p.push("add","ft7","ft7",h,"\n"),p.push("mul","ft7","ft7","fc1.x","\n"),p.push("mul",h,"ft6","fc1.y","\n"),p.push("add","ft7","ft7",h,"\n"),p.push("min",l,s,a,"\n"),p.push("min",c,r,o,"\n"),p.push("min",l,l,c,"\n"),p.push("min","ft5.x",l,"ft3.x","\n"),p.push("max",l,s,a,"\n"),p.push("max",c,r,o,"\n"),p.push("max",l,l,c,"\n"),p.push("max","ft5.y",l,"ft3.x","\n"),p.push("dp3",l,t,"ft7","\n"),p.push("slt",c,l,"ft5.x","\n"),p.push("sge","ft3.w",l,"ft5.y","\n"),p.push("mul",c,c,"ft3.w","\n"),p.push("mul","ft6","ft6",c,"\n"),p.push("sub",c,"fc1.w",c,"\n"),p.push("mul","ft7","ft7",c,"\n"),p.push("add","oc","ft6","ft7","\n"),p.join(" ")},nka.prototype.activate=function(t,e,i){t.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,this._data)},nka.prototype.updateTextures=function(t){mka.prototype.updateTextures.call(this,t),this.updateBlurData()},nka.prototype.updateBlurData=function(){this._rttManager&&(this._data[8]=1/this._textureWidth,this._data[9]=1/this._textureHeight)},nka.prototype.calculateStepSize=function(){this._realStepSize=1},nka.MAX_AUTO_SAMPLES=15,nka),Filter3DHBlurTask=(Nka=Filter3DTaskBase,__extends(Oka,Nka),Object.defineProperty(Oka.prototype,"amount",{get:function(){return this._amount},set:function(t){this._amount!=t&&(this._amount=t,this.invalidateProgram(),this.updateBlurData(),this.calculateStepSize())},enumerable:!0,configurable:!0}),Object.defineProperty(Oka.prototype,"stepSize",{get:function(){return this._stepSize},set:function(t){this._stepSize!=t&&(this._stepSize=t,this.calculateStepSize(),this.invalidateProgram(),this.updateBlurData())},enumerable:!0,configurable:!0}),Oka.prototype.getFragmentCode=function(){var t=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(t,1);var e=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(e,1);var i=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(i,1);var n=this._registerCache.getFreeTextureReg();this._inputTextureIndex=n.index;var r=this._registerCache.getFreeFragmentConstant();this._blurIndex=4*r.index;var o=1,s="mov "+t+", "+this._uvVarying+"\nsub "+t+".x, "+this._uvVarying+".x, "+r+".x\n";s+="tex "+e+", "+t+", "+n+" <2d,linear,clamp>\n";for(var a=this._realStepSize;a<=this._amount;a+=this._realStepSize)s+="add "+t+".x, "+t+".x, "+r+".y\ntex "+i+", "+t+", "+n+" <2d,linear,clamp>\nadd "+e+", "+e+", "+i+"\n",++o;return s+="mul oc, "+e+", "+r+".z\n",this._data[2]=1/o,s},Oka.prototype.activate=function(t,e,i){t.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,this._data)},Oka.prototype.updateTextures=function(t){Nka.prototype.updateTextures.call(this,t),this.updateBlurData()},Oka.prototype.updateBlurData=function(){var t=1/this._textureWidth;this._data[0]=.5*this._amount*t,this._data[1]=this._realStepSize*t},Oka.prototype.calculateStepSize=function(){this._realStepSize=0Oka.MAX_AUTO_SAMPLES?this._amount/Oka.MAX_AUTO_SAMPLES:1},Oka.MAX_AUTO_SAMPLES=15,Oka),Filter3DVBlurTask=(fla=Filter3DTaskBase,__extends(gla,fla),Object.defineProperty(gla.prototype,"amount",{get:function(){return this._amount},set:function(t){this._amount!=t&&(this._amount=t,this.invalidateProgram(),this.updateBlurData())},enumerable:!0,configurable:!0}),Object.defineProperty(gla.prototype,"stepSize",{get:function(){return this._stepSize},set:function(t){this._stepSize!=t&&(this._stepSize=t,this.calculateStepSize(),this.invalidateProgram(),this.updateBlurData())},enumerable:!0,configurable:!0}),gla.prototype.getFragmentCode=function(){var t=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(t,1);var e=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(e,1);var i=this._registerCache.getFreeFragmentVectorTemp();this._registerCache.addFragmentTempUsages(i,1);var n=this._registerCache.getFreeTextureReg();this._inputTextureIndex=n.index;var r=this._registerCache.getFreeFragmentConstant();this._blurIndex=4*r.index;var o=1,s="mov "+t+", "+this._uvVarying+"\nsub "+t+".y, "+this._uvVarying+".y, "+r+".x\n";s+="tex "+e+", "+t+", "+n+" <2d,linear,clamp>\n";for(var a=this._realStepSize;a<=this._amount;a+=this._realStepSize)s+="add "+t+".y, "+t+".y, "+r+".y\n",s+="tex "+i+", "+t+", "+n+" <2d,linear,clamp>\nadd "+e+", "+e+", "+i+"\n",++o;return s+="mul oc, "+e+", "+r+".z\n",this._data[2]=1/o,s},gla.prototype.activate=function(t,e,i){t.context.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,this._data)},gla.prototype.updateTextures=function(t){fla.prototype.updateTextures.call(this,t),this.updateBlurData()},gla.prototype.updateBlurData=function(){var t=1/this._textureHeight;this._data[0]=.5*this._amount*t,this._data[1]=this._realStepSize*t},gla.prototype.calculateStepSize=function(){this._realStepSize=0gla.MAX_AUTO_SAMPLES?this._amount/gla.MAX_AUTO_SAMPLES:1},gla.MAX_AUTO_SAMPLES=15,gla),BlurFilter3D=(zla=Filter3DBase,__extends(Ala,zla),Object.defineProperty(Ala.prototype,"blurX",{get:function(){return this._hBlurTask.amount},set:function(t){this._hBlurTask.amount=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ala.prototype,"blurY",{get:function(){return this._vBlurTask.amount},set:function(t){this._vBlurTask.amount=t},enumerable:!0,configurable:!0}),Object.defineProperty(Ala.prototype,"stepSize",{get:function(){return this._hBlurTask.stepSize},set:function(t){this._hBlurTask.stepSize=t,this._vBlurTask.stepSize=t},enumerable:!0,configurable:!0}),Ala.prototype.setRenderTargets=function(t,e){this._hBlurTask.target=this._vBlurTask.getMainInputTexture(e),zla.prototype.setRenderTargets.call(this,t,e)},Ala),CompositeFilter3D=(Kla=Filter3DBase,__extends(Lla,Kla),Object.defineProperty(Lla.prototype,"exposure",{get:function(){return this._compositeTask.exposure},set:function(t){this._compositeTask.exposure=t},enumerable:!0,configurable:!0}),Object.defineProperty(Lla.prototype,"overlayTexture",{get:function(){return this._compositeTask.overlayTexture},set:function(t){this._compositeTask.overlayTexture=t},enumerable:!0,configurable:!0}),Lla),FXAAFilter3D=(Rla=Filter3DBase,__extends(Sla,Rla),Object.defineProperty(Sla.prototype,"amount",{get:function(){return this._fxaaTask.amount},set:function(t){this._fxaaTask.amount=t},enumerable:!0,configurable:!0}),Object.defineProperty(Sla.prototype,"stepSize",{get:function(){return this._fxaaTask.stepSize},set:function(t){this._fxaaTask.stepSize=t},enumerable:!0,configurable:!0}),Sla),StageManager=(Yla=EventDispatcher,__extends(Zla,Yla),Zla.getInstance=function(){return null==this._instance&&(this._instance=new Zla),this._instance},Zla.prototype.getStageAt=function(t,e,i,n,r){if(void 0===e&&(e=!1),void 0===i&&(i=ContextGLProfile.BASELINE),void 0===n&&(n=ContextMode.AUTO),void 0===r&&(r=!1),t<0||Zla.STAGE_MAX_QUANTITY<=t)throw new ArgumentError("Index is out of bounds [0.."+Zla.STAGE_MAX_QUANTITY+"]");var o,s;return this._stages[t]||(Zla._numStages++,document&&null==Zla.htmlCanvas?((o=document.createElement("canvas")).id="stage"+t,document.body.appendChild(o)):Zla.htmlCanvas&&(o=Zla.htmlCanvas),(s=this._stages[t]=new Stage(o,t,this,e,i)).addEventListener(StageEvent.CONTEXT_CREATED,this._onContextCreatedDelegate),s.requestContext(e,i,n,r)),this._stages[t]},Zla.prototype.iRemoveStage=function(t){Zla._numStages--,t.removeEventListener(StageEvent.CONTEXT_CREATED,this._onContextCreatedDelegate),this._stages[t.stageIndex]=null},Zla.prototype.getFreeStage=function(t,e,i,n){void 0===t&&(t=!1),void 0===e&&(e=ContextGLProfile.BASELINE),void 0===i&&(i=ContextMode.AUTO),void 0===n&&(n=!1);for(var r=0,o=this._stages.length;rthis._viewWidth?(this._renderToTextureRect.x=Math.floor(.5*(this._textureWidth-this._viewWidth)),this._renderToTextureRect.width=this._viewWidth):(this._renderToTextureRect.x=0,this._renderToTextureRect.width=this._textureWidth),this.dispatchEvent(new RTTEvent(RTTEvent.RESIZE,this)))},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"viewHeight",{get:function(){return this._viewHeight},set:function(t){t!=this._viewHeight&&(this._viewHeight=t,this._buffersInvalid=!0,this._textureHeight=this._powerOfTwo?ImageUtils.getBestPowerOf2(this._viewHeight):this._viewHeight,this._textureHeight>this._viewHeight?(this._renderToTextureRect.y=Math.floor(.5*(this._textureHeight-this._viewHeight)),this._renderToTextureRect.height=this._viewHeight):(this._renderToTextureRect.y=0,this._renderToTextureRect.height=this._textureHeight),this.dispatchEvent(new RTTEvent(RTTEvent.RESIZE,this)))},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"renderToTextureVertexBuffer",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._renderToTextureVertexBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"renderToScreenVertexBuffer",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._renderToScreenVertexBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"indexBuffer",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._indexBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"renderToTextureRect",{get:function(){return this._buffersInvalid&&this.updateRTTBuffers(),this._renderToTextureRect},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"textureWidth",{get:function(){return this._textureWidth},enumerable:!0,configurable:!0}),Object.defineProperty(qma.prototype,"textureHeight",{get:function(){return this._textureHeight},enumerable:!0,configurable:!0}),qma.prototype.dispose=function(){qma.deleteRTTBufferManager(this._stage),this._indexBuffer&&(this._indexBuffer.dispose(),this._renderToScreenVertexBuffer.dispose(),this._renderToTextureVertexBuffer.dispose(),this._renderToScreenVertexBuffer=null,this._renderToTextureVertexBuffer=null,this._indexBuffer=null)},qma.prototype.updateRTTBuffers=function(){var t,e,i=this._stage.context;null==this._renderToTextureVertexBuffer&&(this._renderToTextureVertexBuffer=i.createVertexBuffer(4,20)),null==this._renderToScreenVertexBuffer&&(this._renderToScreenVertexBuffer=i.createVertexBuffer(4,20)),this._indexBuffer||(this._indexBuffer=i.createIndexBuffer(6),this._indexBuffer.uploadFromArray(new Uint16Array([2,1,0,3,2,0]),0,6)),this._textureRatioX=t=Math.min(this._viewWidth/this._textureWidth,1),this._textureRatioY=e=Math.min(this._viewHeight/this._textureHeight,1);var n=.5*(1-t),r=.5*(t+1),o=.5*(1-e),s=.5*(e+1),a=new Float32Array([-t,-e,n,o,0,t,-e,r,o,1,t,e,r,s,2,-t,e,n,s,3]),l=new Float32Array([-1,-1,n,o,0,1,-1,r,o,1,1,1,r,s,2,-1,1,n,s,3]);this._renderToTextureVertexBuffer.uploadFromArray(a,0,4),this._renderToScreenVertexBuffer.uploadFromArray(l,0,4),this._buffersInvalid=!1},qma),RTTBufferManagerVO=function(){},Image2DParser=(Rma=ParserBase,__extends(Sma,Rma),Sma.supportsType=function(t){return"jpg"==(t=t.toLowerCase())||"jpeg"==t||"png"==t||"gif"==t},Sma.supportsData=function(t){if(t instanceof HTMLImageElement)return!0;if(!(t instanceof ByteArray))return!1;var e=t;return e.position=0,55551==e.readUnsignedShort()||(e.position=0,16973==e.readShort()||(e.position=1,"PNG"==e.readUTFBytes(3)||(e.position=0,"GIF"==e.readUTFBytes(3)&&14393==e.readShort()&&97==e.readByte()||(e.position=0,"ATF"==e.readUTFBytes(3)))))},Sma.prototype._pFinalizeAsset=function(t,e){this._alphaChannel&&(t.alphaChannel=this._alphaChannel),Rma.prototype._pFinalizeAsset.call(this,t,e)},Sma.prototype._pProceedParsing=function(){var e=this;if(this._loadingImage)return ParserBase.MORE_TO_PARSE;if(this._htmlImageElement)i=ImageUtils.imageToBitmapImage2D(this._htmlImageElement,!1,this._factory),this._pFinalizeAsset(i,this._iFileName);else if(this.data instanceof HTMLImageElement){var t=this.data,i=ImageUtils.imageToBitmapImage2D(t,!1,this._factory);this._pFinalizeAsset(i,this._iFileName)}else if(this.data instanceof ByteArray){if(this.data.position=0,this._htmlImageElement=ParserUtils.byteArrayToImage(this.data),!this._htmlImageElement.naturalWidth)return this._htmlImageElement.onload=function(t){return e.onLoadComplete(t)},this._loadingImage=!0,ParserBase.MORE_TO_PARSE;i=ImageUtils.imageToBitmapImage2D(this._htmlImageElement,!1,this._factory),this._pFinalizeAsset(i,this._iFileName)}else if(this.data instanceof ArrayBuffer)this._htmlImageElement=ParserUtils.arrayBufferToImage(this.data),i=ImageUtils.imageToBitmapImage2D(this._htmlImageElement,!1,this._factory),this._pFinalizeAsset(i,this._iFileName);else{if(this.data instanceof Blob)return this._htmlImageElement=ParserUtils.blobToImage(this.data),this._htmlImageElement.onload=function(t){return e.onLoadComplete(t)},this._loadingImage=!0,ParserBase.MORE_TO_PARSE;this.data instanceof URLRequest&&(i=new ExternalImage2D(this.data),this._pFinalizeAsset(i,this._iFileName))}return this._pContent=i,ParserBase.PARSING_DONE},Sma.prototype.onLoadComplete=function(t){this._loadingImage=!1},Sma),ImageCubeParser=(fna=ParserBase,__extends(gna,fna),gna.supportsType=function(t){return"cube"==t.toLowerCase()},gna.supportsData=function(t){try{return!!JSON.parse(t)}catch(t){return!1}},gna.prototype._iResolveDependency=function(t){},gna.prototype._iResolveDependencyFailure=function(t){},gna.prototype._pProceedParsing=function(){if(null!=this._imgDependencyDictionary){var t=new BitmapImageCube(this._getBitmapImage2D(gna.posX).width),e=new Rectangle(0,0,t.size,t.size);return t.setPixels(BitmapImageCube.posX,e,this._getBitmapImage2D(gna.posX).data),t.setPixels(BitmapImageCube.negX,e,this._getBitmapImage2D(gna.negX).data),t.setPixels(BitmapImageCube.posY,e,this._getBitmapImage2D(gna.posY).data),t.setPixels(BitmapImageCube.negY,e,this._getBitmapImage2D(gna.negY).data),t.setPixels(BitmapImageCube.posZ,e,this._getBitmapImage2D(gna.posZ).data),t.setPixels(BitmapImageCube.negZ,e,this._getBitmapImage2D(gna.negZ).data),this._imgDependencyDictionary=null,t.name=this._iFileName,this._pFinalizeAsset(t,this._iFileName),ParserBase.PARSING_DONE}try{var i,n=JSON.parse(this.data),r=n.data;if(6!=r.length&&this._pDieWithError("ImageCubeParser: Error - cube texture should have exactly 6 images"),n){this._imgDependencyDictionary=new Object;for(var o=0;oe.pickingCollision.rayEntryDistance?1:t.pickingCollision.rayEntryDistancee.transform.concatenatedMatrix3D.position.x?1:-1}),n=0;n>16&255)/255,this._backgroundGreen=(t>>8&255)/255,this._backgroundBlue=(255&t)/255)},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"focalLength",{get:function(){return this._focalLength},set:function(t){this._focalLength!=t&&(this._focalLength=t,this._updateFocalLength())},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"pixelRatio",{get:function(){return this._pixelRatio},set:function(t){this._pixelRatio!=t&&(this._pixelRatio=t,this._updatePixelRatio())},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"projection",{get:function(){return this._projection},set:function(t){if(null==t)throw new ErrorBase("projection cannot be null");this._projection!=t&&(this._projection.removeEventListener(ProjectionEvent.INVALIDATE_VIEW_MATRIX3D,this._onInvalidateViewMatrix3DDelegate),this._projection=t,this._projection.addEventListener(ProjectionEvent.INVALIDATE_VIEW_MATRIX3D,this._onInvalidateViewMatrix3DDelegate),this._invalidateViewMatrix3D())},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"target",{get:function(){return this._target},set:function(t){this._target!=t&&this._updateTarget(t)},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"stage",{get:function(){return this._stage},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"frustumMatrix3D",{get:function(){return this._frustumMatrix3DDirty&&(this._frustumMatrix3DDirty=!1,this._frustumMatrix3D.recompose(this._components),this._frustumMatrix3D.prepend(this._projection.frustumMatrix3D)),this._frustumMatrix3D},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"viewMatrix3D",{get:function(){return this._viewMatrix3DDirty&&(this._viewMatrix3DDirty=!1,this._viewMatrix3D.recompose(this._components),this._viewMatrix3D.prepend(this._projection.viewMatrix3D)),this._viewMatrix3D},enumerable:!0,configurable:!0}),Object.defineProperty(Lya.prototype,"inverseViewMatrix3D",{get:function(){return this._inverseViewMatrix3DDirty&&(this._inverseViewMatrix3DDirty=!1,this._inverseViewMatrix3D.copyFrom(this.viewMatrix3D),this._inverseViewMatrix3D.invert()),this._inverseViewMatrix3D},enumerable:!0,configurable:!0}),Lya.prototype.clear=function(t,e,i,n,r){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=ContextGLClearMask.ALL),this._stage.setRenderTarget(this._target,e,i,n),this._stage.setScissor(null==this._target?this._rect:null),t&&this._stage.clear(this._backgroundRed,this._backgroundGreen,this._backgroundBlue,this.backgroundAlpha,this.backgroundDepth,this.backgroundStencil,r)},Lya.prototype.present=function(){this._shareContext||null!=this._target||this._stage.context.present()},Lya.prototype.project=function(t,e){return void 0===e&&(e=null),(e=this._projection.project(t,e)).x=(e.x+1)*this.width/2,e.y=(e.y+1)*this.height/2,e},Lya.prototype.unproject=function(t,e,i,n){return void 0===n&&(n=null),this._projection.unproject(2*t/this.width-1,2*e/this.height-1,i,n)},Lya.prototype.dispose=function(){this._target?(this._target.removeEventListener(AssetEvent.INVALIDATE,this._onInvalidateSizeDelegate),this._target=null):(this._stage.removeEventListener(StageEvent.INVALIDATE_SIZE,this._onInvalidateSizeDelegate),this._shareContext||null!=this._target||this._stage.dispose(),this._stage=null),this._projection&&(this._projection.removeEventListener(ProjectionEvent.INVALIDATE_VIEW_MATRIX3D,this._onInvalidateViewMatrix3DDelegate),this._projection=null)},Lya.prototype._onInvalidateSize=function(t){this._updateDimensions(),this._updateFocalLength(),this._updatePixelRatio()},Lya.prototype._onInvalidateViewMatrix3D=function(t){this._invalidateViewMatrix3D()},Lya.prototype._updateTarget=function(t){this._target?this._target.removeEventListener(AssetEvent.INVALIDATE,this._onInvalidateSizeDelegate):this._stage.removeEventListener(StageEvent.INVALIDATE_SIZE,this._onInvalidateSizeDelegate),this._target=t,this._target?this._target.addEventListener(AssetEvent.INVALIDATE,this._onInvalidateSizeDelegate):this._stage.addEventListener(StageEvent.INVALIDATE_SIZE,this._onInvalidateSizeDelegate),this._updateDimensions(),this._updateFocalLength(),this._updatePixelRatio()},Lya.prototype._updateDimensions=function(){this._target?this._target instanceof Image2D?(this._targetWidth=this._target.width,this._targetHeight=this._target.height):this._target instanceof ImageCube&&(this._targetWidth=this._target.size,this._targetHeight=this._target.size):(this._targetWidth=this._stage.width,this._targetHeight=this._stage.height),this.preserveDimensions&&(this._shareContext||this._target)?(this._offset.x=this._rect.x/this._targetWidth,this._offset.y=this._rect.y/this._targetHeight,this._scale.x=this._rect.width/this._targetWidth,this._scale.y=this._rect.height/this._targetHeight):(this._rect.x=this._offset.x*this._targetWidth,this._rect.y=this._offset.y*this._targetHeight,this._rect.width=this._scale.x*this._targetWidth,this._rect.height=this._scale.y*this._targetHeight,this._invalidateSize())},Lya.prototype._updateFocalLength=function(){this.preserveFocalLength?this.projection.scale=this._focalLength/this._rect.height:this._focalLength=this._projection.scale*this._rect.height},Lya.prototype._updatePixelRatio=function(){this.preservePixelRatio?this._projection.ratio=this._pixelRatio*this._rect.width/this._rect.height:this._pixelRatio=this._projection.ratio*this._rect.height/this._rect.width},Lya.prototype._invalidateViewMatrix3D=function(){this._frustumMatrix3DDirty=!0,this._viewMatrix3DDirty=!0,this._inverseViewMatrix3DDirty=!0,this.dispatchEvent(new ViewEvent(ViewEvent.INVALIDATE_VIEW_MATRIX3D,this))},Lya.prototype._invalidateSize=function(){this.dispatchEvent(new ViewEvent(ViewEvent.INVALIDATE_SIZE,this))},Lya),Kya,Jxa,vwa,Ava,lva,hva,Gua,kua,Sta,ksa,$ra,lra,Qqa,yqa,tqa;function Lya(t,e,i,n,r,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=!1),void 0===n&&(n=ContextGLProfile.BASELINE),void 0===r&&(r=ContextMode.AUTO),void 0===o&&(o=!1);var s=Kya.call(this)||this;return s._rect=new Rectangle,s._backgroundRed=0,s._backgroundGreen=0,s._backgroundBlue=0,s._focalLength=1e3,s._pixelRatio=1,s._frustumMatrix3D=new Matrix3D,s._viewMatrix3D=new Matrix3D,s._inverseViewMatrix3D=new Matrix3D,s._components=new Array(4),s._offset=new Vector3D,s._scale=new Vector3D(1,1,1),s._frustumMatrix3DDirty=!0,s._viewMatrix3DDirty=!0,s._inverseViewMatrix3DDirty=!0,s.backgroundAlpha=1,s.backgroundDepth=1,s.backgroundStencil=0,s.preservePixelRatio=!0,s.preserveFocalLength=!1,s.preserveDimensions=!1,s._components[0]=s._offset,s._components[3]=s._scale,s._onInvalidateSizeDelegate=function(t){return s._onInvalidateSize(t)},s._onInvalidateViewMatrix3DDelegate=function(t){return s._onInvalidateViewMatrix3D(t)},s._projection=t||new PerspectiveProjection,s._projection.addEventListener(ProjectionEvent.INVALIDATE_VIEW_MATRIX3D,s._onInvalidateViewMatrix3DDelegate),e&&(s._shareContext=!0),s._stage=e||StageManager.getInstance().getFreeStage(i,n,r,o),s._stage.addEventListener(StageEvent.INVALIDATE_SIZE,s._onInvalidateSizeDelegate),s._targetWidth=s._stage.width,s._targetHeight=s._stage.height,s._updateFocalLength(),s._updatePixelRatio(),s}function Gya(){this._abstractionPool=new Object}function Bya(t){this._abstractionPool=new Object,this._pickGroup=t}function wya(t){this._abstractionPool=new Object,this._pickGroup=t}function kya(t){this._entityPool=new Object,this._view=t,this._raycastPickerPool=new RaycastPickerPool(this),this._boundsPickerPool=new BoundsPickerPool(this),this._tabPickerPool=kya._tabPickerPool||(kya._tabPickerPool=new TabPickerPool)}function Kxa(t,e){var i=Jxa.call(this,t,e)||this;return i._tabEntities=[],i._customTabEntities=[],i._customTabEntitiesSorted=[],i._partition=t,i._entity=t.root,i}function wwa(t,e,i){var n=vwa.call(this,e,i)||this;return n._boundingVolumePools=new Object,n._boundsPickers=[],n._pickGroup=t,n._partition=e,n._entity=e.root,n}function Bva(t,e,i){var n=Ava.call(this,e,i)||this;return n.shapeFlag=!1,n.findClosestCollision=!1,n._entities=[],n._pickers=[],n._collectedEntities=[],n._pickGroup=t,n._partition=e,n._entity=e.root,n}function mva(t,e){return lva.call(this,t,e)||this}function iva(t){var e=hva.call(this,t)||this;return e._rootNode=new NodeBase(t,e),e}function Hua(t,e){void 0===e&&(e=!1);var i=Gua.call(this)||this;return i._children=new Array,i._abstractionPool=new Object,i._updateQueue={},i.isUpdated=!1,i._root=t,i._root.addEventListener(AssetEvent.CLEAR,function(t){return i._onRootClear(t)}),e&&(i._scene=t),i}function pua(t,e){this._childNodes=new Array,this._numChildNodes=0,this._entity=t,this._partition=e}function lua(t,e){var i=kua.call(this,t)||this;return i._view=e,i}function Tta(t,e){var i=Sta.call(this,t,e)||this;return i.sourceEntity=e.entity,i._view=e.view,i._pickGroup=e.pickGroup,i}function lsa(t,e,i){var n=ksa.call(this,e,i)||this;return n._boundingVolumePools=new Object,n._orientedBoxBounds=[],n._orientedBoxBoundsDirty=[!0,!0],n._orientedSphereBounds=[],n._orientedSphereBoundsDirty=[!0,!0],n._pickablePool=new Object,n._pickables=[],n.shapeFlag=!1,n._view=t,n._entity=e,n._pickGroup=i,n._pickingCollision=new PickingCollision(n._entity),n}function dsa(t,e){this._boundingVolumePool=new Object,this._picker=t,this._strokeFlag=dsa._strokeDict[e],this._fastFlag=dsa._fastDict[e],this._boundingVolumeClass=dsa._boundsDict[e]}function _ra(){return null!==$ra&&$ra.apply(this,arguments)||this}function mra(){var t=null!==lra&&lra.apply(this,arguments)||this;return t._radius=0,t._centerX=0,t._centerY=0,t._centerZ=0,t}function Rqa(){var t=null!==Qqa&&Qqa.apply(this,arguments)||this;return t._x=0,t._y=0,t._z=0,t._width=0,t._height=0,t._depth=0,t._centerX=0,t._centerY=0,t._centerZ=0,t._halfExtentsX=0,t._halfExtentsY=0,t._halfExtentsZ=0,t}function zqa(t,e){var i=yqa.call(this,t,e)||this;if(i._targetCoordinateSpace=t,i._picker=e.picker,i._strokeFlag=e.strokeFlag,i._fastFlag=e.fastFlag,i._onInvalidateBoundsDelegate=function(t){return i._onInvalidateBounds(t)},i._onInvalidateMatrix3DDelegate=function(t){return i._onInvalidateMatrix3D(t)},i._picker.addEventListener(BoundsPickerEvent.INVALIDATE_BOUNDS,i._onInvalidateBoundsDelegate),i._targetCoordinateSpace){var n=i._picker.entity;if(i._targetCoordinateSpace.parent){for(;n&&n!=i._targetCoordinateSpace.parent;)n.transform.addEventListener(TransformEvent.INVALIDATE_MATRIX3D,i._onInvalidateMatrix3DDelegate),n=n.parent;n||i._targetCoordinateSpace.transform.addEventListener(TransformEvent.INVALIDATE_CONCATENATED_MATRIX3D,i._onInvalidateMatrix3DDelegate)}else n.transform.addEventListener(TransformEvent.INVALIDATE_CONCATENATED_MATRIX3D,i._onInvalidateMatrix3DDelegate)}return i}function uqa(t,e){var i=tqa.call(this,t)||this;return i._boundsPicker=e,i}console.debug("AwayJS - View - 0.6.1");var AnimationElements=(qza.prototype.createVertexData=function(t,e){this._numVertices=t,this._totalLenOfOneVertex=e,this._pVertexData=new Float32Array(t*e)},qza.prototype.activateVertexBuffer=function(t,e,i,n){var r=i.stageIndex,o=i.context,s=this._pVertexBuffer[r];s&&this._pBufferContext[r]==o||(s=this._pVertexBuffer[r]=o.createVertexBuffer(this._numVertices,4*this._totalLenOfOneVertex),this._pBufferContext[r]=o,this._pBufferDirty[r]=!0),this._pBufferDirty[r]&&(s.uploadFromArray(this._pVertexData,0,this._numVertices),this._pBufferDirty[r]=!1),o.setVertexBufferAt(t,s,4*e,n)},qza.prototype.dispose=function(){for(;this._pVertexBuffer.length;){var t=this._pVertexBuffer.pop();t&&t.dispose()}},qza.prototype.invalidateBuffer=function(){for(var t=0;t<8;t++)this._pBufferDirty[t]=!0},Object.defineProperty(qza.prototype,"vertexData",{get:function(){return this._pVertexData},enumerable:!0,configurable:!0}),Object.defineProperty(qza.prototype,"numVertices",{get:function(){return this._numVertices},enumerable:!0,configurable:!0}),Object.defineProperty(qza.prototype,"totalLenOfOneVertex",{get:function(){return this._totalLenOfOneVertex},enumerable:!0,configurable:!0}),qza.SUBGEOM_ID_COUNT=0,qza),ColorSegmentPoint=(Object.defineProperty(Dza.prototype,"color",{get:function(){return this._color},enumerable:!0,configurable:!0}),Object.defineProperty(Dza.prototype,"life",{get:function(){return this._life},enumerable:!0,configurable:!0}),Dza),JointPose=(Gza.prototype.toMatrix3D=function(t){return void 0===t&&(t=null),null==t&&(t=new Matrix3D),this.orientation.toMatrix3D(t),t.appendTranslation(this.translation.x,this.translation.y,this.translation.z),t},Gza.prototype.copyFrom=function(t){var e=t.orientation,i=t.translation;this.orientation.x=e.x,this.orientation.y=e.y,this.orientation.z=e.z,this.orientation.w=e.w,this.translation.x=i.x,this.translation.y=i.y,this.translation.z=i.z},Gza),ParticleAnimationData=function(t,e,i,n,r){this.index=t,this.startTime=e,this.totalTime=i+n,this.duration=i,this.delay=n,this.startVertexIndex=r.startVertexIndex,this.numVertices=r.numVertices},ParticleProperties=function(){},ParticlePropertiesMode=(Qza.GLOBAL=0,Qza.LOCAL_STATIC=1,Qza.LOCAL_DYNAMIC=2,Qza),Skeleton=(Rza=AssetBase,__extends(Sza,Rza),Object.defineProperty(Sza.prototype,"numJoints",{get:function(){return this.joints.length},enumerable:!0,configurable:!0}),Sza.prototype.jointFromName=function(t){var e=this.jointIndexFromName(t);return-1!=e?this.joints[e]:null},Sza.prototype.jointIndexFromName=function(t){for(var e,i;i>1,i=this._maskConfig?Math.pow(2,1+e<<1):1,n=i;this._context.enableStencil(),this._context.setStencilActions(ContextGLTriangleFace.FRONT_AND_BACK,ContextGLCompareMode.ALWAYS,ContextGLStencilAction.SET,ContextGLStencilAction.SET,ContextGLStencilAction.SET);for(var r,o,s,a=t.length,l=0;l=kQa.POST_PRIORITY&&n.priority=kQa.COLOR_PRIORITY&&(r+=n.getAGALVertexCode(t,this,e,this._iAnimationRegisterData));return t.usesFragmentAnimation&&(this.hasColorAddNode||this.hasColorMulNode)&&(this.hasColorMulNode&&(r+="mov "+this._iAnimationRegisterData.colorMulVary+","+this._iAnimationRegisterData.colorMulTarget+"\n"),this.hasColorAddNode&&(r+="mov "+this._iAnimationRegisterData.colorAddVary+","+this._iAnimationRegisterData.colorAddTarget+"\n")),r},kQa.prototype.getAGALUVCode=function(t,e,i){var n,r="";if(this.hasUVNode){this._iAnimationRegisterData.setUVSourceAndTarget(i),r+="mov "+this._iAnimationRegisterData.uvTarget+".xy,"+this._iAnimationRegisterData.uvAttribute.toString()+"\n";for(var o=0;othis._pStartTime+this._animationClipNode.totalDuration?t=this._pStartTime+this._animationClipNode.totalDuration:tthis._pTime?1:-1,C_a.prototype._pUpdateTime.call(this,t)},D_a.prototype._pUpdateFrames=function(){this._pFramesDirty=!1;var t=this._animationClipNode.looping,e=this._animationClipNode.totalDuration,i=this._animationClipNode.lastFrame,n=this._pTime;if(t&&(e<=n||n<0)&&(n%=e)<0&&(n+=e),!t&&e<=n)this.notifyPlaybackComplete(),this._pCurrentFrame=i,this._pNextFrame=i,this._pBlendWeight=0;else if(!t&&n<=0)this._pCurrentFrame=0,this._pNextFrame=0,this._pBlendWeight=0;else if(this._animationClipNode.fixedFrameRate){var r=n/e*i;this._pCurrentFrame=Math.floor(r),this._pBlendWeight=r-this._pCurrentFrame,this._pNextFrame=this._pCurrentFrame+1}else{this._pCurrentFrame=0;for(var o,s=this._pNextFrame=0,a=this._animationClipNode.durations;o=s,s+=a[this._pNextFrame],this._pCurrentFrame=this._pNextFrame++,s=this._skeletonClipNode.lastFrame?(this._nextPose=this._frames[0],this._pAnimator.dispatchCycleEvent()):this._nextPose=this._frames[this._pNextFrame]},U_a.prototype.updateSkeletonPose=function(t){if(this._skeletonPoseDirty=!1,this._skeletonClipNode.totalDuration){this._pFramesDirty&&this._pUpdateFrames();var e,i,n,r,o,s,a=this._currentPose.jointPoses,l=this._nextPose.jointPoses,c=t.numJoints,h=this._skeletonPose.jointPoses;if(h.length!=c&&(h.length=c),c!=a.length||c!=l.length)throw new Error("joint counts don't match!");for(var u=0;uthis._pOldFrame)&&(this._rootPos.x-=n.x*this._pTimeDir,this._rootPos.y-=n.y*this._pTimeDir,this._rootPos.z-=n.z*this._pTimeDir);var r=this._rootPos.x,o=this._rootPos.y,s=this._rootPos.z;this._skeletonClipNode.stitchFinalFrame&&this._pNextFrame==this._skeletonClipNode.lastFrame?(t=this._frames[0].jointPoses[0].translation,e=this._frames[1].jointPoses[0].translation,i=this._currentPose.jointPoses[0].translation,this._rootPos.x=i.x+t.x+this._pBlendWeight*(e.x-t.x),this._rootPos.y=i.y+t.y+this._pBlendWeight*(e.y-t.y),this._rootPos.z=i.z+t.z+this._pBlendWeight*(e.z-t.z)):(t=this._currentPose.jointPoses[0].translation,e=this._frames[this._pNextFrame].jointPoses[0].translation,this._rootPos.x=t.x+this._pBlendWeight*(e.x-t.x),this._rootPos.y=t.y+this._pBlendWeight*(e.y-t.y),this._rootPos.z=t.z+this._pBlendWeight*(e.z-t.z)),this._pRootDelta.x=this._rootPos.x-r,this._pRootDelta.y=this._rootPos.y-o,this._pRootDelta.z=this._rootPos.z-s,this._pOldFrame=this._pNextFrame},U_a),SkeletonClipNode=(r0a=AnimationClipNodeBase,__extends(s0a,r0a),Object.defineProperty(s0a.prototype,"frames",{get:function(){return this._frames},enumerable:!0,configurable:!0}),s0a.prototype.addFrame=function(t,e){this._frames.push(t),this._pDurations.push(e),this._pNumFrames=this._pDurations.length,this._pStitchDirty=!0},s0a.prototype.getAnimationState=function(t){return t.getAnimationState(this)},s0a.prototype._pUpdateStitch=function(){r0a.prototype._pUpdateStitch.call(this);for(var t,e,i=this._pNumFrames-1;i--;)this._pTotalDuration+=this._pDurations[i],t=this._frames[i].jointPoses[0].translation,e=this._frames[i+1].jointPoses[0].translation.subtract(t),this._pTotalDelta.x+=e.x,this._pTotalDelta.y+=e.y,this._pTotalDelta.z+=e.z;!this._pStitchFinalFrame&&this._pLooping||(this._pTotalDuration+=this._pDurations[this._pNumFrames-1],t=this._frames[0].jointPoses[0].translation,e=this._frames[1].jointPoses[0].translation.subtract(t),this._pTotalDelta.x+=e.x,this._pTotalDelta.y+=e.y,this._pTotalDelta.z+=e.z)},s0a),SkeletonDifferenceState=(A0a=AnimationStateBase,__extends(B0a,A0a),Object.defineProperty(B0a.prototype,"blendWeight",{get:function(){return this._blendWeight},set:function(t){this._blendWeight=t,this._pPositionDeltaDirty=!0,this._skeletonPoseDirty=!0},enumerable:!0,configurable:!0}),B0a.prototype.phase=function(t){this._skeletonPoseDirty=!0,this._pPositionDeltaDirty=!0,this._baseInput.phase(t),this._baseInput.phase(t)},B0a.prototype._pUpdateTime=function(t){this._skeletonPoseDirty=!0,this._baseInput.update(t),this._differenceInput.update(t),A0a.prototype._pUpdateTime.call(this,t)},B0a.prototype.getSkeletonPose=function(t){return this._skeletonPoseDirty&&this.updateSkeletonPose(t),this._skeletonPose},B0a.prototype._pUpdatePositionDelta=function(){this._pPositionDeltaDirty=!1;var t=this._baseInput.positionDelta,e=this._differenceInput.positionDelta;this.positionDelta.x=t.x+this._blendWeight*e.x,this.positionDelta.y=t.y+this._blendWeight*e.y,this.positionDelta.z=t.z+this._blendWeight*e.z},B0a.prototype.updateSkeletonPose=function(t){var e;this._skeletonPoseDirty=!1;var i,n,r,o,s,a=this._skeletonPose.jointPoses,l=this._baseInput.getSkeletonPose(t).jointPoses,c=this._differenceInput.getSkeletonPose(t).jointPoses,h=t.numJoints;a.length!=h&&(a.length=h);for(var u=0;u=this._vertexClipNode.lastFrame?(this._nextGraphics=this._frames[0],this._pAnimator.dispatchCycleEvent()):this._nextGraphics=this._frames[this._pNextFrame]},t2a.prototype._pUpdatePositionDelta=function(){},t2a),VertexClipNode=(x2a=AnimationClipNodeBase,__extends(y2a,x2a),Object.defineProperty(y2a.prototype,"frames",{get:function(){return this._frames},enumerable:!0,configurable:!0}),y2a.prototype.addFrame=function(t,e,i){void 0===i&&(i=null),this._frames.push(t),this._pDurations.push(e),this._translations.push(i||new Vector3D),this._pNumFrames=this._pDurations.length,this._pStitchDirty=!0},y2a.prototype._pUpdateStitch=function(){x2a.prototype._pUpdateStitch.call(this);for(var t,e,i=this._pNumFrames-1;i--;)this._pTotalDuration+=this._pDurations[i],t=this._translations[i],e=this._translations[i+1].subtract(t),this._pTotalDelta.x+=e.x,this._pTotalDelta.y+=e.y,this._pTotalDelta.z+=e.z;1>>24&3,e[i++]=128|s>>>18&63,e[i++]=128|s>>>12&63,e[i++]=128|s>>>6&63):0!=(4294901760&s)?(e[i++]=240|s>>>18&7,e[i++]=128|s>>>12&63,e[i++]=128|s>>>6&63):0!=(4294965248&s)?(e[i++]=224|s>>>12&15,e[i++]=128|s>>>6&63):e[i++]=192|s>>>6&31,e[i++]=128|63&s)}return e.subarray(0,i)}function utf8encode(t){for(var e=0,i="";e>1|128))===r)break;r=r>>1|128,--o}while(0<=o);if(o<=0){i+=String.fromCharCode(n);continue}for(var s=n&(1<>10&1023|55296,1023&s|56320):String.fromCharCode(s)}}return i}L9a=ImageType=ImageType||{},L9a[L9a.None=0]="None",L9a[L9a.PremultipliedAlphaARGB=1]="PremultipliedAlphaARGB",L9a[L9a.StraightAlphaARGB=2]="StraightAlphaARGB",L9a[L9a.StraightAlphaRGBA=3]="StraightAlphaRGBA",L9a[L9a.JPEG=4]="JPEG",L9a[L9a.PNG=5]="PNG",L9a[L9a.GIF=6]="GIF";var ArrayBufferPool=(M9a.prototype.acquire=function(t){if(M9a._enabled)for(var e=this._list,i=0;i=t)return e.splice(i,1),n}return new ArrayBuffer(t)},M9a.prototype.release=function(t){var e;M9a._enabled&&((e=this._list).length===this._maxSize&&e.shift(),e.push(t))},M9a.prototype.ensureUint8ArrayLength=function(t,e){if(t.length>=e)return t;var i=Math.max(t.length+e,1+(3*t.length>>1)),n=new Uint8Array(this.acquire(i),0,i);return n.set(t),this.release(t.buffer),n},M9a.prototype.ensureFloat64ArrayLength=function(t,e){if(t.length>=e)return t;var i=Math.max(t.length+e,1+(3*t.length>>1)),n=new Float64Array(this.acquire(i*Float64Array.BYTES_PER_ELEMENT),0,i);return n.set(t),this.release(t.buffer),n},M9a._enabled=!0,M9a),IntegerUtilities,dab,eab;function M9a(t){void 0===t&&(t=32),this._list=[],this._maxSize=t}function ensureTypedArrayCapacity(t,e){var i;return t.length>16}function gab(t){return t/256}dab=IntegerUtilities=IntegerUtilities||{},eab=new ArrayBuffer(8),dab.i8=new Int8Array(eab),dab.u8=new Uint8Array(eab),dab.i32=new Int32Array(eab),dab.f32=new Float32Array(eab),dab.f64=new Float64Array(eab),dab.nativeLittleEndian=1===new Int8Array(new Int32Array([1]).buffer)[0],dab.floatToInt32=function(t){return dab.f32[0]=t,dab.i32[0]},dab.int32ToFloat=function(t){return dab.i32[0]=t,dab.f32[0]},dab.swap16=function(t){return(255&t)<<8|t>>8&255},dab.swap32=function(t){return(255&t)<<24|(65280&t)<<8|t>>8&65280|t>>24&255},dab.toS8U8=fab,dab.fromS8U8=gab,dab.clampS8U8=function(t){return fab(t)/256},dab.toS16=function(t){return t<<16>>16},dab.bitCount=function(t){return 16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24},dab.ones=function(t){return 16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24},dab.trailingZeros=function(t){return dab.ones((t&-t)-1)},dab.getFlags=function(t,e){var i="";for(t=0;t>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},dab.roundToMultipleOfPowerOfTwo=function(t,e){var i=(1<".'},XMLOnlyWorksWithOneItemLists:{code:1086,message:"The %1 method only works on lists containing one item."},XMLAssignmentToIndexedXMLNotAllowed:{code:1087,message:"Assignment to indexed XML is not allowed."},XMLMarkupMustBeWellFormed:{code:1088,message:"The markup in the document following the root element must be well-formed."},XMLAssigmentOneItemLists:{code:1089,message:"Assignment to lists with more than one item is not supported."},XMLMalformedElement:{code:1090,message:"XML parser failure: element is malformed."},XMLUnterminatedCData:{code:1091,message:"XML parser failure: Unterminated CDATA section."},XMLUnterminatedXMLDecl:{code:1092,message:"XML parser failure: Unterminated XML declaration."},XMLUnterminatedDocTypeDecl:{code:1093,message:"XML parser failure: Unterminated DOCTYPE declaration."},XMLUnterminatedComment:{code:1094,message:"XML parser failure: Unterminated comment."},XMLUnterminatedElement:{code:1096,message:"XML parser failure: Unterminated element."},XMLNamespaceWithPrefixAndNoURI:{code:1098,message:"Illegal prefix %1 for no namespace."},RegExpFlagsArgumentError:{code:1100,message:"Cannot supply flags when constructing one RegExp from another."},InvalidBaseClassError:{code:1108,message:"The OP_newclass opcode was used with the incorrect base class."},XMLInvalidName:{code:1117,message:"Invalid XML name: %1."},XMLIllegalCyclicalLoop:{code:1118,message:"Illegal cyclical loop between nodes."},FilterError:{code:1123,message:"Filter operator not supported on type %1."},OutOfRangeError:{code:1125,message:"The index %1 is out of range %2."},VectorFixedError:{code:1126,message:"Cannot change the length of a fixed Vector."},TypeAppOfNonParamType:{code:1127,message:"Type application attempted on a non-parameterized type."},WrongTypeArgCountError:{code:1128,message:"Incorrect number of type parameters for %1. Expected %2, got %3."},JSONCyclicStructure:{code:1129,message:"Cyclic structure cannot be converted to JSON string."},JSONInvalidReplacer:{code:1131,message:"Replacer argument to JSON stringifier must be an array or a two parameter function."},JSONInvalidParseInput:{code:1132,message:"Invalid JSON parse input."},InvalidRangeError:{code:1506,message:"The specified range is invalid."},NullArgumentError:{code:1507,message:"Argument %1 cannot be null."},InvalidArgumentError:{code:1508,message:"The value specified for argument %1 is invalid."},ArrayFilterNonNullObjectError:{code:1510,message:"When the callback argument is a method of a class, the optional this argument must be null."},InvalidParamError:{code:2004,message:"One of the parameters is invalid."},ParamRangeError:{code:2006,message:"The supplied index is out of bounds."},NullPointerError:{code:2007,message:"Parameter %1 must be non-null."},InvalidEnumError:{code:2008,message:"Parameter %1 must be one of the accepted values."},CantInstantiateError:{code:2012,message:"%1 class cannot be instantiated."},InvalidBitmapData:{code:2015,message:"Invalid BitmapData."},EOFError:{code:2030,message:"End of file was encountered.",fqn:"flash.errors.EOFError"},CompressedDataError:{code:2058,message:"There was an error decompressing the data.",fqn:"flash.errors.IOError"},EmptyStringError:{code:2085,message:"Parameter %1 must be non-empty string."},ProxyGetPropertyError:{code:2088,message:"The Proxy class does not implement getProperty. It must be overridden by a subclass."},ProxySetPropertyError:{code:2089,message:"The Proxy class does not implement setProperty. It must be overridden by a subclass."},ProxyCallPropertyError:{code:2090,message:"The Proxy class does not implement callProperty. It must be overridden by a subclass."},ProxyHasPropertyError:{code:2091,message:"The Proxy class does not implement hasProperty. It must be overridden by a subclass."},ProxyDeletePropertyError:{code:2092,message:"The Proxy class does not implement deleteProperty. It must be overridden by a subclass."},ProxyGetDescendantsError:{code:2093,message:"The Proxy class does not implement getDescendants. It must be overridden by a subclass."},ProxyNextNameIndexError:{code:2105,message:"The Proxy class does not implement nextNameIndex. It must be overridden by a subclass."},ProxyNextNameError:{code:2106,message:"The Proxy class does not implement nextName. It must be overridden by a subclass."},ProxyNextValueError:{code:2107,message:"The Proxy class does not implement nextValue. It must be overridden by a subclass."},TooFewArgumentsError:{code:2001,message:"Too few arguments were specified; got %1, %2 expected."},ParamTypeError:{code:2005,message:"Parameter %1 is of the incorrect type. Should be type %2."},SocketConnectError:{code:2011,message:"Socket connection failed to %1:%2."},CantAddSelfError:{code:2024,message:"An object cannot be added as a child of itself."},NotAChildError:{code:2025,message:"The supplied DisplayObject must be a child of the caller."},UnhandledError:{code:2044,message:"Unhandled %1:."},AllowDomainArgumentError:{code:2052,message:"Only String arguments are permitted for allowDomain and allowInsecureDomain."},DelayRangeError:{code:2066,message:"The Timer delay specified is out of range."},ExternalInterfaceNotAvailableError:{code:2067,message:"The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime."},InvalidLoaderMethodError:{code:2069,message:"The Loader class does not implement this method."},InvalidStageMethodError:{code:2071,message:"The Stage class does not implement this property or method."},TimelineObjectNameSealedError:{code:2078,message:"The name property of a Timeline-placed object cannot be modified."},AlreadyConnectedError:{code:2082,message:"Connect failed because the object is already connected."},CloseNotConnectedError:{code:2083,message:"Close failed because the object is not connected."},ArgumentSizeError:{code:2084,message:"The AMF encoding of the arguments cannot exceed 40K."},AsyncError:{code:2095,message:"%1 was unable to invoke callback %2."},LoadingObjectNotSWFError:{code:2098,message:"The loading object is not a .swf file, you cannot request SWF properties from it."},LoadingObjectNotInitializedError:{code:2099,message:"The loading object is not sufficiently loaded to provide this information."},DecodeParamError:{code:2101,message:"The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs."},SceneNotFoundError:{code:2108,message:"Scene %1 was not found."},FrameLabelNotFoundError:{code:2109,message:"Frame label %1 not found in scene %2."},InvalidLoaderInfoMethodError:{code:2118,message:"The LoaderInfo class does not implement this method."},SecuritySwfNotAllowedError:{code:2121,message:"Security sandbox violation: %1: %2 cannot access %3. This may be worked around by calling Security.allowDomain."},UnknownFileTypeError:{code:2124,message:"Loaded file is an unknown type."},CantAddParentError:{code:2150,message:"An object cannot be added as a child to one of it's children (or children's children, etc.)."},Matrix3DRefCannontBeShared:{code:2189,message:"A Matrix3D can not be assigned to more than one DisplayObject."},ObjectWithStringsParamError:{code:2196,message:"Parameter %1 must be an Object with only String values."},AllowCodeImportError:{code:3226,message:"Cannot import a SWF file when LoaderContext.allowCodeImport is false."},PermissionDenied:{code:3315,message:"The current security context does not allow this operation."},InternalErrorIV:{code:3343,message:"Internal Error."}},InflateState,Wab;Wab=InflateState=InflateState||{},Wab[Wab.INIT=0]="INIT",Wab[Wab.BLOCK_0=1]="BLOCK_0",Wab[Wab.BLOCK_1=2]="BLOCK_1",Wab[Wab.BLOCK_2_PRE=3]="BLOCK_2_PRE",Wab[Wab.BLOCK_2=4]="BLOCK_2",Wab[Wab.DONE=5]="DONE",Wab[Wab.ERROR=6]="ERROR",Wab[Wab.VERIFY_HEADER=7]="VERIFY_HEADER";var WINDOW_SIZE=32768,WINDOW_SHIFT_POSITION=65536,MAX_WINDOW_SIZE=WINDOW_SHIFT_POSITION+258,Inflate=(Xab.prototype.push=function(t){},Xab.prototype.close=function(){},Xab.create=function(t){return new BasicInflate(t)},Xab.prototype._processZLibHeader=function(t,e,i){if(i=WINDOW_SHIFT_POSITION&&("copyWithin"in this._buffer?this._window.copyWithin(0,this._windowPosition-WINDOW_SIZE,this._windowPosition):this._window.set(this._window.subarray(this._windowPosition-WINDOW_SIZE,this._windowPosition)),this._windowPosition=WINDOW_SIZE)}while(!i&&this._bufferPosition>=3,r-=3,s>>1){case 0:if(r=n=0,i-o<4)return!0;var a=e[o]|e[o+1]<<8,l=e[o+2]|e[o+3]<<8;if(o+=4,65535!=(a^l)){this._error("inflate: invalid block 0 length"),t=InflateState.ERROR;break}t=0==a?InflateState.INIT:(this._block0Read=a,InflateState.BLOCK_0);break;case 1:t=InflateState.BLOCK_1,this._literalTable=fixedLiteralTable,this._distanceTable=fixedDistanceTable;break;case 2:if((i-o<<3)+r<26)return!0;for(;r<14;)n|=e[o++]<>10&15);if((i-o<<3)+r<14+3*c)return!0;var h={numLiteralCodes:257+(31&n),numDistanceCodes:1+(n>>5&31),codeLengthTable:void 0,bitLengths:void 0,codesRead:0,dupBits:0};n>>=14,r-=14;for(var u=new Uint8Array(19),p=0;p>=3,r-=3;for(;p<19;p++)u[codeLengthOrder[p]]=0;h.bitLengths=new Uint8Array(h.numLiteralCodes+h.numDistanceCodes),h.codeLengthTable=makeHuffmanTable(u),this._block2State=h,t=InflateState.BLOCK_2_PRE;break;default:return this._error("inflate: unsupported block type"),t=InflateState.ERROR,!1}return this._isFinalBlock=!!(1&s),this._state=t,this._bufferPosition=o,this._bitBuffer=n,this._bitLength=r,!1},obb.prototype._error=function(t){this.onError&&this.onError(t)},obb.prototype._decodeBlock0=function(){var t=this._bufferPosition,e=this._windowPosition,i=this._block0Read,n=MAX_WINDOW_SIZE-e,r=this._bufferSize-t,o=r>t,this._bitLength=i-t,e&(1<>16;return 32768&s?(this._error("inflate: invalid encoding"),this._state=InflateState.ERROR,-1):(this._bitBuffer=e>>a,this._bitLength=i-a,65535&s)},obb.prototype._decodeBlock2Pre=function(){var t=this._block2State,e=t.numLiteralCodes+t.numDistanceCodes,i=t.bitLengths,n=t.codesRead,r=0>p&1);for(p=u;p>8&255,255&~e,~e>>8&255]),r),r+=5,n.set(t.subarray(o,e),r),this.onData(n),this._adler32&&this._adler32.update(t,0,e)},ddb.prototype.close=function(){var t;this._state=DeflateState.DONE,this.onData(new Uint8Array([1,0,0,255,255])),this._adler32&&(t=this._adler32.getChecksum(),this.onData(new Uint8Array([255&t,t>>8&255,t>>16&255,t>>>24&255])))},ddb),InputStream=(mdb.prototype.append=function(t){var e=this.pos+this.available,i=e+t.length;if(i>this.buffer.length){for(var n=2*this.buffer.length;n>1;function vdb(t){this.outStream=t,this.buf=null,this.pos=0,this.size=0,this.isFull=!1,this.writePos=0,this.totalPos=0}function sdb(t){this.onData=t,this.processed=0}function mdb(){this.available=0,this.pos=0,this.buffer=new Uint8Array(2e3)}function ddb(t){this._writeZlibHeader=t,this._state=t?DeflateState.ZLIB_HEADER:DeflateState.WRITE,this._adler32=t?new Adler32:null}function Ycb(){this.a=1,this.b=0}function createProbsArray(t){for(var e=new Uint16Array(t),i=0;i>>1|0)|0)>>31;(n=n+(i&r)|0)===i&&(this.corrupted=!0),0<=i&&i>>kNumBitModelTotalBits)*r,s=n>>>0>kNumMoveBits)|0,i=0|o,0):(r=r-(r>>kNumMoveBits)|0,n=n-o|0,i=i-o|0,1);return t[e]=65535&r,0<=i&&i>1),kMatchMinLen=2,LenDecoder=(ueb.prototype.decode=function(t,e){return 0===t.decodeBit(this.choice,0)?this.lowCoder[e].decode(t):0===t.decodeBit(this.choice,1)?8+this.midCoder[e].decode(t):16+this.highCoder.decode(t)},ueb);function ueb(){this.choice=createProbsArray(2),this.lowCoder=createBitTreeDecoderArray(3,1<>8-this.lc));if(7<=t){var a=i.getByte(e+1);do{var l=a>>7&1;a<<=1;var c=n.decodeBit(this.litProbs,s+((1+l<<8)+o)),o=o<<1|c;if(l!==c)break}while(o<256)}for(;o<256;)o=o<<1|n.decodeBit(this.litProbs,s+o);return o-256&255},Beb.prototype.decodeDistance=function(t){var e=t;kNumLenToPosStates-1>1)-1,o=(2|1&n)<>>0)-8;else{this._decoder.decodeProperties(r.subarray(0,5));for(var o=0,s=!1,a=0;a<8;a++){var l=r[5+a];255!==l&&(s=!0),o|=l<<8*a}this._decoder.markerIsMandatory=!s,this._decoder.unpackSize=s?o:void 0}this._decoder.create(),t=t.subarray(i),this._state=LzmaDecoderState.PROCESS_DATA}else if(this._state!==LzmaDecoderState.PROCESS_DATA)return;try{this._inStream.append(t);var c=this._decoder.decode(!0);this._inStream.compact(),c!==LZMA_RES_NOT_COMPLETE&&this._checkError(c)}catch(t){this._decoder.flushOutput(),this._decoder=null,this._error(t)}},ufb.prototype.close=function(){if(this._state===LzmaDecoderState.PROCESS_DATA){this._state=LzmaDecoderState.CLOSED;try{var t=this._decoder.decode(!1);this._checkError(t)}catch(t){this._decoder.flushOutput(),this._error(t)}this._decoder=null}},ufb.prototype._error=function(t){this._state=LzmaDecoderState.ERROR,this.onError&&this.onError(t)},ufb.prototype._checkError=function(t){var e;t===LZMA_RES_ERROR?e="LZMA decoding error":t===LZMA_RES_NOT_COMPLETE?e="Decoding is not complete":t===LZMA_RES_FINISHED_WITH_MARKER?void 0!==this._decoder.unpackSize&&this._decoder.unpackSize!==this._outStream.processed&&(e="Finished with end marker before than specified size"):e="Internal LZMA Error",e&&this._error(e)},ufb);function ufb(t){void 0===t&&(t=!1),this._state=t?LzmaDecoderState.WAIT_FOR_SWF_HEADER:LzmaDecoderState.WAIT_FOR_LZMA_HEADER,this.buffer=null}function axCoerceString$1(t){return"string"==typeof t?t:null==t?null:t+""}for(var PlainObjectDataBuffer=function(t,e,i){this.buffer=t,this.length=e,this.littleEndian=i},bitMasks=new Uint32Array(33),i=1,mask=0,TypedArrayViewFlags,Pfb;i<=32;i++)bitMasks[i]=mask=mask<<1|1;Pfb=TypedArrayViewFlags=TypedArrayViewFlags||{},Pfb[Pfb.U8=1]="U8",Pfb[Pfb.I32=2]="I32",Pfb[Pfb.F32=4]="F32";var DataBuffer=(Qfb.FromArrayBuffer=function(t,e){void 0===e&&(e=-1);var i=Object.create(Qfb.prototype);return i._buffer=t,i._length=-1===e?t.byteLength:e,i._position=0,i._resetViews(),i._littleEndian=Qfb._nativeLittleEndian,i._bitBuffer=0,i._bitLength=0,i},Qfb.FromPlainObject=function(t){var e=Qfb.FromArrayBuffer(t.buffer,t.length);return e._littleEndian=t.littleEndian,e},Qfb.prototype.toPlainObject=function(){return new PlainObjectDataBuffer(this._buffer,this._length,this._littleEndian)},Qfb.prototype.clone=function(){var t=Qfb.FromArrayBuffer(new Uint8Array(this._u8).buffer,this._length);return t._position=this._position,t._littleEndian=this._littleEndian,t._bitBuffer=this._bitBuffer,t._bitLength=this._bitLength,t},Qfb.prototype._resetViews=function(){this._u8=new Uint8Array(this._buffer),this._i32=null,this._f32=null},Qfb.prototype._requestViews=function(t){0==(3&this._buffer.byteLength)&&(null===this._i32&&t&TypedArrayViewFlags.I32&&(this._i32=new Int32Array(this._buffer)),null===this._f32&&t&TypedArrayViewFlags.F32&&(this._f32=new Float32Array(this._buffer)))},Qfb.prototype.getBytes=function(){return new Uint8Array(this._buffer,0,this._length)},Qfb.prototype._ensureCapacity=function(t){var e=this._buffer;if(!(e.byteLength>=t)){for(var i=Math.max(e.byteLength,1);i>24},Qfb.prototype.readUnsignedByte=function(){return this._position+1>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError)),this._u8[this._position++]},Qfb.prototype.readBytes=function(t,e,i){var n=this._position;e>>>=0,0==(i>>>=0)&&(i=this._length-n),n+i>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError)),t.length>16},Qfb.prototype.readUnsignedShort=function(){var t=this._u8,e=this._position;e+2>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError));var i=t[e+0],n=t[e+1];return this._position=e+2,this._littleEndian?n<<8|i:i<<8|n},Qfb.prototype.readInt=function(){var t=this._u8,e=this._position;e+4>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError));var i=t[e+0],n=t[e+1],r=t[e+2],o=t[e+3];return this._position=e+4,this._littleEndian?o<<24|r<<16|n<<8|i:i<<24|n<<16|r<<8|o},Qfb.prototype.readUnsignedInt=function(){return this.readInt()>>>0},Qfb.prototype.readFloat=function(){var t=this._position;if(t+4>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError)),this._position=t+4,this._requestViews(TypedArrayViewFlags.F32),this._littleEndian&&0==(3&t)&&this._f32)return this._f32[t>>2];var e=this._u8,i=IntegerUtilities.u8;return this._littleEndian?(i[0]=e[t+0],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3]):(i[3]=e[t+0],i[2]=e[t+1],i[1]=e[t+2],i[0]=e[t+3]),IntegerUtilities.f32[0]},Qfb.prototype.readDouble=function(){var t=this._u8,e=this._position;e+8>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError));var i=IntegerUtilities.u8;return this._littleEndian?(i[0]=t[e+0],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7]):(i[0]=t[e+7],i[1]=t[e+6],i[2]=t[e+5],i[3]=t[e+4],i[4]=t[e+3],i[5]=t[e+2],i[6]=t[e+1],i[7]=t[e+0]),this._position=e+8,IntegerUtilities.f64[0]},Qfb.prototype.writeBoolean=function(t){this.writeByte(t?1:0)},Qfb.prototype.writeByte=function(t){var e=this._position+1;this._ensureCapacity(e),this._u8[this._position++]=t,e>this._length&&(this._length=e)},Qfb.prototype.writeUnsignedByte=function(t){var e=this._position+1;this._ensureCapacity(e),this._u8[this._position++]=t,e>this._length&&(this._length=e)},Qfb.prototype.writeRawBytes=function(t){var e=this._position+t.length;this._ensureCapacity(e),this._u8.set(t,this._position),(this._position=e)>this._length&&(this._length=e)},Qfb.prototype.writeBytes=function(t,e,i){isNullOrUndefined(t)&&(assert(this.sec),this.sec.throwError("TypeError",Errors.NullPointerError,"bytes")),e>>>=0,i>>>=0,arguments.length<2&&(e=0),arguments.length<3&&(i=0),e===clamp(e,0,t.length)&&e+i===clamp(e+i,0,t.length)||(assert(this.sec),this.sec.throwError("RangeError",Errors.ParamRangeError)),0===i&&(i=t.length-e),this.writeRawBytes(new Uint8Array(t._buffer,e,i))},Qfb.prototype.writeShort=function(t){this.writeUnsignedShort(t)},Qfb.prototype.writeUnsignedShort=function(t){var e=this._position;this._ensureCapacity(e+2);var i=this._u8;this._littleEndian?(i[e+0]=t,i[e+1]=t>>8):(i[e+0]=t>>8,i[e+1]=t),e+=2,(this._position=e)>this._length&&(this._length=e)},Qfb.prototype.writeInt=function(t){this.writeUnsignedInt(t)},Qfb.prototype.write2Ints=function(t,e){this.write2UnsignedInts(t,e)},Qfb.prototype.write4Ints=function(t,e,i,n){this.write4UnsignedInts(t,e,i,n)},Qfb.prototype.writeUnsignedInt=function(t){var e,i=this._position;this._ensureCapacity(i+4),this._requestViews(TypedArrayViewFlags.I32),this._littleEndian===Qfb._nativeLittleEndian&&0==(3&i)&&this._i32?this._i32[i>>2]=t:(e=this._u8,this._littleEndian?(e[i+0]=t,e[i+1]=t>>8,e[i+2]=t>>16,e[i+3]=t>>24):(e[i+0]=t>>24,e[i+1]=t>>16,e[i+2]=t>>8,e[i+3]=t)),i+=4,(this._position=i)>this._length&&(this._length=i)},Qfb.prototype.write2UnsignedInts=function(t,e){var i=this._position;this._ensureCapacity(i+8),this._requestViews(TypedArrayViewFlags.I32),this._littleEndian===Qfb._nativeLittleEndian&&0==(3&i)&&this._i32?(this._i32[i>>2]=t,this._i32[1+(i>>2)]=e,i+=8,(this._position=i)>this._length&&(this._length=i)):(this.writeUnsignedInt(t),this.writeUnsignedInt(e))},Qfb.prototype.write4UnsignedInts=function(t,e,i,n){var r=this._position;this._ensureCapacity(r+16),this._requestViews(TypedArrayViewFlags.I32),this._littleEndian===Qfb._nativeLittleEndian&&0==(3&r)&&this._i32?(this._i32[r>>2]=t,this._i32[1+(r>>2)]=e,this._i32[2+(r>>2)]=i,this._i32[3+(r>>2)]=n,r+=16,(this._position=r)>this._length&&(this._length=r)):(this.writeUnsignedInt(t),this.writeUnsignedInt(e),this.writeUnsignedInt(i),this.writeUnsignedInt(n))},Qfb.prototype.writeFloat=function(t){var e,i,n=this._position;this._ensureCapacity(n+4),this._requestViews(TypedArrayViewFlags.F32),this._littleEndian===Qfb._nativeLittleEndian&&0==(3&n)&&this._f32?this._f32[n>>2]=t:(e=this._u8,IntegerUtilities.f32[0]=t,i=IntegerUtilities.u8,this._littleEndian?(e[n+0]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3]):(e[n+0]=i[3],e[n+1]=i[2],e[n+2]=i[1],e[n+3]=i[0])),n+=4,(this._position=n)>this._length&&(this._length=n)},Qfb.prototype.write2Floats=function(t,e){var i=this._position;this._ensureCapacity(i+8),this._requestViews(TypedArrayViewFlags.F32),this._littleEndian===Qfb._nativeLittleEndian&&0==(3&i)&&this._f32?(this._f32[i>>2]=t,this._f32[1+(i>>2)]=e,i+=8,(this._position=i)>this._length&&(this._length=i)):(this.writeFloat(t),this.writeFloat(e))},Qfb.prototype.write6Floats=function(t,e,i,n,r,o){var s=this._position;this._ensureCapacity(s+24),this._requestViews(TypedArrayViewFlags.F32),this._littleEndian===Qfb._nativeLittleEndian&&0==(3&s)&&this._f32?(this._f32[s>>2]=t,this._f32[1+(s>>2)]=e,this._f32[2+(s>>2)]=i,this._f32[3+(s>>2)]=n,this._f32[4+(s>>2)]=r,this._f32[5+(s>>2)]=o,s+=24,(this._position=s)>this._length&&(this._length=s)):(this.writeFloat(t),this.writeFloat(e),this.writeFloat(i),this.writeFloat(n),this.writeFloat(r),this.writeFloat(o))},Qfb.prototype.writeDouble=function(t){var e=this._position;this._ensureCapacity(e+8);var i=this._u8;IntegerUtilities.f64[0]=t;var n=IntegerUtilities.u8;this._littleEndian?(i[e+0]=n[0],i[e+1]=n[1],i[e+2]=n[2],i[e+3]=n[3],i[e+4]=n[4],i[e+5]=n[5],i[e+6]=n[6],i[e+7]=n[7]):(i[e+0]=n[7],i[e+1]=n[6],i[e+2]=n[5],i[e+3]=n[4],i[e+4]=n[3],i[e+5]=n[2],i[e+6]=n[1],i[e+7]=n[0]),e+=8,(this._position=e)>this._length&&(this._length=e)},Qfb.prototype.readRawBytes=function(){return new Int8Array(this._buffer,0,this._length)},Qfb.prototype.writeUTF=function(t){var e=utf8decode(t=axCoerceString$1(t));this.writeShort(e.length),this.writeRawBytes(e)},Qfb.prototype.writeUTFBytes=function(t){var e=utf8decode(t=axCoerceString$1(t));this.writeRawBytes(e)},Qfb.prototype.readUTF=function(){return this.readUTFBytes(this.readShort())},Qfb.prototype.readUTFBytes=function(t){t>>>=0;var e=this._position;return e+t>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError)),this._position+=t,utf8encode(new Uint8Array(this._buffer,e,t))},Object.defineProperty(Qfb.prototype,"length",{get:function(){return this._length},set:function(t){(t>>>=0)>this._buffer.byteLength&&this._ensureCapacity(t),this._length=t,this._position=clamp(this._position,0,this._length)},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"bytesAvailable",{get:function(){return this._length-this._position},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"position",{get:function(){return this._position},set:function(t){this._position=t>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"buffer",{get:function(){return this._buffer},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"bytes",{get:function(){return this._u8},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"ints",{get:function(){return this._requestViews(TypedArrayViewFlags.I32),this._i32},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"objectEncoding",{get:function(){return this._objectEncoding},set:function(t){t>>>=0,this._objectEncoding=t},enumerable:!0,configurable:!0}),Object.defineProperty(Qfb.prototype,"endian",{get:function(){return this._littleEndian?"littleEndian":"bigEndian"},set:function(t){t=axCoerceString$1(t),this._littleEndian="auto"===t?Qfb._nativeLittleEndian:"littleEndian"===t},enumerable:!0,configurable:!0}),Qfb.prototype.toString=function(){return utf8encode(new Uint8Array(this._buffer,0,this._length))},Qfb.prototype.toBlob=function(t){return new Blob([new Uint8Array(this._buffer,this._position,this._length)],{type:t})},Qfb.prototype.writeMultiByte=function(t,e){console.log("packageInternal flash.utils.ObjectOutput::writeMultiByte")},Qfb.prototype.readMultiByte=function(t,e){console.log("packageInternal flash.utils.ObjectInput::readMultiByte")},Qfb.prototype.getValue=function(t){if(!((t|=0)>=this._length))return this._u8[t]},Qfb.prototype.setValue=function(t,e){var i=1+(t|=0);this._ensureCapacity(i),this._u8[t]=e,i>this._length&&(this._length=i)},Qfb.prototype.readFixed=function(){return this.readInt()/65536},Qfb.prototype.readFixed8=function(){return this.readShort()/256},Qfb.prototype.readFloat16=function(){var t=this.readUnsignedShort(),e=t>>15?-1:1,i=(31744&t)>>10,n=1023&t;return i?31==i?n?NaN:1/0*e:e*Math.pow(2,i-15)*(1+n/1024):e*Math.pow(2,-14)*(n/1024)},Qfb.prototype.readEncodedU32=function(){var t=this.readUnsignedByte();return 128&t&&16384&(t=127&t|this.readUnsignedByte()<<7)&&2097152&(t=16383&t|this.readUnsignedByte()<<14)&&268435456&(t=2097151&t|this.readUnsignedByte()<<21)?268435455&t|this.readUnsignedByte()<<28:t},Qfb.prototype.readBits=function(t){return this.readUnsignedBits(t)<<32-t>>32-t},Qfb.prototype.readUnsignedBits=function(t){for(var e=this._bitBuffer,i=this._bitLength;i>>(i-=t)&bitMasks[t];return this._bitBuffer=e,this._bitLength=i,n},Qfb.prototype.readFixedBits=function(t){return this.readBits(t)/65536},Qfb.prototype.readString=function(t){var e=this._position;if(t)e+t>this._length&&(assert(this.sec),this.sec.throwError("flash.errors.EOFError",Errors.EOFError)),this._position+=t;else{t=0;for(var i=e;i>2)-2,n=t[i]+","+t[1+i];this.isReversed?(this.startPoint=n,this.endPoint=e):(this.startPoint=e,this.endPoint=n)},iib.prototype.connectsTo=function(t){return t!==this&&(assert(this.endPoint),assert(t.startPoint),this.endPoint===t.startPoint)},iib.prototype.startConnectsTo=function(t){return t!==this&&this.startPoint===t.startPoint},iib.prototype.flipDirection=function(){var t=this.startPoint;this.startPoint=this.endPoint,this.endPoint=t,this.isReversed=!this.isReversed},iib.prototype.serializeAJS=function(t,e,i){if(this.isReversed)this._serializeReversedAJS(t,e,i);else{var n=this.commands.bytes,r=this.data.length>>2,o=this.morphData?this.morphData.ints:null,s=this.data.ints;assert(9===n[0]);var a=0;s[0]===i.x&&s[1]===i.y&&a++;for(var l=this.commands.length,c=2*a,h=a;h>2)-2,o=this.commands.bytes;assert(9===o[0]);var s=this.data.ints,a=this.morphData?this.morphData.ints:null;if(s[r]===i.x&&s[r+1]===i.y||(t.moveTo(s[r]/20,s[r+1]/20),e&&e.moveTo(a[r]/20,a[r+1]/20)),1===n)return i.x=s[0],void(i.y=s[1]);for(var l=n;1=this.ratio_max)e=this.ratios.length-1,i=this.ratios.length-1;else for(var n=0,n=0;n=this.ratios[n]&&t<=this.ratios[n+1]){i=(e=n)+1;break}}if(e==i)return[this.alphas[e],this.colors_r[e],this.colors_g[e],this.colors_b[e]];var r=(t-this.ratios[e])/(this.ratios[i]-this.ratios[e]),o=1-r;return[this.alphas[i]*r+this.alphas[e]*o,this.colors_r[i]*r+this.colors_r[e]*o,this.colors_g[i]*r+this.colors_g[e]*o,this.colors_b[i]*r+this.colors_b[e]*o]},vjb.prototype.toString=function(){for(var t="",e=this.colors.length;0>>24<<16|(16711680&t)>>>16<<8|(65280&t)>>>8},Mkb.prototype.getAlpha=function(t){return 255&t},Mkb.prototype.rgbToArgb=function(t){return(4278190080&t)>>>24<<24|(255&t)<<16|(65280&t)>>>8<<8|(16711680&t)>>>16},Mkb.prototype.serializeAJS=function(t,e){var i=this.head();if(i){if(this.fillStyle){var n=(l=this.fillStyle).morph;switch(l.type){case FillType.Solid:l.alpha=this.getAlpha(l.color)/255,l.color=this.rgbaToArgb(l.color),t.style=new GraphicsFillStyle(l.color,l.alpha),n&&(n.alpha=this.getAlpha(n.color)/255,n.color=this.rgbaToArgb(n.color),e.style=new GraphicsFillStyle(n.color,n.alpha));break;case FillType.LinearGradient:case FillType.RadialGradient:case FillType.FocalRadialGradient:for(var r=l.type===FillType.LinearGradient?GradientType.LINEAR:GradientType.RADIAL,o=[],s=0;sn*x||(k=g*v-y*b)>x*x||k<0))return!0}if(150<_){var A=f.cells,S=A.length?f.divisions:f.divisions=Math.min(Math.ceil(Math.sqrt(_)),32),w=S/r.width,C=S/r.height,P=r.x,E=r.y;if(!A.length){A.length=S*S;for(var T=0;T<_;T+=3){U=l?(c=l[T]*p,l[T+1]*p):(c=T*p,(T+1)*p),j=d[c],G=d[c+1],z=d[U],h=d[U+1];for(var M=Math.floor((Math.min(j,z)-P)*w),D=Math.floor((Math.min(G,h)-E)*C),I=Math.floor((Math.max(j,z)-P)*w),O=Math.floor((Math.max(G,h)-E)*C),L=M;L<=I;L++)for(var F=D;F<=O;F++){var B,N=L+F*S;(B=A[N]||(A[N]=new Array)).push(T)}}}if(null==(B=A[Math.floor((t-P)*w)+Math.floor((e-E)*C)*S]))return!(f.lastCollisionIndex=-1);for(var R=B.length,V=0;Vn*x||(k=g*v-y*b)>x*x||k<0))return f.lastCollisionIndex=T,!0;return!(f.lastCollisionIndex=-1)}for(T=0;T<_;T+=6){var k,U=l?(c=l[T]*p,l[T+1]*p):(c=T*p,(T+1)*p),j=d[c],G=d[c+1],z=d[U],g=j-t,y=G-e,b=(h=d[U+1])-G,v=-(z-j),x=Math.sqrt(b*b+v*v);if(!(Math.abs(g*b+y*v)>n*x||(k=g*v-y*b)>x*x||k<0))return f.lastCollisionIndex=T,!0}return!(f.lastCollisionIndex=-1)},Ssb.getBoxBounds=function(t,e,i,n,r,o,s,a){void 0===a&&(a=0);var l,c,h=t.dimensions,u=t.stride,p=0,d=0,_=0,f=0,m=e?(c=s*e.dimensions,l=e.get(s,a),t.get(t.count)):(c=s,t.get(s,a));if(0==c)return o;var g,y,b,v,x=0;for(i&&(v=i._rawData),x=0;x.5/(i.focalLength*i.pixelRatio)?this._scale.x*this._thickness/1e3:.5/(s.half_thickness*i.focalLength*i.pixelRatio),o[r+13]=s.half_thickness*this._scale.y*this._thickness/1e3>.5/i.focalLength?this._scale.y*this._thickness/1e3:.5/(s.half_thickness*i.focalLength)):s&&s.scaleMode!=LineScaleMode.HAIRLINE?(o[r+12]=this._thickness/Math.min(i.width,i.height),o[r+13]=this._thickness/Math.min(i.width,i.height)):(o[r+12]=this._thickness/(i.focalLength*i.pixelRatio),o[r+13]=this._thickness/i.focalLength),o[r+14]=i.projection.near,this._stage.context},Lvb.prototype.draw=function(t,e,i,n){var r=this._stage.context;e.viewMatrix.copyFrom(e.view.frustumMatrix3D,!0);var o=Matrix3D.CALCULATION_MATRIX;o.copyFrom(t.sourceEntity.transform.concatenatedMatrix3D),o.append(e.view.projection.transform.inverseConcatenatedMatrix3D),e.sceneMatrix.copyFrom(o,!0),r.setProgramConstantsFromArray(ContextGLProgramType.VERTEX,e.vertexConstantData),r.setProgramConstantsFromArray(ContextGLProgramType.FRAGMENT,e.fragmentConstantData),this._indices?this.getIndexBufferGL().draw(ContextGLDrawMode.TRIANGLES,3*n,3*i||this.numIndices):this._stage.context.drawVertices(ContextGLDrawMode.TRIANGLES,n,i||this.numVertices)},Lvb.prototype._pGetOverflowElements=function(){return new Lvb(this._lineElements,this._stage)},Lvb),_Render_LineElements=(bwb=_Render_ElementsBase,__extends(cwb,bwb),cwb.prototype._includeDependencies=function(t){},cwb.prototype._getVertexCode=function(t,e,i){var n=0this.size||this.leq(r[o].key,r[e].key)){r[n[t].handle=o].node=t;break}r[n[t].handle=e].node=t,t=i}},floatUp_:function(t){for(var e,i,n=this.nodes,r=this.handles,o=n[t].handle;;){if(e=n[i=t>>1].handle,0==i||this.leq(r[e].key,r[o].key)){r[n[t].handle=o].node=t;break}r[n[t].handle=e].node=t,t=i}},init:function(){for(var t=this.size;1<=t;--t)this.floatDown_(t);this.initialized=!0},min:function(){return this.handles[this.nodes[1].handle].key},isEmpty:function(){this.size},insert:function(t){var e,i,n;if(2*(e=++this.size)>this.max){this.max*=2,n=this.nodes.length,this.nodes.length=this.max+1;for(var r=n;r>1].handle].key,n[i[e].handle].key)?this.floatDown_(e):this.floatUp_(e)),n[t].key=null,n[t].node=this.freeList,this.freeList=t}};var Sweep={};function Tesselator(){this.mesh=null,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=Tess2.WINDING_ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}Sweep.regionBelow=function(t){return t.nodeUp.prev.key},Sweep.regionAbove=function(t){return t.nodeUp.next.key},Sweep.debugEvent=function(t){},Sweep.addWinding=function(t,e){t.winding+=e.winding,t.Sym.winding+=e.Sym.winding},Sweep.edgeLeq=function(t,e,i){var n=t.event,r=e.eUp,o=i.eUp;return r.Dst===n?o.Dst===n?Geom.vertLeq(r.Org,o.Org)?Geom.edgeSign(o.Dst,r.Org,o.Org)<=0:0<=Geom.edgeSign(r.Dst,o.Org,r.Org):Geom.edgeSign(o.Dst,n,o.Org)<=0:o.Dst===n?0<=Geom.edgeSign(r.Dst,n,r.Org):Geom.edgeEval(r.Dst,n,r.Org)>=Geom.edgeEval(o.Dst,n,o.Org)},Sweep.deleteRegion=function(t,e){e.fixUpperEdge&&assert$1(0===e.eUp.winding),e.eUp.activeRegion=null,t.dict.delete(e.nodeUp)},Sweep.fixUpperEdge=function(t,e,i){assert$1(e.fixUpperEdge),t.mesh.delete(e.eUp),e.fixUpperEdge=!1,(e.eUp=i).activeRegion=e},Sweep.topLeftRegion=function(t,e){for(var i,n=e.eUp.Org;(e=Sweep.regionAbove(e)).eUp.Org===n;);if(e.fixUpperEdge){if(null===(i=t.mesh.connect(Sweep.regionBelow(e).eUp.Sym,e.eUp.Lnext)))return null;Sweep.fixUpperEdge(t,e,i),e=Sweep.regionAbove(e)}return e},Sweep.topRightRegion=function(t){var e=t.eUp.Dst;for(t=null;(t=Sweep.regionAbove(t)).eUp.Dst===e;);return t},Sweep.addRegionBelow=function(t,e,i){var n=new ActiveRegion;return n.eUp=i,n.nodeUp=t.dict.insertBefore(e.nodeUp,n),n.fixUpperEdge=!1,n.sentinel=!1,n.dirty=!1,i.activeRegion=n},Sweep.isWindingInside=function(t,e){switch(t.windingRule){case Tess2.WINDING_ODD:return 0!=(1&e);case Tess2.WINDING_NONZERO:return 0!=e;case Tess2.WINDING_POSITIVE:return 0Math.max(l.t,h.t))return!1;if(Geom.vertLeq(a,l)){if(0Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e},computeNormal_:function(t){for(var e,i,n,r,o,s=[0,0,0],a=[0,0,0],l=[0,0,0],c=[0,0,0],h=[0,0,0],u=[null,null,null],p=[null,null,null],d=this.mesh.vHead,_=d.next,f=0;f<3;++f)n=_.coords[f],a[f]=n,p[f]=_,s[f]=n,u[f]=_;for(_=d.next;_!==d;_=_.next)for(f=0;f<3;++f)(n=_.coords[f])s[f]&&(s[f]=n,u[f]=_);if(f=0,s[1]-a[1]>s[0]-a[0]&&(f=1),s[2]-a[2]>s[f]-a[f]&&(f=2),a[f]>=s[f])return t[0]=0,t[1]=0,void(t[2]=1);for(o=0,e=p[f],i=u[f],l[0]=e.coords[0]-i.coords[0],l[1]=e.coords[1]-i.coords[1],l[2]=e.coords[2]-i.coords[2],_=d.next;_!==d;_=_.next)c[0]=_.coords[0]-i.coords[0],c[1]=_.coords[1]-i.coords[1],c[2]=_.coords[2]-i.coords[2],h[0]=l[1]*c[2]-l[2]*c[1],h[1]=l[2]*c[0]-l[0]*c[2],h[2]=l[0]*c[1]-l[1]*c[0],(r=h[0]*h[0]+h[1]*h[1]+h[2]*h[2])>o&&(o=r,t[0]=h[0],t[1]=h[1],t[2]=h[2]);o<=0&&(t[0]=t[1]=t[2]=0,t[this.longAxis_(l)]=1)},checkOrientation_:function(){for(var t,e,i=this.mesh.fHead,n=this.mesh.vHead,r=0,o=i.next;o!==i;o=o.next)if(!((e=o.anEdge).winding<=0))for(;r+=(e.Org.s-e.Dst.s)*(e.Org.t+e.Dst.t),(e=e.Lnext)!==o.anEdge;);if(r<0){for(t=n.next;t!==n;t=t.next)t.t=-t.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},projectPolygon_:function(){var t,e,i,n,r,o=this.mesh.vHead,s=[0,0,0],a=!1;for(s[0]=this.normal[0],s[1]=this.normal[1],s[2]=this.normal[2],0===s[0]&&0===s[1]&&0===s[2]&&(this.computeNormal_(s),a=!0),e=this.sUnit,i=this.tUnit,e[n=this.longAxis_(s)]=0,e[(n+1)%3]=1,e[(n+2)%3]=0,i[n]=0,i[(n+1)%3]=0,i[(n+2)%3]=0this.bmax[0]&&(this.bmax[0]=t.s),t.tthis.bmax[1]&&(this.bmax[1]=t.t))},addWinding_:function(t,e){t.winding+=e.winding,t.Sym.winding+=e.Sym.winding},tessellateMonoRegion_:function(t,e){var i,n=e.anEdge;for(assert$1(n.Lnext!==n&&n.Lnext.Lnext!==n);Geom.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;Geom.vertLeq(n.Org,n.Dst);n=n.Lnext);for(i=n.Lprev;n.Lnext!==i;)if(Geom.vertLeq(n.Dst,i.Org)){for(;i.Lnext!==n&&(Geom.edgeGoesLeft(i.Lnext)||Geom.edgeSign(i.Org,i.Dst,i.Lnext.Dst)<=0);)i=t.connect(i.Lnext,i).Sym;i=i.Lprev}else{for(;i.Lnext!=n&&(Geom.edgeGoesRight(n.Lprev)||0<=Geom.edgeSign(n.Dst,n.Org,n.Lprev.Org));)n=t.connect(n,n.Lprev).Sym;n=n.Lnext}for(assert$1(i.Lnext!==n);i.Lnext.Lnext!==n;)i=t.connect(i.Lnext,i).Sym;return!0},tessellateInterior_:function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e)if(e=i.next,i.inside&&!this.tessellateMonoRegion_(t,i))return!1;return!0},discardExterior_:function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e)e=i.next,i.inside||t.zapFace(i)},setWindingNumber_:function(t,e,i){for(var n,r=t.eHead.next;r!==t.eHead;r=n)n=r.next,r.Rface.inside!==r.Lface.inside?r.winding=r.Lface.inside?e:-e:i?t.delete(r):r.winding=0},getNeighbourFace_:function(t){return t.Rface&&t.Rface.inside?t.Rface.n:-1},outputPolymesh_:function(t,e,i,n){var r,o,s,a,l,c=0,h=0;for(3=GraphicsPathCommand.BUILD_JOINT&&(j=nt[ot++],G=nt[ot++],R=nt[ot++],V=nt[ot++],k=nt[ot++],U=nt[ot++],GraphicsFactoryHelper.addTriangle(R,V,k,U,j,G,0,l,e),it[h]==GraphicsPathCommand.BUILD_ROUND_JOINT&&(z=nt[ot++],$=nt[ot++],R=nt[ot++],V=nt[ot++],k=nt[ot++],U=nt[ot++],GraphicsFactoryHelper.tesselateCurve(R,V,z,$,k,U,l,!0)));H||(d.x=o[2]-o[0],d.y=o[3]-o[1],d.normalize(),GraphicsFactoryHelper.createCap(o[0],o[1],nt[0],nt[1],nt[2],nt[3],d.x,d.y,r.capstyle,-1,tt,et,l,e),d.x=o[o.length-2]-o[o.length-4],d.y=o[o.length-1]-o[o.length-3],d.normalize(),GraphicsFactoryHelper.createCap(o[o.length-2],o[o.length-1],nt[nt.length-4],nt[nt.length-3],nt[nt.length-2],nt[nt.length-1],d.x,d.y,r.capstyle,1,tt,et,l,e))}if(0!=l.length){var at=new AttributesView(Float32Array,e?3:2);at.set(l);var lt=at.attributesBuffer.cloneBufferView();at.dispose();var ct=new TriangleElements(lt);return ct.setPositions(new Float2Attributes(lt)),ct}},IKb),GraphicsPathWinding=(vMb.EVEN_ODD="evenOdd",vMb.NON_ZERO="nonZero",vMb),GraphicsPath=(Object.defineProperty(wMb.prototype,"dirty",{get:function(){return this._lastDirtyID!==this._dirtyID},enumerable:!0,configurable:!0}),Object.defineProperty(wMb.prototype,"data_type",{get:function(){return wMb.data_type},enumerable:!0,configurable:!0}),Object.defineProperty(wMb.prototype,"style",{get:function(){return this._style},set:function(t){this._style=t,this._dirtyID++},enumerable:!0,configurable:!0}),Object.defineProperty(wMb.prototype,"fill",{get:function(){return null!=this._style&&this._style.data_type==GraphicsFillStyle.data_type?this._style:null},enumerable:!0,configurable:!0}),Object.defineProperty(wMb.prototype,"stroke",{get:function(){return null!=this._style&&this._style.data_type==GraphicsStrokeStyle.data_type?this._style:null},enumerable:!0,configurable:!0}),Object.defineProperty(wMb.prototype,"commands",{get:function(){return this._commands},enumerable:!0,configurable:!0}),Object.defineProperty(wMb.prototype,"data",{get:function(){return this._data},enumerable:!0,configurable:!0}),wMb.prototype.cacheSegment=function(t,e,i,n,r,o,s,a,l){void 0===a&&(a=null),void 0===l&&(l=null);var c=i.toString()+"#";c+=o=this._commands[this._mergeSource].length&&(f-=this._commands[this._mergeSource].length),f<0&&(f+=this._commands[this._mergeSource].length),this._commands[this._mergeSource][f]){case GraphicsPathCommand.LINE_TO:m=this.data[this._mergeSource][this._positionOffset[this._mergeSource][f]],g=this.data[this._mergeSource][this._positionOffset[this._mergeSource][f]+1],this._positions[this._mergetarget].push(m),this._positions[this._mergetarget].push(g),y=m,b=g;break;case GraphicsPathCommand.CURVE_TO:for(v=this.data[this._mergeSource][this._positionOffset[this._mergeSource][f]],x=this.data[this._mergeSource][this._positionOffset[this._mergeSource][f]+1],m=this.data[this._mergeSource][this._positionOffset[this._mergeSource][f]+2],g=this.data[this._mergeSource][this._positionOffset[this._mergeSource][f]+3],_=[],GraphicsFactoryHelper.tesselateCurve(y,b,v,x,m,g,_),S=_.length,A=0;A=this._shapes.length)throw new RangeError$1("Index is out of range");var e=this._shapes.splice(t,1)[0];e.removeEventListener(RenderableEvent.INVALIDATE_ELEMENTS,this._onInvalidateDelegate),e.removeEventListener(RenderableEvent.INVALIDATE_MATERIAL,this._onInvalidateDelegate),e.removeEventListener(RenderableEvent.INVALIDATE_STYLE,this._onInvalidateDelegate),e.removeEventListener(AssetEvent.INVALIDATE,this._onInvalidateDelegate),e.usages--,e.usages||e.dispose(),this.invalidate()},qOb.prototype.getShapeAt=function(t){return this._shapes[t]},qOb.prototype.getShapeIndex=function(t){return this._shapes.indexOf(t)},qOb.prototype.applyTransformation=function(t){for(var e=this._shapes.length,i=0;i>1),s=i+((r=0|t.deltaY)>>1),e+=n,i+=r):(o=e+t.controlDeltaX|0,s=i+t.controlDeltaY|0,e=o+t.anchorDeltaX|0,i=s+t.anchorDeltaY|0),{cx:o,cy:s,x:e,y:i}},qOb._pool=new Array,qOb.assetType="[asset Graphics]",qOb),IDENTITY_MATRIX={a:1,b:0,c:0,d:1,tx:0,ty:0},pOb;function qOb(){var e=pOb.call(this)||this;return e._bitmapFillPool={},e._queuedShapeTags=[],e._shapes=[],e._current_position=new Point,e._scale=new Vector3D,e._scaleX=0,e._scaleY=0,e._drawingDirty=!1,e.usages=0,e.push=Array.prototype.push,e._drawingDirty=!1,e._current_position=new Point,e._queued_fill_pathes=[],e._queued_stroke_pathes=[],e._active_fill_path=null,e._active_stroke_path=null,e._fillStyle=null,e._lineStyle=null,e._onInvalidateDelegate=function(t){return e._onInvalidate(t)},e}function mOb(){}function lOb(){}function wMb(t,e,i){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=GraphicsPathWinding.EVEN_ODD),this._orientedBoxBoundsDirty=!0,this._lastDirtyID=0,this._dirtyID=-1,this._startMerge=-1,this._endMerge=-1,this._mergeSource=-1,this._mergetarget=-1,this._connectedIdx=[],this._positionOffset=[],this.forceClose=!1,this._cache={},this._cacheSharedSegments={},this._data=[],this._commands=[],this._style=null,this.verts=[],this._positions=[],null!=t&&null!=e?(this._data[0]=e,this._commands[0]=t):(this._data[0]=[],this._commands[0]=[]),this._startPoint=new Point,this._cur_point=new Point,this._winding_rule=i,this._winding_directions=[]}function vMb(){}function IKb(){}function HKb(){}function TJb(){}function processStyle(t,e,i,n){var r,o=t;if(i&&(o.morph=processMorphStyle(t,e)),e){if(o.miterLimit=2*(t.miterLimitFactor||1.5),t.color||!t.hasFill)return o.type=FillType.Solid,o;var s=processStyle(t.fillStyle,!1,!1,n);return o.type=s.type,o.transform=s.transform,o.colors=s.colors,o.ratios=s.ratios,o.focalPoint=s.focalPoint,o.bitmapId=s.bitmapId,o.material=s.material,o.repeat=s.repeat,t.fillStyle=null,o}if(void 0===t.type||t.type===FillType.Solid)return o;switch(t.type){case FillType.LinearGradient:case FillType.RadialGradient:case FillType.FocalRadialGradient:for(var a=t.records,l=o.colors=[],c=o.ratios=[],h=0;hthis._children.length)throw new RangeError$1("endIndex is out of range of the child list");for(var i=e-1;t<=i;i--)this.removeChildAtInternal(i)._setParent(null)},XWb.prototype.setChildIndex=function(t,e){},XWb.prototype.swapChildren=function(t,e){t.parent==this&&e.parent==this&&this.swapChildrenAt(this.getChildIndex(t),this.getChildIndex(e))},XWb.prototype.swapChildrenAt=function(t,e){var i=this._children[e]._depthID,n=this._children[t];this.addChildAtDepth(this._children[e],this._children[t]._depthID),this.addChildAtDepth(n,i)},XWb.prototype._invalidateHierarchicalProperties=function(t){if(WWb.prototype._invalidateHierarchicalProperties.call(this,t))return!0;for(var e=this._children.length,i=0;i=e.t;)e.dt-=e.t,e.f(),e.isTimeout&&delete this._active_intervals[i]},yZb.add_child_to_dispose=function(t){this._queued_dispose.push(t)},yZb.add_queue=function(){yZb._queue.length<2&&yZb._queue.push({queued_mcs:[],queued_scripts:[],queued_mcs_pass2:[],queued_scripts_pass2:[],constructors:[]})},yZb.get_queue=function(){for(;yZb._queue.length<2;)yZb.add_queue();return 0i&&this._labels[n].keyFrameIndex<=t.constructedKeyFrameIndex&&(i=this._labels[n].keyFrameIndex,e=this._labels[n].name);return e},v$b.prototype.jumpToLabel=function(t,e,i){void 0===i&&(i=0);var n=this._labels[e].keyFrameIndex;0<=n&&(t.currentFrameIndex=this.keyframe_firstframes[n]+i)},v$b.prototype.getScriptForLabel=function(t,e){var i=this._labels[e.toLowerCase()].keyFrameIndex;if(i<0)return null;var n=this.keyframe_firstframes[i];return 0<=n&&null!=this._framescripts[n]?(null==this._framescripts_translated[n]&&(this._framescripts[n]=t.adapter.addScript(this._framescripts[n],n),this._framescripts_translated[n]=!0),this._framescripts[n]):void 0},v$b.prototype.gotoFrame=function(t,e,i,n,r){void 0===i&&(i=!0),void 0===n&&(n=!1),void 0===r&&(r=!1);var o,s,a=t.constructedKeyFrameIndex,l=this.keyframe_indices[e],c=!1;if(a==l){if(!r)return;c=!0}if(a+1!=l){var h=this.keyframe_constructframes[l],u=ai)continue;for(this._blocked=Boolean(s._adapter&&s.adapter.isBlockedByScript()),o=(r=this.update_child_props_indices_stream[c])+this.update_child_props_length_stream[c],n=r;n\n"},S7b.prototype.activate=function(){var t=this._shader.renderMaterial.samplers[this._imageIndex];this._shader.renderMaterial.images[this._imageIndex].activate(this._textureIndex,t)},S7b.prototype._setRenderState=function(t){var e=t.samplers[this._imageIndex],i=t.images[this._imageIndex];i&&e&&i.activate(this._textureIndex,e)},S7b),R7b,L7b,J7b,F7b,u7b,r7b,o7b,l7b,f7b,z6b;function S7b(){return null!==R7b&&R7b.apply(this,arguments)||this}function M7b(t){void 0===t&&(t=null);var e=L7b.call(this)||this;return e.setNumImages(1),e.image=t,e}function K7b(){return null!==J7b&&J7b.apply(this,arguments)||this}function G7b(t){void 0===t&&(t=null);var e=F7b.call(this)||this;return e._mappingMode=t||MappingMode.LINEAR,e}function v7b(){var t=u7b.call(this)||this;return t._numImages=0,t._images=new Array,t._samplers=new Array,t}function s7b(t){return r7b.call(this,t)||this}function p7b(t){return o7b.call(this,t)||this}function m7b(t){return l7b.call(this,t)||this}function g7b(t){return f7b.call(this,t)||this}function A6b(t,e){var i;void 0===t&&(t=!0),void 0===e&&(e=null);var n=z6b.call(this)||this;return n._useAssetLib=t,n._assetLibId=e,n._onLoaderStartDelegate=function(t){return n._onLoaderStart(t)},n._onLoadProgressDelegate=function(t){return n._onLoadProgress(t)},n._onLoadCompleteDelegate=function(t){return n._onLoadComplete(t)},n._onAssetCompleteDelegate=function(t){return n._onAssetComplete(t)},n._onLoaderCompleteDelegate=function(t){return n._onLoaderComplete(t)},n._onLoadErrorDelegate=function(t){return n._onLoadError(t)},n._onParseErrorDelegate=function(t){return n._onParseError(t)},n._errorDelegateSelector=((i={})[URLLoaderEvent.LOAD_ERROR]=n._onLoadErrorDelegate,i[ParserEvent.PARSE_ERROR]=n._onParseErrorDelegate,i),n}ShaderBase.registerAbstraction(_Shader_ImageTexture,ImageTextureCube);var ImageTexture2D=(a8b=Texture2D,__extends(b8b,a8b),Object.defineProperty(b8b.prototype,"assetType",{get:function(){return b8b.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(b8b.prototype,"sampler",{get:function(){return this._samplers[0]},set:function(t){this._samplers[0]!=t&&this.setSamplerAt(t,0)},enumerable:!0,configurable:!0}),Object.defineProperty(b8b.prototype,"image",{get:function(){return this._images[0]},set:function(t){if(this._images[0]!=t){if(!ImageUtils.isImage2DValid(t))throw new ErrorBase("Invalid imageData: Width and height must be power of 2 and cannot exceed 2048");this.setImageAt(t,0)}},enumerable:!0,configurable:!0}),b8b.assetType="[texture ImageTexture2D]",b8b),_Shader_ImageTexture2D=(h8b=_Shader_ImageTexture,__extends(i8b,h8b),i8b.prototype._getFragmentCode=function(t,e,i,n){var r,o,s="";return this._texture.mappingMode==MappingMode.RADIAL&&(s+="mul "+(r=e.getFreeFragmentVectorTemp())+".xy, "+n+", "+n+"\n",s+="add "+r+".x, "+r+".x, "+r+".y\n",s+="sub "+r+".y, "+r+".y, "+r+".y\n",s+="sqt "+r+".x, "+r+".x, "+r+".x\n",n=r),this._shader.useImageRect&&(o=e.getFreeFragmentConstant(),this._samplerIndex=4*o.index,s+="mul "+(r=e.getFreeFragmentVectorTemp())+", "+n+", "+o+".xy\n",s+="add "+r+", "+r+", "+o+".zw\n",n=r),s+=h8b.prototype._getFragmentCode.call(this,t,e,i,n),this._shader.usesPremultipliedAlpha&&(s+="div "+t+".xyz, "+t+", "+t+".w\n"),s},i8b.prototype.activate=function(){h8b.prototype.activate.call(this);var t,e,i=this._shader.renderMaterial.samplers[this._imageIndex];this._shader.useImageRect&&(t=this._samplerIndex,e=this._shader.fragmentConstantData,i.imageRect?(e[t]=i.imageRect.width,e[t+1]=i.imageRect.height,e[t+2]=i.imageRect.x,e[t+3]=i.imageRect.y):(e[t]=1,e[t+1]=1,e[t+2]=0,e[t+3]=0))},i8b.prototype._setRenderState=function(t){h8b.prototype._setRenderState.call(this,t);var e,i,n=t.samplers[this._imageIndex];this._shader.useImageRect&&n&&(e=this._samplerIndex,i=this._shader.fragmentConstantData,n.imageRect?(i[e]=n.imageRect.width,i[e+1]=n.imageRect.height,i[e+2]=n.imageRect.x,i[e+3]=n.imageRect.y):(i[e]=1,i[e+1]=1,i[e+2]=0,i[e+3]=0))},i8b),h8b,a8b;function i8b(){return null!==h8b&&h8b.apply(this,arguments)||this}function b8b(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=a8b.call(this,e)||this;return i.setNumImages(1),i.image=t,i}ShaderBase.registerAbstraction(_Shader_ImageTexture2D,ImageTexture2D);var DepthTextureCube=(x8b=ImageTextureCube,__extends(y8b,x8b),Object.defineProperty(y8b.prototype,"assetType",{get:function(){return y8b.assetType},enumerable:!0,configurable:!0}),y8b.assetType="[texture DepthTextureCube]",y8b),_Shader_DepthTexture=(A8b=_Shader_ImageTexture,__extends(B8b,A8b),B8b.prototype._initVO=function(t){this._decodeReg=null,this._decodeIndex=-1},B8b.prototype._initConstants=function(){var t=this._shader.fragmentConstantData,e=this._decodeIndex;t[e]=1,t[e+1]=1/255,t[e+2]=1/65025,t[e+3]=1/16581375},B8b.prototype._getFragmentCode=function(t,e,i,n){-1==this._decodeIndex&&(this._decodeIndex=4*(this._decodeReg=e.getFreeFragmentConstant()).index);var r=e.getFreeFragmentVectorTemp();return A8b.prototype._getFragmentCode.call(this,r,e,i,n)+"dp4 "+t+".w, "+r+", "+this._decodeReg+"\n"},B8b),A8b,x8b;function B8b(){return null!==A8b&&A8b.apply(this,arguments)||this}function y8b(t){return void 0===t&&(t=null),x8b.call(this,t)||this}ShaderBase.registerAbstraction(_Shader_DepthTexture,DepthTextureCube);var ShadowTexture2D=(K8b=ImageTexture2D,__extends(L8b,K8b),Object.defineProperty(L8b.prototype,"assetType",{get:function(){return L8b.assetType},enumerable:!0,configurable:!0}),L8b.assetType="[texture ShadowTexture2D]",L8b),_Shader_ShadowTexture2D=(N8b=_Shader_DepthTexture,__extends(O8b,N8b),O8b.prototype._getFragmentCode=function(t,e,i,n){return N8b.prototype._getFragmentCode.call(this,t,e,i,n)+"slt "+t+".w, "+n+".z, "+t+".w\n"},O8b),N8b,K8b;function O8b(){return null!==N8b&&N8b.apply(this,arguments)||this}function L8b(t){return void 0===t&&(t=null),K8b.call(this,t)||this}ShaderBase.registerAbstraction(_Shader_ShadowTexture2D,ShadowTexture2D);var MethodBase=(T8b=AssetBase,__extends(U8b,T8b),U8b.prototype.dispose=function(){},U8b.prototype.iAddOwner=function(t){var e=this._owners.indexOf(t);if(-1!=e)this._counts[e]++;else{this._owners.push(t),this._counts.push(1);for(var i=this._textures.length,n=0;nthis._maxZ&&(this._maxZ=o),l+=3;var u=f-s,p=m-a,d=(this._minZ=1)/(this._maxZ-this._minZ);s<0&&(s-=this._snap),a<0&&(a-=this._snap),s=Math.floor(s/this._snap)*this._snap,a=Math.floor(a/this._snap)*this._snap;var _=2*this._snap,f=s+(u=Math.floor(u/_+2)*_),m=a+(p=Math.floor(p/_+2)*_),u=1/u,p=1/p,g=i._rawData;g[0]=2*u,g[5]=2*p,g[10]=d,g[12]=-(f+s)*u,g[13]=-(m+a)*p,g[14]=-this._minZ*d,g[15]=1,g[1]=g[2]=g[3]=g[4]=g[6]=g[7]=g[8]=g[9]=g[11]=0,i.invalidatePosition()},V9b.assetType="[asset DirectionalShadowMapper]",V9b),_Shader_DirectionalShadowMapper=(Eac=_Shader_ShadowMapperBase,__extends(Fac,Eac),Fac.prototype._initVO=function(t){Eac.prototype._initVO.call(this,t),t.needsView=!0,t.needsGlobalVertexPos=!0},Fac.prototype._initConstants=function(){Eac.prototype._initConstants.call(this);var t=this._shader.vertexConstantData,e=this._vertexScalingIndex;t[e]=.5,t[e+1]=.5,t[e+2]=0,t[e+3]=1,this._depthProjectionMatrix=new Matrix3D(new Float32Array(this._shader.vertexConstantData.buffer,4*(e+4),16))},Fac.prototype._getVertexCode=function(t,e){var i="",n=t.getFreeVertexVectorTemp(),r=t.getFreeVertexConstant();this._vertexScalingIndex=4*r.index;var o=t.getFreeVertexConstant();return t.getFreeVertexConstant(),t.getFreeVertexConstant(),t.getFreeVertexConstant(),this._depthMapCoordReg=t.getFreeVarying(),i+("m44 "+n+", "+e.globalPositionVertex+", "+o+"\ndiv "+n+", "+n+", "+n+".w\nmul "+n+".xy, "+n+".xy, "+r+".xy\nadd "+this._depthMapCoordReg)+", "+n+", "+r+".xxwz\n"},Fac.prototype._activate=function(){Eac.prototype._activate.call(this);var t=this._shader.vertexConstantData;this._vertexScalingIndex,t[this._vertexScalingIndex+3]=-1/(this._mapper.depth*this._mapper.epsilon),this._depthProjectionMatrix.copyFrom(this._mapper.depthProjection,!0)},Fac),Eac,U9b,I9b,w9b,j9b,T8b;function Fac(){return null!==Eac&&Eac.apply(this,arguments)||this}function V9b(t){void 0===t&&(t=null);var e=U9b.call(this)||this;return e._lightOffset=1e4,e._snap=64,e._size=2048,e._image2D=t||new Image2D(e._size,e._size),e._textureMap=new ShadowTexture2D(e._image2D),e.iAddTexture(e._textureMap),e._cullPlanes=[],e._overallDepthProjection=new OrthographicProjection,e._overallDepthProjection.transform=new Transform,e._localFrustum=[],e._matrix=new Matrix3D,e}function J9b(t,e){var i=I9b.call(this,t,e)||this;return i.autoUpdate=!0,i._mapper=t,i._shader=e,i._shader.renderMaterial.renderGroup._addMapper(i._mapper),i}function x9b(){var t=null!==w9b&&w9b.apply(this,arguments)||this;return t._epsilon=.02,t._alpha=1,t.autoUpdate=!0,t}function k9b(t,e){var i=j9b.call(this,t,e)||this;return i.chunkVO=new ChunkVO,i}function U8b(){var t=T8b.call(this)||this;return t._textures=new Array,t._owners=new Array,t._counts=new Array,t}ShaderBase.registerAbstraction(_Shader_DirectionalShadowMapper,DirectionalShadowMapper);var LightBase=(Qac=AssetBase,__extends(Rac,Qac),Object.defineProperty(Rac.prototype,"transform",{get:function(){return this._transform},set:function(t){this._transform!=t&&(this._transform&&this._transform.removeEventListener(TransformEvent.INVALIDATE_CONCATENATED_MATRIX3D,this._onInvalidateConcatenatedMatrix3DDelegate),this._transform=t,this._transform&&this._transform.addEventListener(TransformEvent.INVALIDATE_CONCATENATED_MATRIX3D,this._onInvalidateConcatenatedMatrix3DDelegate))},enumerable:!0,configurable:!0}),Object.defineProperty(Rac.prototype,"shadowsEnabled",{get:function(){return this._shadowsEnabled},set:function(t){this._shadowsEnabled!=t&&((this._shadowsEnabled=t)&&null==this._shadowMapper?(this._shadowMapper=this._createShadowMapper(),this._shadowMapper.light=this):t||(this._shadowMapper.dispose(),this._shadowMapper=null),this.dispatchEvent(new LightEvent(LightEvent.CASTS_SHADOW_CHANGE)))},enumerable:!0,configurable:!0}),Object.defineProperty(Rac.prototype,"specular",{get:function(){return this._specular},set:function(t){t<0&&(t=0),this._specular=t,this._updateSpecular()},enumerable:!0,configurable:!0}),Object.defineProperty(Rac.prototype,"diffuse",{get:function(){return this._diffuse},set:function(t){t<0&&(t=0),this._diffuse=t,this._updateDiffuse()},enumerable:!0,configurable:!0}),Object.defineProperty(Rac.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t,this._colorR=(this._color>>16&255)/255,this._colorG=(this._color>>8&255)/255,this._colorB=(255&this._color)/255,this._updateDiffuse(),this._updateSpecular()},enumerable:!0,configurable:!0}),Object.defineProperty(Rac.prototype,"ambient",{get:function(){return this._ambient},set:function(t){t<0?t=0:1>16&255)/255*this._ambient,this._ambientG=(this._ambientColor>>8&255)/255*this._ambient,this._ambientB=(255&this._ambientColor)/255*this._ambient},Rac.prototype._onInvalidateConcatenatedMatrix3D=function(t){},Rac),DirectionalLight=(cbc=LightBase,__extends(dbc,cbc),Object.defineProperty(dbc.prototype,"assetType",{get:function(){return dbc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(dbc.prototype,"sceneDirection",{get:function(){return this._sceneDirectionDirty&&this._updateSceneDirection(),this._sceneDirection},enumerable:!0,configurable:!0}),Object.defineProperty(dbc.prototype,"direction",{get:function(){return this._direction},set:function(t){this._direction=t,this._tmpLookAt||(this._tmpLookAt=new Vector3D),this._tmpLookAt.x=this.transform.position.x+this._direction.x,this._tmpLookAt.y=this.transform.position.y+this._direction.y,this._tmpLookAt.z=this.transform.position.z+this._direction.z,this.transform.lookAt(this._tmpLookAt)},enumerable:!0,configurable:!0}),dbc.prototype._onInvalidateConcatenatedMatrix3D=function(t){this._sceneDirectionDirty=!0},dbc.prototype._updateSceneDirection=function(){this._sceneDirectionDirty=!1,this.transform.concatenatedMatrix3D.copyColumnTo(2,this._sceneDirection),this._sceneDirection.normalize()},dbc.prototype._createShadowMapper=function(){return new DirectionalShadowMapper},dbc.assetType="[light DirectionalLight]",dbc),LightProbe=(jbc=LightBase,__extends(kbc,jbc),Object.defineProperty(kbc.prototype,"assetType",{get:function(){return kbc.assetType},enumerable:!0,configurable:!0}),kbc.assetType="[light LightProbe]",kbc),ShadowTextureCube=(obc=ImageTextureCube,__extends(pbc,obc),Object.defineProperty(pbc.prototype,"assetType",{get:function(){return pbc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(pbc.prototype,"mapper",{get:function(){return this._mapper},enumerable:!0,configurable:!0}),pbc.assetType="[texture ShadowTextureCube]",pbc),_Shader_ShadowTextureCube=(tbc=_Shader_DepthTexture,__extends(ubc,tbc),ubc.prototype._getFragmentCode=function(t,e,i,n){var r=e.getFreeFragmentConstant();this._positionIndex=4*r.index;var o=e.getFreeFragmentConstant(),s="",a=e.getFreeFragmentVectorTemp();return(s+="sub "+a+", "+n+", "+r+"\ndp3 "+a+".w, "+a+".xyz, "+a+".xyz\nnrm "+a+".xyz, "+a+".xyz\n")+tbc.prototype._getFragmentCode.call(this,t,e,i,a)+"add "+a+".w, "+a+".w, "+o+".x\nmul "+a+".w, "+a+".w, "+r+".w\nslt "+t+".w, "+a+".w, "+t+".w\n"},ubc.prototype._activate=function(){tbc.prototype.activate.call(this);var t=this._shader.fragmentConstantData,e=this._positionIndex,i=this._texture.mapper.light.transform.concatenatedMatrix3D.position,n=this._texture.mapper.light.fallOff;t[e]=i.x,t[e+1]=i.y,t[e+2]=i.z,t[e+3]=1/(2*n*n),t[e+4]=-Math.pow(1/(n*this._texture.mapper.epsilon),2)},ubc),tbc,obc,jbc,cbc,Qac;function ubc(){return null!==tbc&&tbc.apply(this,arguments)||this}function pbc(t,e){void 0===e&&(e=null);var i=obc.call(this,e)||this;return i._mapper=t,i}function kbc(t,e){void 0===e&&(e=null);var i=jbc.call(this)||this;return i.diffuseSampler=new ImageSampler,i.specularSampler=new ImageSampler,i.diffuseMap=t,i.specularMap=e,i}function dbc(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=cbc.call(this,e)||this;return i._sceneDirectionDirty=!0,t&&(i.direction=t),i._sceneDirection=new Vector3D,i}function Rac(t){void 0===t&&(t=null);var e=Qac.call(this)||this;return e._color=16777215,e._colorR=1,e._colorG=1,e._colorB=1,e._ambientColor=16777215,e._ambient=0,e._specular=1,e._diffuse=1,e._shadowsEnabled=!1,e._ambientR=0,e._ambientG=0,e._ambientB=0,e._specularR=1,e._specularG=1,e._specularB=1,e._diffuseR=1,e._diffuseG=1,e._diffuseB=1,e._onInvalidateConcatenatedMatrix3DDelegate=function(t){return e._onInvalidateConcatenatedMatrix3D(t)},e.transform=t||new Transform,e}ShaderBase.registerAbstraction(_Shader_ShadowTextureCube,ShadowTextureCube);var PointShadowMapper=(Hbc=ShadowMapperBase,__extends(Ibc,Hbc),Object.defineProperty(Ibc.prototype,"assetType",{get:function(){return Ibc.assetType},enumerable:!0,configurable:!0}),Ibc.prototype.dispose=function(){Hbc.prototype.dispose.call(this),this._textureMap.image=null,this._textureMap=null,this._imageCube=null},Ibc.prototype.initCameras=function(){this._depthProjections=new Array,this.addProjection(0,90,0),this.addProjection(0,-90,0),this.addProjection(-90,0,0),this.addProjection(90,0,0),this.addProjection(0,0,0),this.addProjection(0,180,0)},Ibc.prototype.addProjection=function(t,e,i){var n=new PerspectiveProjection;n.transform=new Transform,n.transform.rotateTo(t,e,i),n.near=.01,n.fieldOfView=90,this._depthProjections.push(n)},Ibc.prototype._updateSize=function(){this._imageCube._setSize(this._size)},Ibc.prototype._updateProjection=function(t){for(var e=this._light.fallOff,i=this._light.transform.concatenatedMatrix3D.position,n=0;n<6;++n)this._depthProjections[n].far=e,this._depthProjections[n].transform.moveTo(i.x,i.y,i.z),this._needsRender[n]=!0},Ibc.prototype._renderMap=function(t,e){for(var i=e.distanceRenderGroup.getRenderer(t),n=0;n<6;++n)this._needsRender[n]&&(i.view.target=this._imageCube,i.view.projection=this._depthProjections[n],i.render(null,n))},Ibc.assetType="[asset PointShadowMapper]",Ibc),_Shader_PointShadowMapper=(Xbc=_Shader_ShadowMapperBase,__extends(Ybc,Xbc),Ybc.prototype._initVO=function(t){Xbc.prototype._initVO.call(this,t),t.needsGlobalFragmentPos=!0},Ybc.prototype._getVertexCode=function(t,e){return this._depthMapCoordReg=e.globalPositionVarying,""},Ybc),Xbc,Hbc;function Ybc(){return null!==Xbc&&Xbc.apply(this,arguments)||this}function Ibc(t){void 0===t&&(t=null);var e=Hbc.call(this)||this;return e._needsRender=new Array,e._size=512,e._imageCube=t||new ImageCube(e._size),e._textureMap=new ShadowTextureCube(e,e._imageCube),e.iAddTexture(e._textureMap),e.initCameras(),e}ShaderBase.registerAbstraction(_Shader_PointShadowMapper,PointShadowMapper);var PointLight=(acc=LightBase,__extends(bcc,acc),Object.defineProperty(bcc.prototype,"assetType",{get:function(){return bcc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(bcc.prototype,"radius",{get:function(){return this._radius},set:function(t){this._radius=t,this._radius<0?this._radius=0:this._radius>this._fallOff&&(this._fallOff=this._radius),this._fallOffFactor=1/(this._fallOff*this._fallOff-this._radius*this._radius)},enumerable:!0,configurable:!0}),Object.defineProperty(bcc.prototype,"fallOff",{get:function(){return this._fallOff},set:function(t){this._fallOff=t,this._fallOff<0&&(this._fallOff=0),this._fallOff>16&255)/255*this._method.strength,e[t+1]=(i>>8&255)/255*this._method.strength,e[t+2]=(255&i)/255*this._method.strength,e[t+3]=this._method.alpha)},zcc.prototype._setRenderState=function(t){this._texture&&this._texture._setRenderState(t)},zcc),ycc,rcc,kcc,acc;function zcc(t,e){var i=ycc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function scc(){var t=rcc.call(this)||this;return t._alpha=1,t._strength=1,t}function lcc(t,e){void 0===e&&(e=null);var i=kcc.call(this)||this;return i._transform=e||new Transform,i._projection=new PerspectiveProjection,i._projection.transform=i._transform,(i._texture=t).getImageAt(0).width,t.getImageAt(0).height,i}function bcc(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=acc.call(this,e)||this;return i._radius=9e4,i._fallOff=1e5,t&&(i._transform.matrix3D._rawData[12]=t.x,i._transform.matrix3D._rawData[13]=t.y,i._transform.matrix3D._rawData[14]=t.z,i._transform.invalidatePosition()),i._fallOffFactor=1/(i._fallOff*i._fallOff-i._radius*i._radius),i}ShaderBase.registerAbstraction(_Shader_AmbientBasicMethod,AmbientBasicMethod);var AmbientDepthMethod=(Pcc=AmbientBasicMethod,__extends(Qcc,Pcc),Object.defineProperty(Qcc.prototype,"assetType",{get:function(){return Qcc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Qcc.prototype,"castingLight",{get:function(){return this._castingLight},enumerable:!0,configurable:!0}),Qcc.assetType="[asset AmbientDepthMethod]",Qcc),_Shader_AmbientDepthMethod=(Tcc=_Shader_AmbientBasicMethod,__extends(Ucc,Tcc),Ucc.prototype._initVO=function(t){this._shadowTexture._initVO(t)},Ucc.prototype._initConstants=function(){this._shadowTexture._initConstants();var t=this._shader.fragmentConstantData,e=this._decRegIndex;t[e]=1,t[e+1]=1/255,t[e+2]=1/65025,t[e+3]=1/16581375},Ucc.prototype._getFragmentCode=function(t,e,i){var n="",r=e.getFreeFragmentConstant();return this._decRegIndex=4*r.index,n+(this._shadowTexture._getFragmentCode(t,e,i,i.uvVarying)+"dp4 ")+t+".x, "+t+", "+r+"\nmov "+t+".yz, "+t+".xx\t\t\t\nmov "+t+".w, "+r+".x\nsub "+t+".xyz, "+r+".xxx, "+t+".xyz\n"},Ucc),Tcc,Pcc;function Ucc(t,e){var i=Tcc.call(this,t,e)||this;return i._shadowTexture=e.getAbstraction(t.castingLight.shadowMapper.textureMap),i}function Qcc(t){var e=Pcc.call(this)||this;return(e._castingLight=t).shadowsEnabled=!0,e._shadowMapper=t.shadowMapper,e.iAddTexture(t.shadowMapper.textureMap),e}ShaderBase.registerAbstraction(_Shader_AmbientDepthMethod,AmbientDepthMethod);var CompositeMethodBase=(edc=MethodBase,__extends(fdc,edc),Object.defineProperty(fdc.prototype,"baseMethod",{get:function(){return this._baseMethod},set:function(t){this._baseMethod!=t&&(this._baseMethod.removeEventListener(MethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this._baseMethod=t,this._baseMethod.addEventListener(MethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),fdc.prototype.createBaseMethod=function(){throw new AbstractMethodError},fdc.prototype.iAddOwner=function(t){edc.prototype.iAddOwner.call(this,t),this._baseMethod.iAddOwner(t)},fdc.prototype.iRemoveOwner=function(t){edc.prototype.iRemoveOwner.call(this,t),this._baseMethod.iRemoveOwner(t)},fdc.prototype.dispose=function(){this._baseMethod.removeEventListener(MethodEvent.SHADER_INVALIDATED,this._onShaderInvalidatedDelegate)},fdc.prototype.onShaderInvalidated=function(t){this.invalidateShaderProgram()},fdc),_Shader_CompositeMethodBase=(ndc=AbstractionBase,__extends(odc,ndc),odc.prototype._isUsed=function(){return!0},odc.prototype._usesTangentSpace=function(){return this._baseChunk._usesTangentSpace()},odc.prototype._initVO=function(t){this._baseChunk._initVO(t)},odc.prototype._initConstants=function(){this._baseChunk._initConstants()},odc.prototype._activate=function(){this._baseChunk._activate()},odc.prototype._setRenderState=function(t){this._baseChunk._setRenderState(t)},odc.prototype._deactivate=function(){this._baseChunk._deactivate(),this._invalid=!1},odc.prototype._getVertexCode=function(t,e){return this._baseChunk._getVertexCode(t,e)},odc.prototype._getFragmentCode=function(t,e,i){return this._baseChunk._getFragmentCode(t,e,i)},odc.prototype._reset=function(t){this._baseChunk._reset(t),this._invalid=!0,this._cleanCompilationData()},odc.prototype._cleanCompilationData=function(){this._baseChunk._cleanCompilationData()},odc),_Shader_LightingCompositeMethod=(Adc=_Shader_CompositeMethodBase,__extends(Bdc,Adc),Bdc.prototype._getFragmentPreLightingCode=function(t,e){return this._baseChunk._getFragmentPreLightingCode(t,e)},Bdc.prototype._getFragmentCodePerLight=function(t,e,i,n){var r=this._baseChunk._getFragmentCodePerLight(t,e,i,n);return this._totalLightColorReg=this._baseChunk._totalLightColorReg,r},Bdc.prototype._getFragmentCodePerProbe=function(t,e,i,n){var r=this._baseChunk._getFragmentCodePerProbe(t,e,i,n);return this._totalLightColorReg=this._baseChunk._totalLightColorReg,r},Bdc),DiffuseBasicMethod=(Odc=MethodBase,__extends(Pdc,Odc),Object.defineProperty(Pdc.prototype,"assetType",{get:function(){return Pdc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Pdc.prototype,"multiply",{get:function(){return this._multiply},set:function(t){this._multiply!=t&&(this._multiply=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(Pdc.prototype,"color",{get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(Pdc.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!=t&&(this._texture&&this.iRemoveTexture(this._texture),this._texture=t,this._texture&&this.iAddTexture(this._texture),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Pdc.prototype.dispose=function(){this._texture=null},Pdc.prototype.copyFrom=function(t){var e=t;this.texture=e.texture,this.multiply=e.multiply,this.color=e.color},Pdc.assetType="[asset DiffuseBasicMethod]",Pdc),_Shader_DiffuseBasicMethod=(Wdc=_Shader_MethodBase,__extends(Xdc,Wdc),Xdc.prototype.onInvalidate=function(t){Wdc.prototype.onInvalidate.call(this,t),this._updateProperties()},Xdc.prototype._isUsed=function(){return Boolean(this._shader.numLights)},Xdc.prototype._initVO=function(t){this._method.texture?(this._texture=this._shader.getAbstraction(this._method.texture),this._texture._initVO(t),this._method.texture instanceof TextureCube?t.needsNormals=!0:this._shader.uvDependencies++):this._texture&&(this._texture=null),this._shader.numLights&&(this._shader.usesCommonData=!0,t.needsNormals=!0)},Xdc.prototype._initConstants=function(){this._texture&&this._texture._initConstants(),this._updateProperties()},Xdc.prototype._cleanCompilationData=function(){Wdc.prototype._cleanCompilationData.call(this),this._totalLightColorReg=null},Xdc.prototype._getFragmentPreLightingCode=function(t,e){return this._pIsFirstLight=!0,t.addFragmentTempUsages(this._totalLightColorReg=t.getFreeFragmentVectorTemp(),1),""},Xdc.prototype._getFragmentCodePerLight=function(t,e,i,n){var r,o="";return this._pIsFirstLight?r=this._totalLightColorReg:(r=i.getFreeFragmentVectorTemp(),i.addFragmentTempUsages(r,1)),o+="dp3 "+r+".x, "+t+", "+n.normalFragment+"\nmax "+r+".w, "+r+".x, "+n.commons+".y\n",this._shader.usesLightFallOff&&(o+="mul "+r+".w, "+r+".w, "+t+".w\n"),null!=this._modulateFunction&&(o+=this._modulateFunction(r,i,n)),o+="mul "+r+", "+r+".w, "+e+"\n",this._pIsFirstLight||(o+="add "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+r+"\n",i.removeFragmentTempUsage(r)),this._pIsFirstLight=!1,o},Xdc.prototype._getFragmentCodePerProbe=function(t,e,i,n){var r,o="";return this._pIsFirstLight?r=this._totalLightColorReg:(r=i.getFreeFragmentVectorTemp(),i.addFragmentTempUsages(r,1)),o+="tex "+r+", "+n.normalFragment+", "+t+" \nmul "+r+".xyz, "+r+".xyz, "+e+"\n",null!=this._modulateFunction&&(o+=this._modulateFunction(r,i,n)),this._pIsFirstLight||(o+="add "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+r+"\n",i.removeFragmentTempUsage(r)),this._pIsFirstLight=!1,o},Xdc.prototype._getFragmentCode=function(t,e,i){var n,r="";i.shadowTarget&&(r+=this._applyShadow(e,i)),e.addFragmentTempUsages(n=e.getFreeFragmentVectorTemp(),1);var o,s=e.getFreeFragmentConstant();return this._ambientColorRegister=4*s.index,this._texture?r+=this._texture._getFragmentCode(n,e,i,this._method.texture instanceof TextureCube?i.normalFragment:i.uvVarying):(o=e.getFreeFragmentConstant(),this._diffuseColorRegister=4*o.index,r+="mov "+n+", "+o+"\n"),r+="sat "+this._totalLightColorReg+", "+this._totalLightColorReg+"\nmul "+n+".xyz, "+n+", "+this._totalLightColorReg+"\n",this._method.multiply?r+="add "+n+".xyz, "+n+", "+s+"\nmul "+t+".xyz, "+t+", "+n+"\n":this._texture?r+="mul "+t+".xyz, "+t+", "+s+"\nmul "+this._totalLightColorReg+".xyz, "+t+", "+this._totalLightColorReg+"\nsub "+t+".xyz, "+t+", "+this._totalLightColorReg+"\nadd "+t+".xyz, "+t+", "+n+"\n":r+="mul "+this._totalLightColorReg+".xyz, "+s+", "+this._totalLightColorReg+"\nsub "+this._totalLightColorReg+".xyz, "+s+", "+this._totalLightColorReg+"\nadd "+n+".xyz, "+n+", "+this._totalLightColorReg+"\nmul "+t+".xyz, "+t+", "+n+"\n",e.removeFragmentTempUsage(this._totalLightColorReg),e.removeFragmentTempUsage(n),r},Xdc.prototype._applyShadow=function(t,e){return"mul "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+e.shadowTarget+".w\n"},Xdc.prototype._activate=function(){var t,e;this._texture?this._texture.activate():(t=this._diffuseColorRegister,e=this._shader.fragmentConstantData,this._method.multiply?(e[t]=this._colorR*this._ambientColorR,e[t+1]=this._colorG*this._ambientColorG,e[t+2]=this._colorB*this._ambientColorB):(e[t]=this._colorR,e[t+1]=this._colorG,e[t+2]=this._colorB),e[t+3]=1)},Xdc.prototype._updateProperties=function(){this._ambientColor=this._shader.renderMaterial.style.color,this._ambientColorR=(this._ambientColor>>16&255)/255,this._ambientColorG=(this._ambientColor>>8&255)/255,this._ambientColorB=(255&this._ambientColor)/255,this._color=this._method.color,this._colorR=(this._color>>16&255)/255,this._colorG=(this._color>>8&255)/255,this._colorB=(255&this._color)/255},Xdc.prototype._setRenderState=function(t){this._texture&&this._texture._setRenderState(t);var e=this._ambientColorRegister,i=this._shader.fragmentConstantData;i[e]=this._shader.ambientR*this._ambientColorR,i[e+1]=this._shader.ambientG*this._ambientColorG,i[e+2]=this._shader.ambientB*this._ambientColorB,i[e+3]=1},Xdc),Wdc,Odc,Adc,ndc,edc;function Xdc(t,e){var i=Wdc.call(this,t,e)||this;return i._ambientColorR=1,i._ambientColorG=1,i._ambientColorB=1,i._color=16777215,i._colorR=1,i._colorG=1,i._colorB=1,i._method=t,i._shader=e,i}function Pdc(){var t=Odc.call(this)||this;return t._multiply=!0,t._ambientColorR=1,t._ambientColorG=1,t._ambientColorB=1,t._color=16777215,t._colorR=1,t._colorG=1,t._colorB=1,t}function Bdc(){return null!==Adc&&Adc.apply(this,arguments)||this}function odc(t,e){var i=ndc.call(this,t,e)||this;return i.chunkVO=new ChunkVO,i._baseChunk=e.getAbstraction(t.baseMethod),i}function fdc(t){void 0===t&&(t=null);var e=edc.call(this)||this;return e._onShaderInvalidatedDelegate=function(t){return e.onShaderInvalidated(t)},e._baseMethod=t||e.createBaseMethod(),e._baseMethod.addEventListener(MethodEvent.SHADER_INVALIDATED,e._onShaderInvalidatedDelegate),e}ShaderBase.registerAbstraction(_Shader_DiffuseBasicMethod,DiffuseBasicMethod);var DiffuseCompositeMethod=(Dec=CompositeMethodBase,__extends(Eec,Dec),Eec.prototype.createBaseMethod=function(){return new DiffuseBasicMethod},Object.defineProperty(Eec.prototype,"texture",{get:function(){return this._baseMethod.texture},set:function(t){this._baseMethod.texture=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eec.prototype,"color",{get:function(){return this._baseMethod.color},set:function(t){this._baseMethod.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(Eec.prototype,"multiply",{get:function(){return this._baseMethod.multiply},set:function(t){this._baseMethod.multiply=t},enumerable:!0,configurable:!0}),Eec),DiffuseCelMethod=(Jec=DiffuseCompositeMethod,__extends(Kec,Jec),Object.defineProperty(Kec.prototype,"assetType",{get:function(){return Kec.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Kec.prototype,"levels",{get:function(){return this._levels},set:function(t){this._levels=t},enumerable:!0,configurable:!0}),Object.defineProperty(Kec.prototype,"smoothness",{get:function(){return this._smoothness},set:function(t){this._smoothness=t},enumerable:!0,configurable:!0}),Kec.assetType="[asset DiffuseCelMethod]",Kec),_Shader_DiffuseCelMethod=(Rec=_Shader_LightingCompositeMethod,__extends(Sec,Rec),Sec.prototype._initConstants=function(){Rec.prototype._initConstants.call(this);var t=this._shader.fragmentConstantData,e=this._clampDataIndex;t[e+1]=1,t[e+2]=0},Sec.prototype._cleanCompilationData=function(){Rec.prototype._cleanCompilationData.call(this),this._clampDataRegister=null},Sec.prototype._getFragmentPreLightingCode=function(t,e){return this._clampDataRegister=t.getFreeFragmentConstant(),this._clampDataIndex=4*this._clampDataRegister.index,Rec.prototype._getFragmentPreLightingCode.call(this,t,e)},Sec.prototype._activate=function(){var t,e;Rec.prototype._activate.call(this),this._invalid&&((t=this._shader.fragmentConstantData)[e=this._clampDataIndex]=this._method.levels,t[e+3]=this._method.smoothness)},Sec.prototype.clampDiffuse=function(t,e,i){return"mul "+t+".w, "+t+".w, "+this._clampDataRegister+".x\nfrc "+t+".z, "+t+".w\nsub "+t+".y, "+t+".w, "+t+".z\nmov "+t+".x, "+this._clampDataRegister+".x\nsub "+t+".x, "+t+".x, "+this._clampDataRegister+".y\nrcp "+t+".x,"+t+".x\nmul "+t+".w, "+t+".y, "+t+".x\nsub "+t+".y, "+t+".w, "+t+".x\ndiv "+t+".z, "+t+".z, "+this._clampDataRegister+".w\nsat "+t+".z, "+t+".z\nmul "+t+".w, "+t+".w, "+t+".z\nsub "+t+".z, "+this._clampDataRegister+".y, "+t+".z\nmul "+t+".y, "+t+".y, "+t+".z\nadd "+t+".w, "+t+".w, "+t+".y\nsat "+t+".w, "+t+".w\n"},Sec),Rec,Jec,Dec;function Sec(t,e){var n=Rec.call(this,t,e)||this;return n._method=t,n._shader=e,n._baseChunk._modulateFunction=function(t,e,i){return n.clampDiffuse(t,e,i)},n}function Kec(t,e,i){void 0===t&&(t=3),void 0===e&&(e=.1),void 0===i&&(i=null);var n=Jec.call(this,i)||this;return n._levels=t,n._smoothness=e,n}function Eec(t){return void 0===t&&(t=null),Dec.call(this,t)||this}ShaderBase.registerAbstraction(_Shader_DiffuseCelMethod,DiffuseCelMethod);var DiffuseGradientMethod=(gfc=DiffuseBasicMethod,__extends(hfc,gfc),Object.defineProperty(hfc.prototype,"assetType",{get:function(){return hfc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(hfc.prototype,"gradient",{get:function(){return this._gradient},set:function(t){this._gradient!=t&&(this._gradient&&this.iRemoveTexture(this._gradient),this._gradient=t,this._gradient&&this.iAddTexture(this._gradient),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),hfc.assetType="[asset DiffuseGradientMethod]",hfc),_Shader_DiffuseGradientMethod=(lfc=_Shader_DiffuseBasicMethod,__extends(mfc,lfc),mfc.prototype._initVO=function(t){lfc.prototype._initVO.call(this,t),this._gradient=this._shader.getAbstraction(this._method.gradient||new ImageTexture2D),this._gradient._initVO(t)},mfc.prototype._initConstants=function(){this._gradient._initConstants()},mfc.prototype._getFragmentPreLightingCode=function(t,e){var i=lfc.prototype._getFragmentPreLightingCode.call(this,t,e);return this._pIsFirstLight=!0,i},mfc.prototype._getFragmentCodePerLight=function(t,e,i,n){var r,o="";return this._pIsFirstLight?r=this._totalLightColorReg:(r=i.getFreeFragmentVectorTemp(),i.addFragmentTempUsages(r,1)),o+="dp3 "+r+".w, "+t+".xyz, "+n.normalFragment+".xyz\nmul "+r+".w, "+r+".w, "+n.commons+".x\nadd "+r+".w, "+r+".w, "+n.commons+".x\nmul "+r+".xyz, "+r+".w, "+t+".w\n",null!=this._modulateFunction&&(o+=this._modulateFunction(r,i,n)),o+=this._gradient._getFragmentCode(r,i,n,r)+"mul "+r+".xyz, "+r+".xyz, "+e+".xyz\n",this._pIsFirstLight||(o+="add "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+".xyz, "+r+".xyz\n",i.removeFragmentTempUsage(r)),this._pIsFirstLight=!1,o},mfc.prototype._activate=function(){lfc.prototype._activate.call(this),this._gradient.activate()},mfc.prototype._setRenderState=function(t){lfc.prototype._setRenderState.call(this,t),this._gradient._setRenderState(t)},mfc),lfc,gfc;function mfc(t,e){return lfc.call(this,t,e)||this}function hfc(t){var e=gfc.call(this)||this;return e._gradient=t,e.iAddTexture(e._gradient),e}ShaderBase.registerAbstraction(_Shader_DiffuseGradientMethod,DiffuseGradientMethod);var DiffuseLightMapMethod=(Afc=DiffuseCompositeMethod,__extends(Bfc,Afc),Object.defineProperty(Bfc.prototype,"assetType",{get:function(){return Bfc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Bfc.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){if(t!=Bfc.ADD&&t!=Bfc.MULTIPLY)throw new Error("Unknown blendmode!");this._blendMode!=t&&(this._blendMode=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(Bfc.prototype,"lightMap",{get:function(){return this._lightMap},set:function(t){this._lightMap!=t&&(this._lightMap&&this.iRemoveTexture(this._lightMap),this._lightMap=t,this._lightMap&&this.iAddTexture(this._lightMap),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(Bfc.prototype,"useSecondaryUV",{get:function(){return this._useSecondaryUV},set:function(t){this._useSecondaryUV!=t&&(this._useSecondaryUV=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Bfc.MULTIPLY="multiply",Bfc.ADD="add",Bfc.assetType="[asset DiffuseLightMapMethod]",Bfc),_Shader_DiffuseLightMapMethod=(Kfc=_Shader_LightingCompositeMethod,__extends(Lfc,Kfc),Lfc.prototype._initVO=function(t){this._lightMap=this._shader.getAbstraction(this._method.lightMap||new ImageTexture2D),this._lightMap._initVO(t),this._method.useSecondaryUV?this._shader.secondaryUVDependencies++:this._shader.uvDependencies++},Lfc.prototype._initConstants=function(){this._lightMap._initConstants()},Lfc.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentVectorTemp(),r=this._lightMap._getFragmentCode(n,e,i,this._method.useSecondaryUV?i.secondaryUVVarying:i.uvVarying);switch(this._method.blendMode){case DiffuseLightMapMethod.MULTIPLY:r+="mul "+this._totalLightColorReg+", "+this._totalLightColorReg+", "+n+"\n";break;case DiffuseLightMapMethod.ADD:r+="add "+this._totalLightColorReg+", "+this._totalLightColorReg+", "+n+"\n"}return r+Kfc.prototype._getFragmentCode.call(this,t,e,i)},Lfc.prototype._activate=function(){Kfc.prototype._activate.call(this),this._lightMap.activate()},Lfc.prototype._setRenderState=function(t){Kfc.prototype._setRenderState.call(this,t),this._lightMap._setRenderState(t)},Lfc),Kfc,Afc;function Lfc(t,e){var i=Kfc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function Bfc(t,e,i,n){void 0===e&&(e="multiply"),void 0===i&&(i=!1),void 0===n&&(n=null);var r=Afc.call(this,n)||this;return r._lightMap=t,r.blendMode=e,r._useSecondaryUV=i,r._lightMap&&r.iAddTexture(r._lightMap),r}ShaderBase.registerAbstraction(_Shader_DiffuseLightMapMethod,DiffuseLightMapMethod);var DiffuseWrapMethod=(Wfc=DiffuseBasicMethod,__extends(Xfc,Wfc),Object.defineProperty(Xfc.prototype,"assetType",{get:function(){return Xfc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Xfc.prototype,"wrapFactor",{get:function(){return this._wrapFactor},set:function(t){this._wrapFactor=t,this._wrapFactor=1/(t+1),this.invalidate()},enumerable:!0,configurable:!0}),Xfc.assetType="[asset DiffuseWrapMethod]",Xfc),_Shader_DiffuseWrapMethod=(_fc=_Shader_DiffuseBasicMethod,__extends(agc,_fc),agc.prototype._cleanCompilationData=function(){_fc.prototype._cleanCompilationData.call(this),this._wrapDataRegister=null},agc.prototype._getFragmentPreLightingCode=function(t,e){var i=_fc.prototype._getFragmentPreLightingCode.call(this,t,e);return this._pIsFirstLight=!0,this._wrapDataRegister=t.getFreeFragmentConstant(),this._wrapDataIndex=4*this._wrapDataRegister.index,i},agc.prototype._getFragmentCodePerLight=function(t,e,i,n){var r,o="";return this._pIsFirstLight?r=this._totalLightColorReg:(r=i.getFreeFragmentVectorTemp(),i.addFragmentTempUsages(r,1)),o+="dp3 "+r+".x, "+t+".xyz, "+n.normalFragment+".xyz\nadd "+r+".y, "+r+".x, "+this._wrapDataRegister+".x\nmul "+r+".y, "+r+".y, "+this._wrapDataRegister+".y\nsat "+r+".w, "+r+".y\nmul "+r+".xz, "+r+".w, "+t+".wz\n",null!=this._modulateFunction&&(o+=this._modulateFunction(t,i,n)),o+="mul "+r+", "+r+".x, "+e+"\n",this._pIsFirstLight||(o+="add "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+".xyz, "+r+".xyz\n",i.removeFragmentTempUsage(r)),this._pIsFirstLight=!1,o},agc.prototype._activate=function(){var t,e;_fc.prototype._activate.call(this),this._invalid&&(t=this._wrapDataIndex,(e=this._shader.fragmentConstantData)[t]=this._method.wrapFactor,e[t+1]=1/(this._method.wrapFactor+1))},agc),_fc,Wfc;function agc(t,e){return _fc.call(this,t,e)||this}function Xfc(t){void 0===t&&(t=.5);var e=Wfc.call(this)||this;return e.wrapFactor=t,e}ShaderBase.registerAbstraction(_Shader_DiffuseWrapMethod,DiffuseWrapMethod);var EffectAlphaMaskMethod=(ogc=MethodBase,__extends(pgc,ogc),Object.defineProperty(pgc.prototype,"assetType",{get:function(){return pgc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(pgc.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!=t&&(this._texture&&this.iRemoveTexture(this._texture),this._texture=t,this._texture&&this.iAddTexture(this._texture),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(pgc.prototype,"useSecondaryUV",{get:function(){return this._useSecondaryUV},set:function(t){this._useSecondaryUV!=t&&(this._useSecondaryUV=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),pgc.assetType="[asset EffectAlphaMaskMethod]",pgc),_Shader_EffectAlphaMaskMethod=(vgc=_Shader_MethodBase,__extends(wgc,vgc),wgc.prototype._initVO=function(t){this._alphaMask=this._shader.getAbstraction(this._method.texture||new ImageTexture2D),this._alphaMask._initVO(t),this._method.useSecondaryUV?this._shader.secondaryUVDependencies++:this._shader.uvDependencies++},wgc.prototype._initConstants=function(){this._alphaMask._initConstants()},wgc.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentVectorTemp();return this._alphaMask._getFragmentCode(n,e,i,this._method.useSecondaryUV?i.secondaryUVVarying:i.uvVarying)+"mul "+t+", "+t+", "+n+".x\n"},wgc.prototype._activate=function(){vgc.prototype._activate.call(this),this._alphaMask.activate()},wgc.prototype._setRenderState=function(t){this._alphaMask._setRenderState(t)},wgc),vgc,ogc;function wgc(t,e){var i=vgc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function pgc(t,e){void 0===e&&(e=!1);var i=ogc.call(this)||this;return i._texture=t,i._useSecondaryUV=e,i._texture&&i.iAddTexture(i._texture),i}ShaderBase.registerAbstraction(_Shader_EffectAlphaMaskMethod,EffectAlphaMaskMethod);var EffectColorMatrixMethod=(Ggc=MethodBase,__extends(Hgc,Ggc),Object.defineProperty(Hgc.prototype,"assetType",{get:function(){return Hgc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Hgc.prototype,"matrix",{get:function(){return this._matrix},set:function(t){if(20!=t.length)throw new Error("Matrix length must be 20!");this._matrix=t,this.invalidate()},enumerable:!0,configurable:!0}),Hgc.assetType="[asset EffectColorMatrixMethod]",Hgc),_Shader_EffectColorMatrixMethod=(Lgc=_Shader_MethodBase,__extends(Mgc,Lgc),Mgc.prototype._getFragmentCode=function(t,e,i){var n="",r=e.getFreeFragmentConstant();e.getFreeFragmentConstant(),e.getFreeFragmentConstant(),e.getFreeFragmentConstant();var o=e.getFreeFragmentConstant();this._colorMatrixIndex=4*r.index;var s=e.getFreeFragmentVectorTemp();return n+"m44 "+s+", "+t+", "+r+"\nadd "+t+", "+s+", "+o+"\n"},Mgc.prototype._activate=function(){var t,e,i;this._invalid&&(t=this._method.matrix,e=this._colorMatrixIndex,(i=this._shader.fragmentConstantData)[e]=t[0],i[e+1]=t[1],i[e+2]=t[2],i[e+3]=t[3],i[e+4]=t[5],i[e+5]=t[6],i[e+6]=t[7],i[e+7]=t[8],i[e+8]=t[10],i[e+9]=t[11],i[e+10]=t[12],i[e+11]=t[13],i[e+12]=t[15],i[e+13]=t[16],i[e+14]=t[17],i[e+15]=t[18],i[e+16]=t[4],i[e+17]=t[9],i[e+18]=t[14],i[e+19]=t[19])},Mgc),Lgc,Ggc;function Mgc(t,e){var i=Lgc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function Hgc(t){var e=Ggc.call(this)||this;if(20!=t.length)throw new Error("Matrix length must be 20!");return e._matrix=t,e}ShaderBase.registerAbstraction(_Shader_EffectColorMatrixMethod,EffectColorMatrixMethod);var EffectColorTransformMethod=($gc=MethodBase,__extends(_gc,$gc),Object.defineProperty(_gc.prototype,"assetType",{get:function(){return _gc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(_gc.prototype,"colorTransform",{get:function(){return this._colorTransform},set:function(t){this._colorTransform=t,this.invalidate()},enumerable:!0,configurable:!0}),_gc.assetType="[asset EffectColorTransformMethod]",_gc),_Shader_EffectColorTransformMethod=(dhc=_Shader_MethodBase,__extends(ehc,dhc),ehc.prototype._getFragmentCode=function(t,e,i){var n="",r=e.getFreeFragmentConstant(),o=e.getFreeFragmentConstant();return this._colorTransformIndex=4*r.index,n+"mul "+t+", "+t+", "+r+"\nadd "+t+", "+t+", "+o+"\n"},ehc.prototype._activate=function(){var t,e,i;this._invalid&&(t=this._colorTransformIndex,e=this._shader.fragmentConstantData,i=this._method.colorTransform._rawData,e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7])},ehc),dhc,$gc;function ehc(t,e){var i=dhc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function _gc(t){void 0===t&&(t=null);var e=$gc.call(this)||this;return e._colorTransform=t,e}ShaderBase.registerAbstraction(_Shader_EffectColorTransformMethod,EffectColorTransformMethod);var EffectEnvMapMethod=(rhc=MethodBase,__extends(shc,rhc),Object.defineProperty(shc.prototype,"assetType",{get:function(){return shc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(shc.prototype,"envMap",{get:function(){return this._envMap},set:function(t){this._envMap!=t&&(this._envMap&&this.iRemoveTexture(this._envMap),this._envMap=t,this._envMap&&this.iAddTexture(this._envMap),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(shc.prototype,"mask",{get:function(){return this._mask},set:function(t){t!=this._mask&&(this._mask&&this.iRemoveTexture(this._mask),this._mask=t,this._mask&&this.iAddTexture(this._mask),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(shc.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha=t,this.invalidate()},enumerable:!0,configurable:!0}),shc.prototype.dispose=function(){},shc.assetType="[asset EffectEnvMapMethod]",shc),_Shader_EffectEnvMapMethod=(zhc=_Shader_MethodBase,__extends(Ahc,zhc),Ahc.prototype._initVO=function(t){t.needsNormals=!0,t.needsView=!0,this._envMap=this._shader.getAbstraction(this._method.envMap),this._envMap._initVO(t),this._method.mask?(this._maskMap=this._shader.getAbstraction(this._method.mask),this._shader.uvDependencies++):this._maskMap&&(this._maskMap=null)},Ahc.prototype._initConstants=function(){this._envMap._initConstants()},Ahc.prototype.dispose=function(){this._envMap=null,this._maskMap=null},Ahc.prototype._activate=function(){this._envMap.activate(),this._maskMap&&this._maskMap.activate(),this._invalid&&this._updateProperties()},Ahc.prototype._setRenderState=function(t){this._envMap._setRenderState(t),this._maskMap&&this._maskMap._setRenderState(t)},Ahc.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentConstant(),r="";this._fragmentIndex=4*n.index;var o=e.getFreeFragmentVectorTemp();e.addFragmentTempUsages(o,1);var s=e.getFreeFragmentVectorTemp();return e.addFragmentTempUsages(s,1),r+="dp3 "+o+".w, "+i.viewDirFragment+".xyz, "+i.normalFragment+".xyz\nadd "+o+".w, "+o+".w, "+o+".w\nmul "+o+".xyz, "+i.normalFragment+".xyz, "+o+".w\nsub "+o+".xyz, "+o+".xyz, "+i.viewDirFragment+".xyz\n"+this._envMap._getFragmentCode(o,e,i,o)+"sub "+s+".w, "+o+".w, fc0.x\nkil "+s+".w\nsub "+o+", "+o+", "+t+"\n",this._maskMap&&(r+=this._maskMap._getFragmentCode(s,e,i,i.uvVarying)+"mul "+o+", "+s+", "+o+"\n"),r+="mul "+o+", "+o+", "+n+".x\nadd "+t+", "+t+", "+o+"\n",e.removeFragmentTempUsage(o),e.removeFragmentTempUsage(s),r},Ahc.prototype._updateProperties=function(){this._shader.fragmentConstantData[this._fragmentIndex]=this._method.alpha},Ahc),zhc,rhc;function Ahc(t,e){var i=zhc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function shc(t,e){void 0===e&&(e=1);var i=rhc.call(this)||this;return i._envMap=t,i._alpha=e,i.iAddTexture(i._envMap),i}ShaderBase.registerAbstraction(_Shader_EffectEnvMapMethod,EffectEnvMapMethod);var EffectFogMethod=(Nhc=MethodBase,__extends(Ohc,Nhc),Object.defineProperty(Ohc.prototype,"assetType",{get:function(){return Ohc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Ohc.prototype,"minDistance",{get:function(){return this._minDistance},set:function(t){this._minDistance=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(Ohc.prototype,"maxDistance",{get:function(){return this._maxDistance},set:function(t){this._maxDistance=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(Ohc.prototype,"fogColor",{get:function(){return this._fogColor},set:function(t){this._fogColor=t,this.invalidate()},enumerable:!0,configurable:!0}),Ohc.assetType="[asset EffectFogMethod]",Ohc),_Shader_EffectFogMethod=(Whc=_Shader_MethodBase,__extends(Xhc,Whc),Xhc.prototype._initVO=function(t){t.needsProjection=!0},Xhc.prototype._activate=function(){var t,e,i;this._invalid&&(t=this._shader.fragmentConstantData,e=this._fogColorIndex,i=this._method.fogColor,t[e]=(i>>16&255)/255,t[e+1]=(i>>8&255)/255,t[e+2]=(255&i)/255,t[e+3]=1,t[e+4]=this._method.minDistance,t[e+5]=1/(this._method.maxDistance-this._method.minDistance),t[e+6]=0,t[e+7]=0)},Xhc.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentConstant(),r=e.getFreeFragmentConstant(),o=e.getFreeFragmentVectorTemp();e.addFragmentTempUsages(o,1);var s=e.getFreeFragmentVectorTemp(),a="";return this._fogColorIndex=4*n.index,a+="sub "+s+".w, "+i.projectionFragment+".z, "+r+".x\nmul "+s+".w, "+s+".w, "+r+".y\nsat "+s+".w, "+s+".w\nsub "+o+", "+n+", "+t+"\nmul "+o+", "+o+", "+s+".w\nadd "+t+", "+t+", "+o+"\n",e.removeFragmentTempUsage(o),a},Xhc),Whc,Nhc;function Xhc(t,e){var i=Whc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function Ohc(t,e,i){void 0===t&&(t=0),void 0===e&&(e=1e3),void 0===i&&(i=8421504);var n=Nhc.call(this)||this;return n._minDistance=t,n._maxDistance=e,n._fogColor=i,n}ShaderBase.registerAbstraction(_Shader_EffectFogMethod,EffectFogMethod);var EffectFresnelEnvMapMethod=(lic=EffectEnvMapMethod,__extends(mic,lic),Object.defineProperty(mic.prototype,"assetType",{get:function(){return mic.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(mic.prototype,"fresnelPower",{get:function(){return this._fresnelPower},set:function(t){this._fresnelPower=t},enumerable:!0,configurable:!0}),Object.defineProperty(mic.prototype,"normalReflectance",{get:function(){return this._normalReflectance},set:function(t){this._normalReflectance!=t&&(this._normalReflectance=t,this.invalidate())},enumerable:!0,configurable:!0}),mic.assetType="[asset EffectFresnelEnvMapMethod]",mic),_Shader_EffectFresnelEnvMapMethod=(uic=_Shader_EffectEnvMapMethod,__extends(vic,uic),vic.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentConstant(),r="",o=i.viewDirFragment,s=i.normalFragment;this._fragmentIndex=4*n.index;var a=e.getFreeFragmentVectorTemp();e.addFragmentTempUsages(a,1);var l=e.getFreeFragmentVectorTemp();return e.addFragmentTempUsages(l,1),r+="dp3 "+a+".w, "+o+".xyz, "+s+".xyz\nadd "+a+".w, "+a+".w, "+a+".w\nmul "+a+".xyz, "+s+".xyz, "+a+".w\nsub "+a+".xyz, "+a+".xyz, "+o+".xyz\n"+this._envMap._getFragmentCode(a,e,i,a)+"sub "+l+".w, "+a+".w, fc0.x\nkil "+l+".w\nsub "+a+", "+a+", "+t+"\n",r+="dp3 "+o+".w, "+o+".xyz, "+s+".xyz\nsub "+o+".w, "+n+".w, "+o+".w\npow "+o+".w, "+o+".w, "+n+".z\nsub "+s+".w, "+n+".w, "+o+".w\nmul "+s+".w, "+n+".y, "+s+".w\nadd "+o+".w, "+o+".w, "+s+".w\nmul "+o+".w, "+n+".x, "+o+".w\n",this._maskMap&&(r+=this._maskMap._getFragmentCode(l,e,i,i.uvVarying)+"mul "+o+".w, "+l+".x, "+o+".w\n"),r+="mul "+a+", "+a+", "+o+".w\nadd "+t+", "+t+", "+a+"\n",e.removeFragmentTempUsage(a),e.removeFragmentTempUsage(l),r},vic.prototype._updateProperties=function(){var t=this._fragmentIndex,e=this._shader.fragmentConstantData;e[t]=this._method.alpha,e[t+1]=this._method.normalReflectance,e[t+2]=this._method.fresnelPower},vic),uic,lic;function vic(){return null!==uic&&uic.apply(this,arguments)||this}function mic(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=5),void 0===n&&(n=0);var r=lic.call(this,t,e)||this;return r._fresnelPower=i,r._normalReflectance=n,r}ShaderBase.registerAbstraction(_Shader_EffectFresnelEnvMapMethod,EffectFresnelEnvMapMethod);var EffectLightMapMethod=(Hic=MethodBase,__extends(Iic,Hic),Object.defineProperty(Iic.prototype,"assetType",{get:function(){return Iic.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Iic.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){if(this._blendMode!=t){if(t!=Iic.ADD&&t!=Iic.MULTIPLY)throw new Error("Unknown blendmode!");this._blendMode=t,this.invalidateShaderProgram()}},enumerable:!0,configurable:!0}),Object.defineProperty(Iic.prototype,"lightMap",{get:function(){return this._lightMap},set:function(t){this._lightMap!=t&&(this._lightMap&&this.iRemoveTexture(this._lightMap),this._lightMap=t,this._lightMap&&this.iAddTexture(this._lightMap),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(Iic.prototype,"useSecondaryUV",{get:function(){return this._useSecondaryUV},set:function(t){this._useSecondaryUV!=t&&(this._useSecondaryUV=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Iic.MULTIPLY="multiply",Iic.ADD="add",Iic.assetType="[asset EffectLightMapMethod]",Iic),_Shader_EffectLightMapMethod=(Qic=_Shader_MethodBase,__extends(Ric,Qic),Ric.prototype._initVO=function(t){this._lightMap=this._shader.getAbstraction(this._method.lightMap),this._lightMap._initVO(t),this._method.useSecondaryUV?this._shader.secondaryUVDependencies++:this._shader.uvDependencies++},Ric.prototype._initConstants=function(){this._lightMap._initConstants()},Ric.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentVectorTemp(),r=this._lightMap._getFragmentCode(n,e,i,this._method.useSecondaryUV?i.secondaryUVVarying:i.uvVarying);switch(this._method.blendMode){case EffectLightMapMethod.MULTIPLY:r+="mul "+t+", "+t+", "+n+"\n";break;case EffectLightMapMethod.ADD:r+="add "+t+", "+t+", "+n+"\n"}return r},Ric.prototype._activate=function(){this._lightMap.activate()},Ric.prototype._setRenderState=function(t){this._lightMap._setRenderState(t)},Ric),Qic,Hic;function Ric(t,e){var i=Qic.call(this,t,e)||this;return i._method=t,i._shader=e,i}function Iic(t,e,i){void 0===e&&(e="multiply"),void 0===i&&(i=!1);var n=Hic.call(this)||this;if(e!=Iic.ADD&&e!=Iic.MULTIPLY)throw new Error("Unknown blendmode!");return n._lightMap=t,n._blendMode=e,n._useSecondaryUV=i,n._lightMap&&n.iAddTexture(n._lightMap),n}ShaderBase.registerAbstraction(_Shader_EffectLightMapMethod,EffectLightMapMethod);var EffectProjectiveTextureMethod=(ajc=MethodBase,__extends(bjc,ajc),Object.defineProperty(bjc.prototype,"assetType",{get:function(){return bjc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(bjc.prototype,"exposure",{get:function(){return this._exposure},set:function(t){this._exposure!=t&&(this._exposure=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(bjc.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode!=t&&(this._mode=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(bjc.prototype,"projector",{get:function(){return this._projector},set:function(t){this._projector!=t&&(this._projector&&this._projector.removeEventListener(TextureProjectorEvent.TEXTURE_CHANGE,this._onTextureChangedDelegate),this._projector=t,this._projector&&this._projector.addEventListener(TextureProjectorEvent.TEXTURE_CHANGE,this._onTextureChangedDelegate),this.updateTexture())},enumerable:!0,configurable:!0}),bjc.prototype._onTextureChanged=function(t){this.updateTexture()},bjc.prototype.updateTexture=function(){this._texture&&this.iRemoveTexture(this._texture),this._texture=this._projector?this._projector.texture:null,this._texture&&this.iAddTexture(this._texture),this.invalidateShaderProgram()},bjc.OVERLAY="overlay",bjc.MULTIPLY="multiply",bjc.ADD="add",bjc.MIX="mix",bjc.assetType="[asset EffectProjectiveTextureMethod]",bjc),_Shader_EffectProjectiveTextureMethod=(ljc=_Shader_MethodBase,__extends(mjc,ljc),mjc.prototype._initVO=function(t){this._texture=this._shader.getAbstraction(this._method.projector.texture),this._texture._initVO(t)},mjc.prototype._initConstants=function(){this._texture._initConstants();var t=this._exposureIndex,e=this._shader.fragmentConstantData;e[t]=this._method.exposure,e[t+1]=.5,e[t+2]=4,e[t+3]=-1,this._projectionMatrix=new Matrix3D(new Float32Array(this._shader.vertexConstantData.buffer,4*this._projectionIndex,16))},mjc.prototype._cleanCompilationData=function(){ljc.prototype._cleanCompilationData.call(this),this._uvVarying=null,this._projectionMatrix=null},mjc.prototype._getVertexCode=function(t,e){var i="",n=t.getFreeVertexConstant();return t.getFreeVertexConstant(),t.getFreeVertexConstant(),t.getFreeVertexConstant(),this._projectionIndex=4*n.index,this._uvVarying=t.getFreeVarying(),i+("m44 "+this._uvVarying+", "+e.animatedPosition)+", "+n+"\n"},mjc.prototype._getFragmentCode=function(t,e,i){var n="",r=e.getFreeFragmentVectorTemp();e.addFragmentTempUsages(r,1);var o=e.getFreeFragmentVectorTemp(),s=e.getFreeFragmentConstant();if(this._exposureIndex=4*s.index,n+=this._texture._getFragmentCode(r,e,i,this._uvVarying),n+="mul "+r+", "+r+", "+s+".xxx\nadd "+r+", "+r+", "+s+".xxx\n",this._method.mode==EffectProjectiveTextureMethod.MULTIPLY)n+="mul "+t+".xyz, "+t+".xyz, "+r+".xyz\t\t\t\n";else if(this._method.mode==EffectProjectiveTextureMethod.ADD)n+="add "+t+".xyz, "+t+".xyz, "+r+".xyz\t\t\t\n";else if(this._method.mode==EffectProjectiveTextureMethod.MIX)n+="sub "+r+".xyz, "+r+".xyz, "+t+".xyz\t\t\t\t\nmul "+r+".xyz, "+r+".xyz, "+r+".w\t\t\t\t\t\t\nadd "+t+".xyz, "+t+".xyz, "+r+".xyz\t\t\t\n";else{if(this._method.mode!=EffectProjectiveTextureMethod.OVERLAY)throw new ErrorBase('Unknown mode "'+this._method.mode+'"');n+="sge "+o+", "+t+", "+s+".yyy\n",n+="sub "+t+", "+t+", "+o+"\n",n+="sub "+r+", "+r+", "+o+"\n",n+="mul "+r+", "+r+", "+t+"\n",n+="sub "+t+", "+s+".yyy, "+o+"\n",n+="mul "+t+", "+s+".zzz, "+t+"\n",n+="mul "+r+", "+r+", "+t+"\n",n+="add "+t+", "+r+", "+o+"\n"}return e.removeFragmentTempUsage(r),n},mjc.prototype._setRenderState=function(t){var e=Matrix3D.CALCULATION_MATRIX;e.copyFrom(this._method.projector.projection.viewMatrix3D),e.prepend(t.renderSceneTransform),this._projectionMatrix.copyFrom(e,!0),this._texture._setRenderState(t)},mjc.prototype._activate=function(){this._texture.activate(),this._invalid&&(this._shader.fragmentConstantData[this._exposureIndex]=this._method.exposure)},mjc),ljc,ajc;function mjc(t,e){var i=ljc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function bjc(t,e,i){void 0===e&&(e="multiply"),void 0===i&&(i=1);var n=ajc.call(this)||this;return n._onTextureChangedDelegate=function(t){return n._onTextureChanged(t)},n._projector=t,n._exposure=i,n._mode=e,n._projector.addEventListener(TextureProjectorEvent.TEXTURE_CHANGE,n._onTextureChangedDelegate),n}ShaderBase.registerAbstraction(_Shader_EffectProjectiveTextureMethod,EffectProjectiveTextureMethod);var EffectRefractionEnvMapMethod=(Gjc=EffectEnvMapMethod,__extends(Hjc,Gjc),Object.defineProperty(Hjc.prototype,"assetType",{get:function(){return Hjc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Hjc.prototype,"refractionIndex",{get:function(){return this._refractionIndex},set:function(t){this._refractionIndex=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(Hjc.prototype,"dispersionR",{get:function(){return this._dispersionR},set:function(t){this._dispersionR!=t&&(this._dispersionR=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(Hjc.prototype,"dispersionG",{get:function(){return this._dispersionG},set:function(t){this._dispersionG!=t&&(this._dispersionG=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Object.defineProperty(Hjc.prototype,"dispersionB",{get:function(){return this._dispersionB},set:function(t){this._dispersionB!=t&&(this._dispersionB=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Hjc.assetType="[asset EffectRefractionEnvMapMethod]",Hjc),_Shader_EffectRefractionEnvMapMethod=(Tjc=_Shader_EffectEnvMapMethod,__extends(Ujc,Tjc),Ujc.prototype._initVO=function(t){Tjc.prototype._initVO.call(this,t),this._useDispersion=!(this._method.dispersionR==this._method.dispersionB&&this._method.dispersionR==this._method.dispersionG)},Ujc.prototype._getFragmentCode=function(t,e,i){var n,r,o,s=e.getFreeFragmentConstant(),a=e.getFreeFragmentConstant(),l="";this._fragmentIndex=4*s.index,n=e.getFreeFragmentVectorTemp(),e.addFragmentTempUsages(n,1),r=e.getFreeFragmentVectorTemp(),e.addFragmentTempUsages(r,1),o=e.getFreeFragmentVectorTemp(),e.addFragmentTempUsages(o,1);var c=i.viewDirFragment,h=i.normalFragment;return l+="neg "+c+".xyz, "+c+".xyz\n",l+="dp3 "+o+".x, "+c+".xyz, "+h+".xyz\nmul "+o+".w, "+o+".x, "+o+".x\nsub "+o+".w, "+a+".x, "+o+".w\nmul "+o+".w, "+s+".x, "+o+".w\nmul "+o+".w, "+s+".x, "+o+".w\nsub "+o+".w, "+a+".x, "+o+".w\nsqt "+o+".y, "+o+".w\nmul "+o+".x, "+s+".x, "+o+".x\nadd "+o+".x, "+o+".x, "+o+".y\nmul "+o+".xyz, "+o+".x, "+h+".xyz\nmul "+n+", "+s+".x, "+c+"\nsub "+n+".xyz, "+n+".xyz, "+o+".xyz\nnrm "+n+".xyz, "+n+".xyz\n"+this._envMap._getFragmentCode(r,e,i,n)+"sub "+r+".w, "+r+".w, fc0.x\t\nkil "+r+".w\n",this._useDispersion&&(l+="dp3 "+o+".x, "+c+".xyz, "+h+".xyz\nmul "+o+".w, "+o+".x, "+o+".x\nsub "+o+".w, "+a+".x, "+o+".w\nmul "+o+".w, "+s+".y, "+o+".w\nmul "+o+".w, "+s+".y, "+o+".w\nsub "+o+".w, "+a+".x, "+o+".w\nsqt "+o+".y, "+o+".w\nmul "+o+".x, "+s+".y, "+o+".x\nadd "+o+".x, "+o+".x, "+o+".y\nmul "+o+".xyz, "+o+".x, "+h+".xyz\nmul "+n+", "+s+".y, "+c+"\nsub "+n+".xyz, "+n+".xyz, "+o+".xyz\nnrm "+n+".xyz, "+n+".xyz\n"+this._envMap._getFragmentCode(o,e,i,n)+"mov "+r+".y, "+o+".y\n",l+="dp3 "+o+".x, "+c+".xyz, "+h+".xyz\nmul "+o+".w, "+o+".x, "+o+".x\nsub "+o+".w, "+a+".x, "+o+".w\nmul "+o+".w, "+s+".z, "+o+".w\nmul "+o+".w, "+s+".z, "+o+".w\nsub "+o+".w, "+a+".x, "+o+".w\nsqt "+o+".y, "+o+".w\nmul "+o+".x, "+s+".z, "+o+".x\nadd "+o+".x, "+o+".x, "+o+".y\nmul "+o+".xyz, "+o+".x, "+h+".xyz\nmul "+n+", "+s+".z, "+c+"\nsub "+n+".xyz, "+n+".xyz, "+o+".xyz\nnrm "+n+".xyz, "+n+".xyz\n"+this._envMap._getFragmentCode(o,e,i,n)+"mov "+r+".z, "+o+".z\n"),l+="sub "+r+".xyz, "+r+".xyz, "+t+".xyz\nmul "+r+".xyz, "+r+".xyz, "+s+".w\nadd "+t+".xyz, "+t+".xyz, "+r+".xyz\n",e.removeFragmentTempUsage(o),e.removeFragmentTempUsage(n),e.removeFragmentTempUsage(r),l+"neg "+c+".xyz, "+c+".xyz\n"},Ujc.prototype._updateProperties=function(){var t=this._fragmentIndex,e=this._shader.fragmentConstantData,i=this._method.refractionIndex;e[t]=this._method.dispersionR+i,this._useDispersion&&(e[t+1]=this._method.dispersionG+i,e[t+2]=this._method.dispersionB+i),e[t+3]=this._method.alpha},Ujc),Tjc,Gjc;function Ujc(){return null!==Tjc&&Tjc.apply(this,arguments)||this}function Hjc(t,e,i,n,r,o){void 0===e&&(e=1),void 0===i&&(i=.1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=0);var s=Gjc.call(this,t,e)||this;return s._dispersionR=0,s._dispersionG=0,s._dispersionB=0,s._refractionIndex=i,s._dispersionR=n,s._dispersionG=r,s._dispersionB=o,s}ShaderBase.registerAbstraction(_Shader_EffectRefractionEnvMapMethod,EffectRefractionEnvMapMethod);var EffectRimLightMethod=(ikc=MethodBase,__extends(jkc,ikc),Object.defineProperty(jkc.prototype,"assetType",{get:function(){return jkc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(jkc.prototype,"color",{get:function(){return this._color},set:function(t){this._power!=t&&(this._color=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(jkc.prototype,"strength",{get:function(){return this._strength},set:function(t){this._strength!=t&&(this._strength=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(jkc.prototype,"power",{get:function(){return this._power},set:function(t){this._power!=t&&(this._power=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(jkc.prototype,"blendMode",{get:function(){return this._blendMode},set:function(t){this._blendMode!=t&&(this._blendMode=t,this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),jkc.ADD="add",jkc.MULTIPLY="multiply",jkc.MIX="mix",jkc.assetType="[asset EffectRimLightMethod]",jkc),_Shader_EffectRimLightMethod=(tkc=_Shader_MethodBase,__extends(ukc,tkc),ukc.prototype._initVO=function(t){t.needsNormals=!0,t.needsView=!0},ukc.prototype._activate=function(){var t,e,i;this._invalid&&(t=this._rimColorIndex,e=this._shader.fragmentConstantData,i=this._method.color,e[t]=(i>>16&255)/255,e[t+1]=(i>>8&255)/255,e[t+2]=(255&i)/255,e[t+3]=1,e[t+4]=this._method.strength,e[t+5]=this._method.power)},ukc.prototype._getFragmentCode=function(t,e,i){var n=e.getFreeFragmentConstant(),r=e.getFreeFragmentConstant(),o=e.getFreeFragmentVectorTemp(),s="";return this._rimColorIndex=4*n.index,s+="dp3 "+o+".x, "+i.viewDirFragment+".xyz, "+i.normalFragment+".xyz\nsat "+o+".x, "+o+".x\nsub "+o+".x, "+n+".w, "+o+".x\npow "+o+".x, "+o+".x, "+r+".y\nmul "+o+".x, "+o+".x, "+r+".x\nsub "+o+".x, "+n+".w, "+o+".x\nmul "+t+".xyz, "+t+".xyz, "+o+".x\nsub "+o+".w, "+n+".w, "+o+".x\n",this._method.blendMode==EffectRimLightMethod.ADD?s+="mul "+o+".xyz, "+o+".w, "+n+".xyz\nadd "+t+".xyz, "+t+".xyz, "+o+".xyz\n":this._method.blendMode==EffectRimLightMethod.MULTIPLY?s+="mul "+o+".xyz, "+o+".w, "+n+".xyz\nmul "+t+".xyz, "+t+".xyz, "+o+".xyz\n":s+="sub "+o+".xyz, "+n+".xyz, "+t+".xyz\nmul "+o+".xyz, "+o+".xyz, "+o+".w\nadd "+t+".xyz, "+t+".xyz, "+o+".xyz\n",s},ukc),tkc,ikc;function ukc(t,e){var i=tkc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function jkc(t,e,i,n){void 0===t&&(t=16777215),void 0===e&&(e=.4),void 0===i&&(i=2),void 0===n&&(n="mix");var r=ikc.call(this)||this;return r._blendMode=n,r._strength=e,r._power=i,r._color=t,r}ShaderBase.registerAbstraction(_Shader_EffectRimLightMethod,EffectRimLightMethod);var NormalBasicMethod=(Jkc=MethodBase,__extends(Kkc,Jkc),Object.defineProperty(Kkc.prototype,"assetType",{get:function(){return Kkc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(Kkc.prototype,"texture",{get:function(){return this._texture},set:function(t){this._texture!=t&&(this._texture&&this.iRemoveTexture(this._texture),this._texture=t,this._texture&&this.iAddTexture(this._texture),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),Kkc.prototype.copyFrom=function(t){null!=t.texture&&(this.texture=t.texture)},Kkc.prototype.dispose=function(){this._texture&&(this._texture=null)},Kkc.assetType="[asset NormalBasicMethod]",Kkc),_Shader_NormalBasicMethod=(Qkc=_Shader_MethodBase,__extends(Rkc,Qkc),Rkc.prototype._isUsed=function(){return!(!this._texture||!this._shader.normalDependencies)},Rkc.prototype._initVO=function(t){this._method.texture&&(this._texture=this._shader.getAbstraction(this._method.texture),this._texture._initVO(t),this._shader.uvDependencies++)},Rkc.prototype._initConstants=function(){this._method.texture&&this._texture._initConstants()},Rkc.prototype._outputsTangentNormals=function(){return!0},Rkc.prototype._activate=function(){this._texture&&this._texture.activate()},Rkc.prototype._setRenderState=function(t){this._texture&&this._texture._setRenderState(t)},Rkc.prototype._getFragmentCode=function(t,e,i){var n="";return this._texture&&(n+=this._texture._getFragmentCode(t,e,i,i.uvVarying)),n+("sub "+t+".xyz, "+t+".xyz, "+i.commons)+".xxx\nnrm "+t+".xyz, "+t+"\n"},Rkc),Qkc,Jkc;function Rkc(t,e){var i=Qkc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function Kkc(t){void 0===t&&(t=null);var e=Jkc.call(this)||this;return e._texture=t,e._texture&&e.iAddTexture(e._texture),e}ShaderBase.registerAbstraction(_Shader_NormalBasicMethod,NormalBasicMethod);var NormalHeightMapMethod=(_kc=NormalBasicMethod,__extends(alc,_kc),Object.defineProperty(alc.prototype,"assetType",{get:function(){return alc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(alc.prototype,"worldXYRatio",{get:function(){return this._worldXYRatio},enumerable:!0,configurable:!0}),Object.defineProperty(alc.prototype,"worldXZRatio",{get:function(){return this._worldXZRatio},enumerable:!0,configurable:!0}),alc.prototype.copyFrom=function(t){_kc.prototype.copyFrom.call(this,t),this._worldXYRatio=t._worldXYRatio,this._worldXZRatio=t._worldXZRatio},alc.assetType="[asset NormalHeightMapMethod]",alc),_Shader_NormalHeightMapMethod=(hlc=_Shader_NormalBasicMethod,__extends(ilc,hlc),ilc.prototype._initConstants=function(){hlc.prototype._initConstants.call(this);var t=this._fragmentConstantsIndex,e=this._shader.fragmentConstantData,i=this._method.texture.image;e[t]=1/i.width,e[t+1]=1/i.height,e[t+2]=0,e[t+3]=1,e[t+4]=this._method.worldXYRatio,e[t+5]=this._method.worldXZRatio},Object.defineProperty(ilc.prototype,"tangentSpace",{get:function(){return!1},enumerable:!0,configurable:!0}),ilc.prototype._getFragmentCode=function(t,e,i){var n="",r=e.getFreeFragmentVectorTemp();e.addFragmentTempUsages(r,1);var o=e.getFreeFragmentConstant(),s=e.getFreeFragmentConstant();return this._fragmentConstantsIndex=4*o.index,n+=this._texture._getFragmentCode(t,e,i,i.uvVarying)+"add "+r+", "+i.uvVarying+", "+o+".xzzz\n"+this._texture._getFragmentCode(r,e,i,r)+"sub "+t+".x, "+t+".x, "+r+".x\nadd "+r+", "+i.uvVarying+", "+o+".zyzz\n"+this._texture._getFragmentCode(r,e,i,r)+"sub "+t+".z, "+t+".z, "+r+".x\nmov "+t+".y, "+o+".w\nmul "+t+".xz, "+t+".xz, "+s+".xy\nnrm "+t+".xyz, "+t+".xyz\n",e.removeFragmentTempUsage(r),n},ilc),hlc,_kc;function ilc(t,e){return hlc.call(this,t,e)||this}function alc(t,e,i,n){var r=_kc.call(this)||this;return r.texture=t,r._worldXYRatio=e/i,r._worldXZRatio=n/i,r}ShaderBase.registerAbstraction(_Shader_NormalHeightMapMethod,NormalHeightMapMethod);var NormalSimpleWaterMethod=(vlc=NormalBasicMethod,__extends(wlc,vlc),Object.defineProperty(wlc.prototype,"assetType",{get:function(){return wlc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(wlc.prototype,"water1OffsetX",{get:function(){return this._water1OffsetX},set:function(t){this._water1OffsetX=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(wlc.prototype,"water1OffsetY",{get:function(){return this._water1OffsetY},set:function(t){this._water1OffsetY=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(wlc.prototype,"water2OffsetX",{get:function(){return this._water2OffsetX},set:function(t){this._water2OffsetX=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(wlc.prototype,"water2OffsetY",{get:function(){return this._water2OffsetY},set:function(t){this._water2OffsetY=t,this.invalidate()},enumerable:!0,configurable:!0}),Object.defineProperty(wlc.prototype,"secondaryNormalMap",{get:function(){return this._secondaryNormalMap},set:function(t){this._secondaryNormalMap!=t&&(this._secondaryNormalMap&&this.iRemoveTexture(this._secondaryNormalMap),this._secondaryNormalMap=t,this._secondaryNormalMap&&this.iAddTexture(this._secondaryNormalMap),this.invalidateShaderProgram())},enumerable:!0,configurable:!0}),wlc.prototype.dispose=function(){vlc.prototype.dispose.call(this),this._secondaryNormalMap=null},wlc.assetType="[asset NormalSimpleWaterMethod]",wlc),_Shader_NormalSimpleWaterMethod=(Flc=_Shader_NormalBasicMethod,__extends(Glc,Flc),Glc.prototype._initConstants=function(){Flc.prototype._initConstants.call(this);var t=this._fragmentConstantsIndex,e=this._shader.fragmentConstantData;e[t]=.5,e[t+1]=0,e[t+2]=0,e[t+3]=1},Glc.prototype._initVO=function(t){Flc.prototype._initVO.call(this,t),this._method.secondaryNormalMap&&(this._secondaryNormalMap=this._shader.getAbstraction(this._method.secondaryNormalMap),this._shader.uvDependencies++)},Glc.prototype.onClear=function(t){Flc.prototype.onClear.call(this,t),this._secondaryNormalMap=null},Glc.prototype._activate=function(){var t,e;Flc.prototype._activate.call(this),this._invalid&&((t=this._shader.fragmentConstantData)[(e=this._fragmentConstantsIndex)+4]=this._method.water1OffsetX,t[e+5]=this._method.water1OffsetY,t[e+6]=this._method.water2OffsetX,t[e+7]=this._method.water2OffsetY),this._secondaryNormalMap&&this._secondaryNormalMap.activate()},Glc.prototype._setRenderState=function(t){Flc.prototype._setRenderState.call(this,t),this._secondaryNormalMap&&this._secondaryNormalMap._setRenderState(t)},Glc.prototype._getFragmentCode=function(t,e,i){var n="",r=e.getFreeFragmentVectorTemp();e.addFragmentTempUsages(r,1);var o=e.getFreeFragmentConstant(),s=e.getFreeFragmentConstant();return this._fragmentConstantsIndex=4*o.index,n+="add "+r+", "+i.uvVarying+", "+s+".xyxy\n",this._texture&&(n+=this._texture._getFragmentCode(t,e,i,r)),n+="add "+r+", "+i.uvVarying+", "+s+".zwzw\n",this._secondaryNormalMap&&(n+=this._secondaryNormalMap._getFragmentCode(r,e,i,r)),n+("add "+t+", "+t+", "+r+"\t\t\nmul "+t+", "+t+", "+o+".x\t\nsub "+t+".xyz, "+t+".xyz, "+i.commons)+".xxx\t\nnrm "+t+".xyz, "+t+".xyz\t\t\t\t\t\t\t\n"},Glc),Flc,vlc;function Glc(t,e){return Flc.call(this,t,e)||this}function wlc(t,e){void 0===t&&(t=null),void 0===e&&(e=null);var i=vlc.call(this,t)||this;return i._water1OffsetX=0,i._water1OffsetY=0,i._water2OffsetX=0,i._water2OffsetY=0,i._secondaryNormalMap=e,i._secondaryNormalMap&&i.iAddTexture(i._secondaryNormalMap),i}ShaderBase.registerAbstraction(_Shader_NormalSimpleWaterMethod,NormalSimpleWaterMethod);var ShadowMethodBase=(Xlc=CompositeMethodBase,__extends(Ylc,Xlc),Object.defineProperty(Ylc.prototype,"castingLight",{get:function(){return this._castingLight},enumerable:!0,configurable:!0}),Ylc),_Shader_ShadowMethodBase=(_lc=_Shader_CompositeMethodBase,__extends(amc,_lc),amc.prototype._initVO=function(t){_lc.prototype._initVO.call(this,t),this._baseTexture=this._baseChunk.texture},amc),ShadowDitheredMethod=(fmc=ShadowMethodBase,__extends(gmc,fmc),Object.defineProperty(gmc.prototype,"assetType",{get:function(){return gmc.assetType},enumerable:!0,configurable:!0}),Object.defineProperty(gmc.prototype,"numSamples",{get:function(){return this._numSamples},set:function(t){t<1?t=1:24>1,l=0;l\nmul "+r+".xyz, "+r+", "+e+"\n",null!=this._modulateFunction&&(o+=this._modulateFunction(r,i,n)),this._pIsFirstLight||(o+="add "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+r+"\n",i.removeFragmentTempUsage(r)),this._pIsFirstLight=!1,o},$nc.prototype._getFragmentCode=function(t,e,i){var n="";return i.shadowTarget&&(n+="mul "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+i.shadowTarget+".w\n"),this._texture&&(n+="mul "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+this._specularTexData+".x\n",e.removeFragmentTempUsage(this._specularTexData)),n+="mul "+this._totalLightColorReg+".xyz, "+this._totalLightColorReg+", "+this._specularDataRegister+"\nadd "+t+".xyz, "+t+", "+this._totalLightColorReg+"\n",e.removeFragmentTempUsage(this._totalLightColorReg),n},$nc.prototype._activate=function(){var t,e;this._texture&&this._texture.activate(),this._invalid&&(t=this._specularDataIndex,(e=this._shader.fragmentConstantData)[t]=(this._method.color>>16&255)/255*this._method.strength,e[t+1]=(this._method.color>>8&255)/255*this._method.strength,e[t+2]=(255&this._method.color)/255*this._method.strength,e[t+3]=this._method.gloss)},$nc.prototype._setRenderState=function(t){this._texture&&this._texture._setRenderState(t)},$nc),Znc,Qnc;function $nc(t,e){var i=Znc.call(this,t,e)||this;return i._method=t,i._shader=e,i}function Rnc(){var t=Qnc.call(this)||this;return t._gloss=50,t._strength=1,t._color=16777215,t}ShaderBase.registerAbstraction(_Shader_SpecularBasicMethod,SpecularBasicMethod);var SpecularAnisotropicMethod=(Boc=SpecularBasicMethod,__extends(Coc,Boc),Object.defineProperty(Coc.prototype,"assetType",{get:function(){return Coc.assetType},enumerable:!0,configurable:!0}),Coc.assetType="[asset SpecularAnisotropicMethod]",Coc),_Shader_SpecularAnisotropicMethod=(Doc=_Shader_SpecularBasicMethod,__extends(Eoc,Doc),Eoc.prototype._initVO=function(t){Doc.prototype._initVO.call(this,t),t.needsTangents=0(i=this._lightingPass.lightPicker.directionalLights.length)&&(c=1,r-=i);cthis.numDirectionalLights&&(i=this.numDirectionalLights),o=0;oa)for(o=s+12*(this.numDirectionalLights-a);s(i=this._lightingPass.lightPicker.pointLights.length)?(c=1,r-=i):c=0;ca)for(o=s+12*(a-this.numPointLights);sthis.numLightProbes&&(n=this.numLightProbes);for(var s=0;sthis._numEffectDependencies-1?null:this._methods[t+this._methods.length-this._numEffectDependencies]},Arc.prototype.addEffectMethodAt=function(t,e){this._addDependency(t,!0,e)},Arc.prototype.removeEffectMethod=function(t){this._removeDependency(t,!0)},Arc.prototype.removeEffectMethodAt=function(t){var e=this.getEffectMethodAt(t);null!=e&&this._removeDependency(e,!0)},Object.defineProperty(Arc.prototype,"normalMethod",{get:function(){return this._normalMethod},set:function(t){this._normalMethod!=t&&(this._normalMethod&&(this._removeDependency(this._normalMethod),this._normalChunk=null),(this._normalMethod=t)&&(this._normalChunk=this._shader.getAbstraction(t),this._addDependency(t)))},enumerable:!0,configurable:!0}),Object.defineProperty(Arc.prototype,"ambientMethod",{get:function(){return this._ambientMethod},set:function(t){this._ambientMethod!=t&&(this._ambientMethod&&(this._removeDependency(this._ambientMethod),this._ambientChunk=null),(this._ambientMethod=t)&&(this._ambientChunk=this._shader.getAbstraction(t),this._addDependency(t)))},enumerable:!0,configurable:!0}),Object.defineProperty(Arc.prototype,"shadowMethod",{get:function(){return this._shadowMethod},set:function(t){this._shadowMethod!=t&&(this._shadowMethod&&(this._removeDependency(this._shadowMethod),this._shadowChunk=null),(this._shadowMethod=t)&&(this._shadowChunk=this._shader.getAbstraction(t),this._addDependency(t)))},enumerable:!0,configurable:!0}),Object.defineProperty(Arc.prototype,"diffuseMethod",{get:function(){return this._diffuseMethod},set:function(t){this._diffuseMethod!=t&&(this._diffuseMethod&&(this._removeDependency(this._diffuseMethod),this._diffuseChunk=null),t&&(this._diffuseChunk=this._shader.getAbstraction(t),this._addDependency(t)))},enumerable:!0,configurable:!0}),Object.defineProperty(Arc.prototype,"specularMethod",{get:function(){return this._specularMethod},set:function(t){this._specularMethod!=t&&(this._specularMethod&&(this._removeDependency(this._specularMethod),this._specularChunk=null),t&&(this._specularChunk=this._shader.getAbstraction(t),this._addDependency(t)))},enumerable:!0,configurable:!0}),Arc.prototype.dispose=function(){for(this._lightPicker&&this._lightPicker.removeEventListener(AssetEvent.INVALIDATE,this._onLightsChangeDelegate);this._methods.length;)this._removeDependency(this._methods[0]);zrc.prototype.dispose.call(this),this._chunks=null,this._methods=null},Arc.prototype.onMethodInvalidated=function(t){this.invalidate()},Arc.prototype._activate=function(){var t;zrc.prototype._activate.call(this);for(var e=this._chunks.length,i=0;i=this._numCascades)throw new Error("index must be smaller than the number of cascades!");this._splitRatios[t]=e},Auc.prototype.getDepthProjections=function(t){return this._depthProjections[t].viewMatrix3D},Auc.prototype.init=function(){this._splitRatios=new Array(this._numCascades),this._nearPlaneDistances=new Array(this._numCascades);for(var t=1,e=this._numCascades-1;0<=e;--e)this._splitRatios[e]=t,t*=.4;for(this._texOffsetsX=Array(-1,1,-1,1),this._texOffsetsY=Array(1,1,-1,-1),this._pScissorRects=new Array(4),this._depthProjections=new Array,e=0;e_&&(_=s),(a=r+(this._localFrustum[f+12]-r)*e)_&&(_=c),f+=3;var m=p-h,g=d-u,y=1/(_-1);h<0&&(h-=this._snap),u<0&&(u-=this._snap),h=Math.floor(h/this._snap)*this._snap,u=Math.floor(u/this._snap)*this._snap;var b=2*this._snap,p=h+(m=Math.floor(m/b+1)*b),d=u+(g=Math.floor(g/b+1)*b),m=1/m,g=1/g,v=t._rawData;v[0]=2*m,v[5]=2*g,v[10]=y,v[12]=-(p+h)*m,v[13]=-(d+u)*g,v[14]=-1*y,v[15]=1,v[1]=v[2]=v[3]=v[4]=v[6]=v[7]=v[8]=v[9]=v[11]=0,t.appendScale(.96,.96,1),t.appendTranslation(i,n,0),t.appendScale(.5,.5,1)},Object.defineProperty(Auc.prototype,"_iNearPlaneDistances",{get:function(){return this._nearPlaneDistances},enumerable:!0,configurable:!0}),Auc.assetType="[asset CascadeShadowMapper]",Auc),_Shader_CascadeShadowMapper=(ovc=_Shader_DirectionalShadowMapper,__extends(pvc,ovc),pvc.prototype._initVO=function(t){ovc.prototype._initVO.call(this,t),t.needsProjection=!0},pvc.prototype._initConstants=function(){ovc.prototype._initConstants.call(this);var t=this._shader.fragmentConstantData,e=this._shader.vertexConstantData,i=this._fragmentConstantsIndex;t[i]=1,t[i+1]=1/255,t[i+2]=1/65025,t[i+3]=1/16581375,t[i+6]=.5,t[i+7]=-.5,e[i=this._vertexConstantsIndex]=.5,e[i+1]=-.5,e[i+2]=0;var n=this._mapper.numCascades;this._projectionMatrices=new Array(n);for(var r=0;re.height?-1:1});var M,D=0,I=i,O=1;if(e)this.initFontSize(e),O=this._size_multiply;else{O=I/Math.sqrt(T)*1.2;for(var L=!0,F=0;L;)for(L=!1,y=t,a=g=0;a=I&&(y+=D+2*(g=t),D=0),D=I&&(y+=D+2*(g=t),D=0),x[a].height*=O,x[a].height>D&&(D=x[a].height),I<=y+D+2*t&&(y=g=t,D=0,b[++v]=[]),M.fnt_channel=v,m=0;m<_.count;m++)P=(f[2*m]-C)*O+g,E=(f[2*m+1]-w)*O+y,S<(b[v][b[v].length]=P)&&(S=P),A<(b[v][b[v].length]=E)&&(A=E);M.fnt_uv=new Rectangle(g/I,1-y/I,(S-g)/I,(A-y)/I),g+=x[a].width*O+t}var B=[];for(a=0;a=e.size),o=t.getTextShapeForIdentifierAndFormat(e.color.toString()+r.toString()+"0",e),s={},a={},l=ColorUtils.float32ColorToARGB(e.color);(T=new MethodMaterial(this._fnt_channels[0])).colorTransform=new ColorTransform(l[1]/255,l[2]/255,l[3]/255),T.bothSides=!0,T.alphaBlending=!0,T.useColorTransform=!0,T.style.sampler=new ImageSampler(!1,!0,!0),o.fntMaterial=r?T:null,s[e.color.toString()+r.toString()+"0"]=o;var c=e.clone();c.color=16777215;var h=t.getTextShapeForIdentifierAndFormat(r.toString()+"0",c);a[r.toString()+"0"]=h,(T=new MethodMaterial(this._fnt_channels[0])).bothSides=!0,T.alphaBlending=!0,T.useColorTransform=!0,T.style.sampler=new ImageSampler(!1,!0,!0),h.fntMaterial=r?T:null;var u,p,d,_,f,m=null,g=0,y=i+5*n,b=0,v=0,x=0,A=0,S=0,w=!1,C=t.selectionBeginIndex,P=t.selectionEndIndex;t.selectionEndIndex","g"),"
")).replace(new RegExp("
","g"),"
")).replace(new RegExp("
","g"),"
")).replace(new RegExp("","g"),"")).replace(new RegExp("","g"),"")).replace(new RegExp("","g"),"

")).replace(new RegExp("","g"),"")).replace(new RegExp("","g"),"")).replace(new RegExp("","g"),"")).replace(new RegExp("& ","g"),"& ");for(var i=0,n=[],r=[],o=[];i",n.pop(),s--;n.pop()}}else if("/"==e[i+1]&&"b"==e[i+2]){for(s=n.length,a=-1;0",n.pop(),s--;n.pop()}}else if("/"==e[i+1]&&"i"==e[i+2]){for(s=n.length,a=-1;0",n.pop(),s--;n.pop()}}else if("/"==e[i+1]&&"u"==e[i+2]){for(s=n.length,a=-1;0",n.pop(),s--;n.pop()}}else if("/"==e[i+1]&&"l"==e[i+2]&&"i"==e[i+3]){for(s=n.length,a=-1;0",n.pop(),s--;n.pop()}}else if("/"==e[i+1]&&"f"==e[i+2]&&"o"==e[i+3]&&"n"==e[i+4]&&"t"==e[i+5]){for(s=n.length,a=-1;0",n.pop(),s--;n.pop()}}i++}else i++;for(s=n.length;0";for(var l=0,c=o.length,h=0;h"+e+"

","application/xml");return d&&d.firstChild&&(u.multiline=0=this.lines_start_x.length&&(i=this.lines_start_x.length-1),i<0&&(i=0),0<=i&&n<0&&void 0!==this.lines_start_x[i]&&(n=e.x<=this.lines_start_x[i]?this.lines_charIdx_start[i]:this.lines_charIdx_end[i]),(i<0||n<0)&&(n=0),n},tFc.prototype.startSelectionByMouse=function(t){this._selectionBeginIndex=this.findCharIdxForMouse(t),this._selectionEndIndex=this._selectionBeginIndex,this._glyphsDirty=!0,this.reConstruct(),this.cursorBlinking=!1,this.drawSelectionGraphics()},tFc.prototype.stopSelectionByMouse=function(t){this._selectionEndIndex=this.findCharIdxForMouse(t),this._glyphsDirty=!0,this.reConstruct(),this.drawSelectionGraphics()},tFc.prototype.updateSelectionByMouse=function(t){this._selectionEndIndex=this.findCharIdxForMouse(t),this._glyphsDirty=!0,this.reConstruct(),this.drawSelectionGraphics()},tFc.prototype.drawSelectionGraphics=function(){this._selectionBeginIndex<0&&(this._selectionBeginIndex=0),this._selectionBeginIndex>this.char_positions_x.length&&(this._selectionBeginIndex=this.char_positions_x.length),this._selectionEndIndex<0&&(this._selectionEndIndex=0),this._selectionEndIndex>this.char_positions_x.length&&(this._selectionEndIndex=this.char_positions_x.length),this._selectionBeginIndex===this._selectionEndIndex?(this.showSelection=!1,this.drawCursor()):(this.showSelection=!0,this.drawSelectedBG())},tFc.prototype.scrollToCursor=function(t,e){},tFc.prototype.drawCursor=function(){var t,e,i,n,r,o,s,a,l,c;this._shapesDirty=!0,!this.cursorBlinking&&this.selectable&&this.selectionBeginIndex===this.selectionEndIndex&&(e=t=0,i=this.newTextFormat,0==this.char_positions_x.length?(t=this.textOffsetX+this._width/2+this._textWidth/2,"justify"==i.align||"center"==i.align||("right"==i.align?t=this.textOffsetX+this._width-2:"left"==i.align&&(t=this.textOffsetX+4+this._textWidth))):i=this._selectionBeginIndex==this.char_positions_x.length?(t=this.char_positions_x[this._selectionBeginIndex-1]+this.chars_width[this._selectionBeginIndex-1],e=this.char_positions_y[this._selectionBeginIndex-1],this.tf_per_char[this._selectionBeginIndex-1]):(t=this.char_positions_x[this._selectionBeginIndex],e=this.char_positions_y[this._selectionBeginIndex],this.tf_per_char[this._selectionBeginIndex]),i.font_table.initFontSize(i.size),n=i.font_table.getLineHeight(),r=this.getTextColorForTextFormat(i),(o=this.internalScale.x)<=0&&(o=1),s=[t-.5*o,e,o,n],this.cursorShape?GraphicsFactoryHelper.updateRectanglesShape(this.cursorShape,s):(this.cursorShape=GraphicsFactoryHelper.drawRectangles(s,r,1),this.cursorShape.usages++),this.cursorShape.style.color!==r&&(a=ColorUtils.float32ColorToARGB(r)[0],(l=MaterialManager.get_material_for_color(r,a/255||1)).colorPos&&(this.cursorShape.style=new Style,c=new ImageSampler,l.material.animateUVs=!0,this.cursorShape.style.color=r,this.cursorShape.style.addSamplerAt(c,l.material.getTextureAt(0)),this.cursorShape.style.uvMatrix=new Matrix(0,0,0,0,l.colorPos.x,l.colorPos.y))),this.scrollToCursor(t,e))},tFc.prototype.drawSelectedBG=function(){this._shapesDirty=!0,this._selectionBeginIndex<0&&(this._selectionBeginIndex=0),this._selectionBeginIndex>this.char_positions_x.length&&(this._selectionBeginIndex=this.char_positions_x.length);var t=this._selectionBeginIndex,e=this._selectionEndIndex;this._selectionEndIndexthis.char_positions_x.length?this.char_positions_x.length:e,u=t;u/g,"\\>")).replace(/\+/g,"\\+")).replace(/\*/g,"\\*")).replace(/\?/g,"\\?")).replace(/\[/g,"\\[")).replace(/\]/g,"\\]")).replace(/\$/g,"\\$")).replace(/\(/g,"\\(")).replace(/\)/g,"\\)")).replace(/\{/g,"\\{")).replace(/\}/g,"\\}")).replace(/\=/g,"\\=")).replace(/\!/g,"\\!")).replace(/\:/g,"\\:")).replace(/\|/g,"\\|")).replace(/\//g,"\\/")).replace(/\%/g,"\\%"),this._restrictRegex=new RegExp("[^"+t+"]","g")))},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"scrollH",{get:function(){return this._scrollH},set:function(t){t!=this._scrollH&&(this._scrollH=t)},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"scrollV",{get:function(){return this._scrollV},set:function(t){Math.floor(t)!=this._scrollH&&(this._scrollV=Math.floor(t),this._scrollV>this._maxScrollV&&(this._scrollV=this._maxScrollV),this.textChild&&(this.textChild.y=-this.lines_start_y[this._scrollV]))},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"selectable",{get:function(){return this._selectable},set:function(t){this.selectable!=t&&(this._selectable=t,(this.mouseEnabled=t)?(this.addEventListener(MouseEvent$1.DRAG_START,this.startSelectionByMouseDelegate),this.addEventListener(MouseEvent$1.DRAG_STOP,this.stopSelectionByMouseDelegate),this.addEventListener(MouseEvent$1.DRAG_MOVE,this.updateSelectionByMouseDelegate)):(this.removeEventListener(MouseEvent$1.DRAG_START,this.startSelectionByMouseDelegate),this.removeEventListener(MouseEvent$1.DRAG_STOP,this.stopSelectionByMouseDelegate),this.removeEventListener(MouseEvent$1.DRAG_MOVE,this.updateSelectionByMouseDelegate)))},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"selectionBeginIndex",{get:function(){return this._selectionBeginIndex},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"selectionEndIndex",{get:function(){return this._selectionEndIndex},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"text",{get:function(){return this._text},set:function(t){t=(t=void 0===t?"":t.toString()).replace(String.fromCharCode(160)," "),this._text!=t&&(this._labelData=null,""==(this._text=t)||13!=t.charCodeAt(t.length-1)&&10!=t.charCodeAt(t.length-1)||(t=t.slice(0,t.length-1)),""!=t&&3<=t.length&&"n"==t[t.length-1]&&"\\"==t[t.length-2]&&"\\"==t[t.length-3]&&(t=t.slice(0,t.length-3)),""!=t&&3<=t.length&&"n"==t[t.length-1]&&"\\"==t[t.length-2]&&(t=t.slice(0,t.length-2)),this._iText=t,this._textFormats=[this.newTextFormat],this._textFormatsIdx=[this._iText.length],this._textDirty=!0,this._autoSize!=TextFieldAutoSize.NONE?this.invalidate():this._implicitPartition&&this._implicitPartition.invalidateEntity(this))},enumerable:!0,configurable:!0}),tFc.prototype.setLabelData=function(t){this._labelData=t,this.isStatic=!0,this._iText="",this._textDirty=!1,this._positionsDirty=!1,this._glyphsDirty=!0,this._autoSize!=TextFieldAutoSize.NONE?this.invalidate():this._implicitPartition&&this._implicitPartition.invalidateEntity(this)},Object.defineProperty(tFc.prototype,"newTextFormat",{get:function(){return this._newTextFormat?this._newTextFormat:this._textFormat?this._textFormat:new TextFormat},set:function(t){this._newTextFormat=t?t.applyToFormat(this._textFormat.clone()):null},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"textFormat",{get:function(){return null==this._textFormat&&(this._textFormat=new TextFormat),this._textFormat},set:function(t){this._textFormat!=t&&(this._textDirty=!0,this._textFormat=t,this._autoSize!=TextFieldAutoSize.NONE?this.invalidate():this._implicitPartition&&this._implicitPartition.invalidateEntity(this))},enumerable:!0,configurable:!0}),tFc.prototype._acceptTraverser=function(t){this.maskMode||this._graphics._acceptTraverser(t)},Object.defineProperty(tFc.prototype,"scaleX",{get:function(){return this._transform.scale.x},set:function(t){this._transform.scale.x!=t&&this._setScaleX(t)},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"scaleY",{get:function(){return this._transform.scale.y},set:function(t){this._transform.scale.y!=t&&this._setScaleY(t)},enumerable:!0,configurable:!0}),Object.defineProperty(tFc.prototype,"textColor",{get:function(){return this._textColor},set:function(t){if(this._textColor!=t){if(this._textColor=t,this._textFormats){for(var e=this._textFormats.length;0p){for(this._textRuns_formats[this._textRuns_formats.length]=t,this._textRuns_words[this._textRuns_words.length]=this.words.length,r=p;r=_&&(l=!0),l?(this.words[this.words.length]=this.chars_codes.length-1,this.words[this.words.length]=0,this.words[this.words.length]=0,this.words[this.words.length]=s,this.words[this.words.length]=1,c++):(this.words[this.words.length-2]+=s,this.words[this.words.length-1]++),!1));this._textRuns_words[this._textRuns_words.length]=c,this._textRuns_words[this._textRuns_words.length]=h,this._textRuns_words[this._textRuns_words.length]=u,this._maxWidthLinethis._width){x=this.lines_charIdx_start[this._biggestLine],D=this.lines_charIdx_end[this._biggestLine];for(var F=0;xthis._width){this._maxScrollH=D;break}}if(this._textHeight>this._height)for(var B=this.lines_height.length,F=4;0this._height){this._maxScrollV=B+1;break}this.updateMaskMode()},tFc.prototype.buildGlyphsForLabelData=function(){this._clearTextShapes();for(var t,e,i=[],n=[],r=[],o=[],s=this.staticMatrix.tx/20,a=this.staticMatrix.ty/20,l=0,c=0;c_?u.x:_;for(var m in this._textWidth=_,this._textHeight=f,this.targetGraphics=this._graphics,this.targetGraphics.clear(),this.drawBG(),(this.border||!this._background&&this._type!=TextFieldType.INPUT)&&this.drawBorder(),this.textShapes){e=this.textShapes[m];var g=new AttributesView(Float32Array,2);g.set(e.verts);var y=g.attributesBuffer.cloneBufferView();g.dispose(),e.elements=new TriangleElements(y),e.elements.setPositions(new Float2Attributes(y)),e.shape=this.targetGraphics.addShape(Shape.getShape(e.elements)),e.shape.usages++;var b,v,x,A=new ImageSampler;e.shape.style=new Style,e.format.material&&0==this._textColor?(e.shape.material=this._textFormat.material,e.shape.style.addSamplerAt(A,e.shape.material.getTextureAt(0)),e.shape.material.animateUVs=!0,e.shape.style.uvMatrix=new Matrix(0,0,0,0,e.format.uv_values[0],e.format.uv_values[1])):(b=this.getTextColorForTextFormat(e.format),0==(v=ColorUtils.float32ColorToARGB(b)[0])&&(v=255),x=MaterialManager.get_material_for_color(b,v/255),e.shape.material=x.material,x.colorPos&&(e.shape.style.addSamplerAt(A,e.shape.material.getTextureAt(0)),e.shape.material.animateUVs=!0,e.shape.style.uvMatrix=new Matrix(0,0,0,0,x.colorPos.x,x.colorPos.y)))}},tFc.prototype.buildGlyphs=function(){this._clearTextShapes();for(var t,e=this._textRuns_formats,i=this._textRuns_words,n=e.length,r=0;r=this.char_positions_x[o]){if(t<=this.char_positions_x[o]+this.chars_width[o]/2)return o;if(t<=this.char_positions_x[o]+this.chars_width[o])return o+1}return-1},tFc.prototype.getFirstCharInParagraph=function(t){return console.log("Textfield.getFirstCharInParagraph() not implemented"),this._firstCharInParagraph},tFc.prototype.getImageReference=function(t){return console.log("TextField.getImageReference() not implemented"),this._imageReference},tFc.prototype.getLineIndexAtPoint=function(t,e){for(var i=this.lines_start_y.length,n=0;n=this.lines_start_y[n]&&e<=this.lines_start_y[n+1])return n;return e>=this.lines_start_y[i-1]?i-1:0},tFc.prototype.getLineIndexOfChar=function(t){for(var e,i=this.lines_charIdx_start.length-1;e=this.lines_charIdx_start[e]&&t<=this.lines_charIdx_end[e+1])return e;return i},tFc.prototype.getLineLength=function(t){return 0==this.lines_width.length?0:t>=this.lines_width.length?this.lines_width[this.lines_width.length-1]:this.lines_width[t]},tFc.prototype.getLineMetrics=function(t){var e=new TextLineMetrics;return this.lines_width.length&&(t>=this.lines_width.length&&(t=this.lines_width.length-1),e.x=this.lines_start_x[t],e.width=this.lines_width[t],e.height=this.lines_height[t]),e},tFc.prototype.getLineOffset=function(t){return 0==this.lines_charIdx_start.length?0:t>=this.lines_charIdx_start.length?this.lines_charIdx_start[this.lines_charIdx_start.length-1]:this.lines_charIdx_start[t]},tFc.prototype.getLineText=function(t){return 0==this.lines_charIdx_start.length?"":(t>=this.lines_width.length&&(t=this.lines_width.length-1),this._iText.slice(this.lines_charIdx_start[t],this.lines_charIdx_end[t]))},tFc.prototype.getParagraphLength=function(t){return this._paragraphLength},tFc.prototype.getTextFormat=function(t,e){return void 0===t&&(t=-1),void 0===e&&(e=-1),(0<=t||0<=e)&&console.warn("Textfield.getTextFormat() not correctly implemented for multi-formatted text"),this._textFormat},tFc.prototype.replaceSelectedText=function(t){var e=this._selectionBeginIndex,i=this._selectionEndIndex;if(i!=e){i=this.chars_codes.length)for(var n=this._textFormats.length,r=0;rthis._selectionBeginIndex?(this._selectionEndIndex+=1,e||(this._selectionBeginIndex=this._selectionEndIndex)):(this._selectionBeginIndex+=1,e||(this._selectionEndIndex=this._selectionBeginIndex)):this._selectionEndIndex>this._selectionBeginIndex?this._selectionBeginIndex=this._selectionEndIndex:this._selectionEndIndex=this._selectionBeginIndex;else if("ArrowLeft"==t)e||this._selectionEndIndex==this._selectionBeginIndex?this._selectionEndIndex>this._selectionBeginIndex?(--this._selectionBeginIndex,e||(this._selectionEndIndex=this._selectionBeginIndex)):(--this._selectionEndIndex,e||(this._selectionBeginIndex=this._selectionEndIndex)):this._selectionEndIndex>this._selectionBeginIndex?this._selectionEndIndex=this._selectionBeginIndex:this._selectionBeginIndex=this._selectionEndIndex;else if("Enter"==t&&this.multiline)this._insertNewText("\n");else if(1==t.length){if(this._restrictRegex){var a,l,c=t.replace(this._restrictRegex,"");if(c.lengtht.length&&(t=c)),""==t)return}if(this.newTextFormat.font_table){var h=this.newTextFormat.font_table,u=t.charCodeAt(0).toString();if(!(h.hasChar(u)||h.hasChar(u.toLowerCase())||h.hasChar(u.toUpperCase())))return void console.log("Char not found",u)}this._insertNewText(t)}else 1this.maxChars&&0<(n=this.maxChars-e.length+i.length)&&(t=t.slice(0,n)),this.text=e+t+i,this._selectionBeginIndex+=1,this._selectionEndIndex=this._selectionBeginIndex):0=this.maxChars||(e=this._iText.slice(0,this._selectionBeginIndex),i=this._iText.slice(this._selectionEndIndex,this._iText.length),this.text=e+t+i,this._selectionBeginIndex+=1,this._selectionEndIndex=this._selectionBeginIndex)},tFc.prototype.clone=function(){var t=tFc.getNewTextField();return this.copyTo(t),t},tFc.prototype.copyTo=function(t){sFc.prototype.copyTo.call(this,t),t.autoSize=this.autoSize,t.type=this._type,t.html=this.html,t.width=this._width,t.height=this._height,this._textFormat&&(t.textFormat=this._textFormat.clone()),t.textColor=this._textColor,t.border=this._border,t.borderColor=this._borderColor,t.background=this._background,t.backgroundColor=this._backgroundColor,t.textOffsetX=this.textOffsetX,t.textOffsetY=this.textOffsetY,t.staticMatrix=this.staticMatrix,t.selectable=this._selectable,t.multiline=this.multiline,t.wordWrap=this.wordWrap,t.maxChars=this.maxChars,t.sourceTextField=this,t.html?t.htmlText=this.htmlText:t.text=this.text,this._labelData&&t.setLabelData(this._labelData)},tFc.prototype._clearTextShapes=function(){var t;for(var e in this.targetGraphics&&this.targetGraphics.clear(),this.textShapes)(t=this.textShapes[e]).shape.dispose(),t.shape=null,t.elements=null,t.verts.length=0,delete this.textShapes[e]},tFc._textFields=[],tFc.assetType="[asset TextField]",tFc._onChangedEvent=new TextfieldEvent(TextfieldEvent.CHANGED),tFc),sFc,QEc,NEc,HEc,PDc,NAc;function tFc(){var e=sFc.call(this)||this;return e._isEntity=!1,e.textOffsetX=0,e.textOffsetY=0,e._selectionBeginIndex=0,e._selectionEndIndex=0,e._biggestLine=0,e._iText="",e._text="",e.inMaskMode=!1,e.cursorIntervalID=-1,e.cursorBlinking=!1,e.showSelection=!1,e._textDirty=!1,e._positionsDirty=!1,e._glyphsDirty=!1,e._shapesDirty=!1,e.chars_codes=[],e.chars_width=[],e.tf_per_char=[],e.words=[],e._textRuns_formats=[],e._textRuns_words=[],e._paragraph_textRuns_indices=[],e._maxWidthLine=0,e._labelData=null,e.lines_wordStartIndices=[],e.lines_wordEndIndices=[],e.lines_start_y=[],e.lines_start_x=[],e.lines_charIdx_start=[],e.lines_charIdx_end=[],e.lines_width=[],e.lines_height=[],e.lines_numSpacesPerline=[],e.char_positions_x=[],e.char_positions_y=[],e.sourceTextField=null,e._maskWidth=0,e._maskHeight=0,e._maskTextOffsetX=0,e._maskTextOffsetY=0,e.isStatic=!1,e._internalScale=new Vector3D(1,1,1),e.onKeyDelegate=function(t){return e.onKey(t)},e.startSelectionByMouseDelegate=function(t){return e.startSelectionByMouse(t)},e.stopSelectionByMouseDelegate=function(t){return e.stopSelectionByMouse(t)},e.updateSelectionByMouseDelegate=function(t){return e.updateSelectionByMouse(t)},e._onGraphicsInvalidateDelegate=function(t){return e._onGraphicsInvalidate(t)},e.cursorIntervalID=-1,e._tabEnabled=!0,e.cursorType="text",e.textOffsetX=0,e.textOffsetY=0,e.textShapes={},e._textColor=0,e._width=100,e._height=100,e._textWidth=0,e._textHeight=0,e._type=TextFieldType.DYNAMIC,e._selectable=!1,e._numLines=0,e.multiline=!1,e._autoSize=TextFieldAutoSize.NONE,e._wordWrap=!1,e._background=!1,e._backgroundColor=16777215,e._border=!1,e._borderColor=0,e.html=!1,e.maxChars=0,e._selectionBeginIndex=0,e._selectionEndIndex=0,e._graphics=Graphics.getGraphics(),e._graphics.addEventListener(AssetEvent.INVALIDATE,e._onGraphicsInvalidateDelegate),e.mouseEnabled=e._selectable,e}function UEc(){}function REc(){return null!==QEc&&QEc.apply(this,arguments)||this}function OEc(t){return NEc.call(this,t)||this}function IEc(t,e,i){void 0===i&&(i=0);var n=HEc.call(this,t)||this;return n._char=e,n._charCode=i,n.isShift=!1,n.isCTRL=!1,n.isAlt=!1,n}function QDc(t,e,i,n,r,o,s,a,l,c,h,u,p){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===l&&(l=null),void 0===c&&(c=null),void 0===h&&(h=null),void 0===u&&(u=null),void 0===p&&(p=null);var d=PDc.call(this)||this;return d._updateID=0,d.tabStops=[],d._align=l,d._leftMargin=c,d._rightMargin=h,d._indent=u,d._font_name=t,d._size=e,d._color=i,d._bold=n,d._italic=r,d._underline=o,d._leading=p,d._letterSpacing=null,d.url=s,d.link_target=a,d._font=null,d._font_table=null,d._style_name=FontStyleName.STANDART,d}function ODc(){}function NDc(){}function MDc(){}function LDc(){}function OAc(t){void 0===t&&(t=null);var e=NAc.call(this)||this;if(e._fntSizeLimit=-1,e._font_chars=[],e._font_chars_dic=Object.create(null),e._current_size=0,e._size_multiply=0,e._ascent=0,e._descent=0,e._usesCurves=!1,e._glyphIdxToChar={},e._fnt_channels=[],e.vertical_glyph_offset=0,e._font_em_size=32,e._whitespace_width=14,t){e._opentype_font=t,e._font_em_size=72,e._ascent=t.tables.hhea.ascender/(e._opentype_font.unitsPerEm/72),e._descent=t.tables.hhea.descender/(e._opentype_font.unitsPerEm/72)-2,e._current_size=0,e._size_multiply=0;var i=e._opentype_font.charToGlyph(String.fromCharCode(32));return i&&(e._whitespace_width=i.advanceWidth/(e._opentype_font.unitsPerEm/72)),e}return e}PartitionBase.registerAbstraction(EntityNode,TextField);var MovieClip=(bKc=Sprite,__extends(cKc,bKc),cKc.getNewMovieClip=function(t){if(void 0===t&&(t=null),cKc._movieClips.length){var e=cKc._movieClips.pop();return e.timeline=t||new Timeline,e.graphics=Graphics.getGraphics(),e}return new cKc(t)},cKc.clearPool=function(){cKc._movieClips=[]},cKc.prototype.initSoundStream=function(t,e){this._soundStreams||(this._soundStreams=new cKc.movieClipSoundsManagerClass(this)),this._soundStreams.initSoundStream(t,e)},cKc.prototype.addSoundStreamBlock=function(t,e){this._soundStreams||(this._soundStreams=new cKc.movieClipSoundsManagerClass(this)),this._soundStreams.addSoundStreamBlock(t,e)},cKc.prototype.stopCurrentStream=function(t){if(this._soundStreams)return this._soundStreams.stopStream(t)},cKc.prototype.resetStreamStopped=function(){this._soundStreams&&this._soundStreams.resetStreamStopped()},cKc.prototype._syncSounds=function(t){return this._soundStreams?this._soundStreams.syncSounds(t,this._isPlaying,this.parent):0},cKc.prototype.startSound=function(t,e,i){this._sounds[t]&&this._sounds[t].stop(),e.loopsToPlay=i,e.play(0,!1),this._sounds[t]=e,cKc._activeSounds[t]||(cKc._activeSounds[t]=[]),cKc._activeSounds[t].push(e)},cKc.prototype.stopSounds=function(t){if(void 0===t&&(t=null),t)this._sounds[t]&&(this._sounds[t].stop(),delete this._sounds[t]);else{for(var e in this._sounds)this._sounds[e].stop();this._sounds={}}for(var i,n=this._children.length,r=0;rthis.width&&(n[2]=this.width),n[3]>this.height&&(n[3]=this.height)),this._updateRegions)for(var o=this._updateRegions.length-1;0<=o;o--)this._updateRegions[o].intersects(t)&&this._updateRegions.splice(o,1)}},XNc.prototype.resetDirty=function(){this._dirtyRegions=[],this._updateRegions=[],this._maxDirtyArea=null,this._fullDirty=!1,this._imageDataDirty=!1},XNc.prototype.getImageDirtyUnderPoint=function(t,e){if(!this._imageDataDirty)return!1;TMP_POINT.setTo(t,e);for(var i=0,n=this._updateRegions;i=l[0]&&t=l[1]&&e>24&255)/255:1,n=16777215&e;XNc._renderer.view.x=t.x,XNc._renderer.view.y=t.y,XNc._renderer.view.width=t.width,XNc._renderer.view.height=t.height,XNc._renderer.view.backgroundAlpha=i,XNc._renderer.view.backgroundColor=n,XNc._renderer.view.clear(!0,!0),this.pushDirtyRegion(t)},XNc.prototype.copyPixels=function(t,e,i,n,r,o){this._stage.context.setCulling(ContextGLTriangleFace.NONE),this._stage.context.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ONE_MINUS_SOURCE_ALPHA),o=this.transparent!==t.transparent||o,this._stage.copyPixels(t,this,e,i,n,r,o),this.pushDirtyRegion(new Rectangle(i.x,i.y,e.width,e.height))},XNc.prototype.threshold=function(t,e,i,n,r,o,s,a){this._stage.context.setCulling(ContextGLTriangleFace.NONE),this._stage.context.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ZERO),this._stage.threshold(t,this,e,i,n,r,o,s,a),this.pushDirtyRegion(new Rectangle(i.x,i.y,e.width,e.height)),this._imageDataDirty=!0},XNc.prototype.colorTransform=function(t,e){this._stage.context.setCulling(ContextGLTriangleFace.NONE),this._stage.context.setBlendFactors(ContextGLBlendFactor.ONE,ContextGLBlendFactor.ZERO),XNc._tmpImage||(XNc._tmpImage=new XNc(1024,1024,!0,0,!0,this._stage));var i=XNc._tmpImage;this._stage.colorTransform(this,i,t,e),this._stage.copyPixels(i,this,t,new Point(0,0),null,null,!1),this.pushDirtyRegion(new Rectangle(t.x,t.y,t.width,t.height)),this._imageDataDirty=!0},XNc.prototype.getPixel32=function(t,e){if(this._imageDataDirty&&this.getImageDirtyUnderPoint(t,e)){this._stage.setRenderTarget(this,!1);var i=TMP_PIXEL,n=this._stage.context._gl,r=Math.min(this.width,this.height,TMP_AREA_SIZE),o=(r-1)/2|1,s=t-o,a=e-o;s<0&&(s=0),a<0&&(a=0),s>=this.width-r&&(s=this.width-r-1),a>=this.height-r&&(a=this.height-r-1),n.readPixels(s,a,r,r,n.RGBA,n.UNSIGNED_BYTE,i),this._stage.setRenderTarget(null);var l=t-s,c=e-a,h=new Rectangle(s,a,r,r);this.lock(),this.setPixels(h,i),this._locked=!1,this._updateRegions||(this._updateRegions=[]),this._updateRegions.push(h),this._fullDirty=!1;var u=4*(l+c*r),p=i[3+u];return p?(p<<24|(255*i[0+u]/p|0)<<16|(255*i[1+u]/p|0)<<8|255*i[2+u]/p|0)>>>0:0}return WNc.prototype.getPixel32.call(this,t,e)},XNc.prototype.getPixel=function(t,e){return 16777215&this.getPixel32(t,e)},XNc.prototype.draw=function(t,e,i,n,r,o){t instanceof DisplayObject?this._drawAsDisplay(t,e,i,n,r,o):this._drawAsBitmap(t,e,i,n,r,o),this.pushDirtyRegion(this._rect),this._imageDataDirty=!0},XNc.prototype._mapBlendMode=function(t){switch(void 0===t&&(t=""),t){case null:case"":case BlendMode.NORMAL:case BlendMode.LAYER:return BlendMode.LAYER;case BlendMode.MULTIPLY:case BlendMode.ADD:case BlendMode.ALPHA:return t}return BlendMode.LAYER},XNc.prototype._drawAsBitmap=function(t,e,i,n,r,o){XNc._billboardRenderer||this.createBillboardRenderer();var s,a=XNc._billboardRenderer,l=XNc._billboardRoot,c=XNc._billboard;a.disableClear=!0,a.view.target=this,a.view.projection.scale=1e3/this.rect.height,c.material.style.image=t,c.material.blendMode=this._mapBlendMode(n),e?((s=l.transform.matrix3D).identity(),s._rawData[0]=e.a,s._rawData[1]=-e.b,s._rawData[4]=e.c,s._rawData[5]=-e.d,s._rawData[12]=e.tx,s._rawData[13]=this.rect.height-e.ty,l.transform.invalidateComponents()):(l.transform.rotateTo(0,0,0),l.transform.scaleTo(1,-1,1),l.transform.moveTo(0,this.rect.height,0)),a.render()},XNc.prototype._drawAsDisplay=function(t,e,i,n,r,o){XNc._renderer||this.createRenderer();for(var s=XNc._root,a=XNc._renderer,l=t.parent,c=t._depthID,h=l?l.getChildIndex(t):0,u=t.visible,p=t.transform,d=0;d<4;d++)TMP_RAW[0+d]=p.position._rawData[d],TMP_RAW[4+d]=p.rotation._rawData[d],TMP_RAW[8+d]=p.scale._rawData[d];TMP_COLOR_MATRIX.copyRawDataFrom(t.transform.colorTransform._rawData);var _,f=t.transform.matrix3D._rawData[10];e?((_=s.transform.matrix3D).identity(),_._rawData[0]=e.a,_._rawData[1]=-e.b,_._rawData[4]=e.c,_._rawData[5]=-e.d,_._rawData[10]=f,_._rawData[12]=e.tx,_._rawData[13]=this.rect.height-e.ty,s.transform.invalidateComponents()):(s.transform.rotateTo(0,0,0),s.transform.scaleTo(1,-1,1),s.transform.moveTo(0,this.rect.height,0)),a.view.target=this,a.view.projection.scale=1e3/this.rect.height,a.view.x=0,a.view.y=0,a.view.width=this.width,a.view.height=this.height,s.removeChildren(0,s.numChildren),s.addChild(t),t.transform.matrix3D=null,t.visible=!0,t.transform.colorTransform=null,n=n||t.blendMode||"",s.blendMode=this._mapBlendMode(n),a.render(),t.visible=u,p.moveTo(TMP_RAW[0],TMP_RAW[1],TMP_RAW[2]),p.rotateTo(TMP_RAW[4],TMP_RAW[5],TMP_RAW[6]),p.scaleTo(TMP_RAW[8],TMP_RAW[9],TMP_RAW[10]),t.transform.colorTransform=TMP_COLOR_MATRIX,l&&(l.adapter&&l.adapter!=l&&t.adapter&&t.adapter!=t&&l.adapter.addChildAt?l.adapter.addChildAt(t.adapter,h):l.addChildAtDepth(t,c,!0))},XNc.assetType="[image SceneImage2D]",XNc),WNc,QNc,FNc,rNc,lNc,iNc;function XNc(t,e,i,n,r,o){void 0===i&&(i=!0),void 0===n&&(n=4294967295),void 0===r&&(r=!0),void 0===o&&(o=null);var s=WNc.call(this,t,e,i,n,r,o)||this;return s._updateRegions=[],s._dirtyRegions=[],s._maxDirtyArea=null,s._fullDirty=!1,s}function RNc(t,e){void 0===e&&(e=!1);var i=QNc.call(this,t,e)||this;return i._rootNode=new SceneGraphNode(t,i),i}function GNc(){var t=null!==FNc&&FNc.apply(this,arguments)||this;return t._numNodes=0,t._pChildNodes=new Array,t._childDepths=new Array,t}function sNc(){return null!==rNc&&rNc.apply(this,arguments)||this}function mNc(t,e,i){void 0===e&&(e=NaN),void 0===i&&(i=NaN);var n=lNc.call(this,t)||this;return n._oldHeight=e,n._oldWidth=i,n}function jNc(t){return iNc.call(this,t)||this}Stage.registerAbstraction(_Stage_BitmapImage2D,SceneImage2D);var TMP_POINT$1={x:0,y:0},MouseManager=(PPc.prototype.startDragObject=function(t){this._isAVM1Dragging=!0,this._mouseDragEntity=t,this._mouseDragPickerEntity=t},PPc.prototype.stopDragObject=function(){this._isAVM1Dragging=!1},Object.defineProperty(PPc.prototype,"showCursor",{get:function(){return this._showCursor},set:function(t){this._showCursor=t},enumerable:!0,configurable:!0}),Object.defineProperty(PPc.prototype,"eventBubbling",{get:function(){return this._eventBubbling},set:function(t){this._eventBubbling=t},enumerable:!0,configurable:!0}),Object.defineProperty(PPc.prototype,"useSoftkeyboard",{get:function(){return this._useSoftkeyboard},set:function(t){(this._useSoftkeyboard=t)?t&&(window.removeEventListener("keydown",this.onKeyDownDelegate),window.removeEventListener("keyup",this.onKeyUpDelegate)):(window.addEventListener("keydown",this.onKeyDownDelegate),window.addEventListener("keyup",this.onKeyUpDelegate))},enumerable:!0,configurable:!0}),PPc.prototype.registerContainer=function(t){t&&-1==this._containerLookup.indexOf(t)&&(t.addEventListener("click",this.onClickDelegate),t.addEventListener("dblclick",this.onDoubleClickDelegate),t.addEventListener("touchstart",this.onMouseDownDelegate),t.addEventListener("mousedown",this.onMouseDownDelegate),t.addEventListener("touchmove",this.onMouseMoveDelegate),t.addEventListener("mousemove",this.onMouseMoveDelegate),t.addEventListener("mouseup",this.onMouseUpDelegate),t.addEventListener("touchend",this.onMouseUpDelegate),t.addEventListener("touchend",this.onClickDelegate),t.addEventListener("mousewheel",this.onMouseWheelDelegate),t.addEventListener("mouseover",this.onMouseOverDelegate),t.addEventListener("mouseout",this.onMouseOutDelegate),window.addEventListener("keydown",this.onKeyDownDelegate),window.addEventListener("keyup",this.onKeyUpDelegate),this._containerLookup.push(t))},PPc.prototype.unregisterContainer=function(t){t&&-1!=this._containerLookup.indexOf(t)&&(t.removeEventListener("click",this.onClickDelegate),t.removeEventListener("dblclick",this.onDoubleClickDelegate),t.removeEventListener("touchstart",this.onMouseDownDelegate),t.removeEventListener("mousedown",this.onMouseDownDelegate),t.removeEventListener("touchmove",this.onMouseMoveDelegate),t.removeEventListener("mousemove",this.onMouseMoveDelegate),t.removeEventListener("mouseup",this.onMouseUpDelegate),t.removeEventListener("touchend",this.onMouseUpDelegate),t.removeEventListener("touchend",this.onClickDelegate),t.removeEventListener("mousewheel",this.onMouseWheelDelegate),t.removeEventListener("mouseover",this.onMouseOverDelegate),t.removeEventListener("mouseout",this.onMouseOutDelegate),window.removeEventListener("keydown",this.onKeyDownDelegate),window.removeEventListener("keyup",this.onKeyUpDelegate),this._containerLookup.splice(this._containerLookup.indexOf(t),1))},PPc.prototype.dispose=function(){this._stage=null,this.onClickDelegate=null,this.onDoubleClickDelegate=null,this.onMouseDownDelegate=null,this.onMouseMoveDelegate=null,this.onMouseUpDelegate=null,this.onMouseWheelDelegate=null,this.onMouseOverDelegate=null,this.onMouseOutDelegate=null,this.onKeyDownDelegate=null,this.onKeyUpDelegate=null,this._mouseMoveEvent=null,this._mouseUp=null,this._mouseUpOutside=null,this._mouseClick=null,this._mouseOut=null,this._dragOut=null,this._dragOver=null,this._mouseDown=null,this._mouseMove=null,this._mouseOver=null,this._mouseWheel=null,this._mouseDoubleClick=null,this._dragMove=null,this._dragStart=null,this._dragStop=null},PPc.clearInstance=function(){this._instance&&(this._instance.dispose(),this._instance=null)},PPc.getInstance=function(t){return this._instance?this._instance:t?this._instance=new PPc(t):new PPc(t)},PPc.prototype.setFocus=function(t){this._currentFocusEntity!=t&&(this._currentFocusEntity&&this._currentFocusEntity.setFocus(!1,!1),this._currentFocusEntity=t,this._currentFocusEntity&&this._currentFocusEntity.setFocus(!0,!1))},PPc.prototype.getFocus=function(){return this._currentFocusEntity},PPc.prototype.focusNextTab=function(){var t;0==this._sceneLookup.length||(t=this._sceneLookup[0].tabPicker.getNextTabEntity(this._currentFocusEntity))!=this._currentFocusEntity&&(this._currentFocusEntity&&this._currentFocusEntity.setFocus(!1,!1),this._currentFocusEntity=t,this._currentFocusEntity.setFocus(!0,!1))},PPc.prototype.focusPreviousTab=function(){var t;0==this._sceneLookup.length||(t=this._sceneLookup[0].tabPicker.getPrevTabEntity(this._currentFocusEntity))!=this._currentFocusEntity&&(this._currentFocusEntity&&this._currentFocusEntity.setFocus(!1,!1),this._currentFocusEntity=t,this._currentFocusEntity.setFocus(!0,!1))},PPc.prototype.dispatchEvent=function(t,e){if(this._eventBubbling)for(;e;){if(t.commonAncestor&&e==t.commonAncestor)return;e._iIsMouseEnabled()&&(e.dispatchEvent(t),FrameScriptManager.execute_queue()),e=t._iAllowedToPropagate?e.parent:null}else e&&(e.dispatchEvent(t),FrameScriptManager.execute_queue())},PPc.prototype.setupAndDispatchEvent=function(t,e,i){t=this.setUpEvent(t,e,i),this.dispatchEvent(t,t.pickerEntity)},PPc.prototype.fireMouseEvents=function(t){if(!t.forceMouseMove||this._isTouch||this._iUpdateDirty||(this._iCollision=t.getViewCollision(t._mouseX,t._mouseY)),this._rollOut.commonAncestor=null,this._rollOver.commonAncestor=null,this._iCollisionEntity=this._iCollision?this._iCollision.pickerEntity:null,this._iCollisionEntity!=this._prevICollisionEntity){if(this._prevICollisionEntity&&(this._isTouch||this._mouseDragging?this._mouseDragging&&this._mouseDragPickerEntity&&this._mouseDragPickerEntity==this._prevICollisionEntity&&this.queueDispatch(this._dragOut,this._mouseMoveEvent,this._prevICollision):this.queueDispatch(this._mouseOut,this._mouseMoveEvent,this._prevICollision)),!this._prevICollisionEntity&&this._iCollisionEntity&&(this.queueDispatch(this._rollOut,this._mouseMoveEvent,this._prevICollision),this.queueDispatch(this._rollOver,this._mouseMoveEvent,this._iCollision)),this._prevICollisionEntity&&!this._iCollisionEntity&&(this.queueDispatch(this._rollOut,this._mouseMoveEvent,this._prevICollision),this.queueDispatch(this._rollOver,this._mouseMoveEvent,this._iCollision)),this._prevICollisionEntity&&this._iCollisionEntity){for(var e=[],i=this._prevICollisionEntity;i&&!i.isAVMScene;)e.push(i),i=i.parent;for(var n=null,i=this._iCollisionEntity;i&&!i.isAVMScene;)i=-1==e.indexOf(i)?i.parent:(n=i,null);n!=this._prevICollisionEntity&&this.queueDispatch(this._rollOut,this._mouseMoveEvent,this._prevICollision,n),n!=this._iCollisionEntity&&this.queueDispatch(this._rollOver,this._mouseMoveEvent,this._iCollision,n)}this._collisionIsEnabledButton=!!this._iCollisionEntity&&this._iCollisionEntity.buttonEnabled,this._iCollisionEntity&&(this._isTouch||this._mouseDragging?this._mouseDragging&&this._mouseDragPickerEntity&&this._mouseDragPickerEntity==this._iCollisionEntity&&this.queueDispatch(this._dragOver,this._mouseMoveEvent,this._iCollision):this.queueDispatch(this._mouseOver,this._mouseMoveEvent,this._iCollision)),this._prevICollision=this._iCollision,this._prevICollisionEntity=this._iCollisionEntity}else{var r=!!this._iCollisionEntity&&this._iCollisionEntity.buttonEnabled;this._collisionIsEnabledButton!=r&&r&&(this._isTouch?this._mouseDragPickerEntity&&this._mouseDragPickerEntity==this._iCollisionEntity&&this.queueDispatch(this._dragOver,this._mouseMoveEvent,this._iCollision):this.queueDispatch(this._mouseOver,this._mouseMoveEvent,this._iCollision)),this._collisionIsEnabledButton=r}var o,s;this._mouseDragging||(document.body.style.cursor=this._showCursor?this._iCollisionEntity?this._iCollisionEntity.getMouseCursor():"initial":"none");for(var a,l,c=this._queuedEvents.length,h=0;hthis._segmentsH/2?this._height/2:-this._height/2,E=g*Math.sin(w),T=1/Math.sqrt(C*C+E*E+m*m),M=Math.sqrt(E*E+C*C),D=this._yUp?(c=0,h=.007>>24&3,e[i++]=128|s>>>18&63,e[i++]=128|s>>>12&63,e[i++]=128|s>>>6&63):0!=(4294901760&s)?(e[i++]=240|s>>>18&7,e[i++]=128|s>>>12&63,e[i++]=128|s>>>6&63):0!=(4294965248&s)?(e[i++]=224|s>>>12&15,e[i++]=128|s>>>6&63):e[i++]=192|s>>>6&31,e[i++]=128|63&s)}return e.subarray(0,i)}function utf8encode$1(t){for(var e=0,i="";e>1|128))===r)break;r=r>>1|128,--o}while(0<=o);if(o<=0){i+=String.fromCharCode(n);continue}for(var s=n&(1<>10&1023|55296,1023&s|56320):String.fromCharCode(s)}}return i}function base64EncodeBytes(t){for(var e,i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=t.byteLength,o=r%3,s=r-o,a=0;a>18],n[(258048&e)>>12],n[(4032&e)>>6],n[63&e]);return 1==o?i+=concat3(n[(252&(e=t[s]))>>2],n[(3&e)<<4],"=="):2==o&&(i+=concat4(n[(64512&(e=t[s]<<8|t[1+s]))>>10],n[(1008&e)>>4],n[(15&e)<<2],"=")),i}var base64DecodeMap=[62,0,0,0,63,52,53,54,55,56,57,58,59,60,61,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,0,0,0,0,0,0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],base64DecodeMapOffset=43,base64EOF=61;function decodeRestrictedBase64ToBytes(t){for(var e,i,n,r=t.length,o="="===t.charAt(r-2)?2:"="===t.charAt(r-1)?1:0,s=new Uint8Array(3*(t.length>>2)-o),a=0,l=0;a>4,(e=t.charCodeAt(a++))==base64EOF)return s;if(i=base64DecodeMap[e-base64DecodeMapOffset],s[l++]=(15&n)<<4|(60&i)>>2,(e=t.charCodeAt(a++))==base64EOF)return s;n=base64DecodeMap[e-base64DecodeMapOffset],s[l++]=(3&i)<<6|n}return s}function escapeString(t){return void 0!==t&&(t=t.replace(/[^\w$]/gi,"$"),/^\d/.test(t)&&(t="$"+t)),t}function fromCharCodeArray(t){for(var e="",i=0;i>6*o&63];return r}function toEncoding(t){return _encoding[t]}function fromEncoding(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-71:48<=t&&t<=57?t+4:36===t?62:95===t?63:void 0}function variableLengthDecodeInt32(t){for(var e=fromEncoding(t.charCodeAt(0)),i=0,n=0;n>1,n=e-i-1;return t.substr(0,i)+"…"+t.substr(t.length-n,n)}function multiple(t,e){for(var i="",n=0;n=this._maxSize||(this._data[t]=e,this._size++,0))},ZZc);function ZZc(t){this._data=Object.create(null),this._size=0,this._maxSize=t}function toS8U8(t){return 256*t<<16>>16}function fromS8U8(t){return t/256}function clampS8U8(t){return fromS8U8(toS8U8(t))}function toS16(t){return t<<16>>16}function ones(t){return 16843009*((t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135)>>24}function RGBAToARGB(t){return t>>8&16777215|(255&t)<<24}Math.imul||(Math.imul=function(t,e){var i=65535&t,n=65535&e;return i*n+((t>>>16&65535)*n+i*(e>>>16&65535)<<16>>>0)|0}),Math.clz32||(Math.clz32=function(t){return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,32-ones(t|=t>>16)});var rgbaToCSSStyleCache=new Cache(1024);function rgbaToCSSStyle(t){var e=rgbaToCSSStyleCache.get(t);return"string"==typeof e||(e=concat9("rgba(",t>>24&255,",",t>>16&255,",",t>>8&255,",",(255&t)/255,")"),rgbaToCSSStyleCache.set(t,e)),e}var ShumwayCom={getWeakMapKeys:function(t){return null}},Shumway={version:"",build:""},inBrowser="undefined"!=typeof window&&"document"in window&&"plugins"in window.document,inFirefox="undefined"!=typeof navigator&&0<=navigator.userAgent.indexOf("Firefox");function dumpLine(t){"undefined"!=typeof dump&&dump(t+"\n")}jsGlobal.performance||(jsGlobal.performance={}),jsGlobal.performance.now||(jsGlobal.performance.now=function(){return Date.now()});var START_TIME=performance.now(),UINT32_CHAR_BUFFER_LENGTH=10,UINT32_MAX_DIV_10=429496729,UINT32_MAX_MOD_10=5;function isString(t){return"string"==typeof t}function isNumber(t){return"number"==typeof t}function isInteger(t){return(0|t)===t}function isObject(t){return"object"==typeof t||"function"==typeof t}function toNumber(t){return+t}function isNumericString(t){return String(Number(t))===t}function isNumeric(t){if("number"==typeof t)return 1;if("string"==typeof t){var e=t.charCodeAt(0);return!(65<=e&&e<=90||97<=e&&e<=122||36===e||95===e)&&(isIndex(t)||isNumericString(t))}}function isIndex(t){var e=0;if("number"==typeof t)return t===(e=0|t)&&0<=e||t>>>0===t;if("string"!=typeof t)return!1;var i=t.length;if(0===i)return!1;if("0"===t)return!0;if(UINT32_CHAR_BUFFER_LENGTHr.length>>2){for(var a,l=[],s=0;s>16&255)/255,(t>>8&255)/255,(t>>0&255)/255,(t>>24&255)/255)},W0c.FromRGBA=function(t){return W0c.FromARGB(RGBAToARGB(t))},W0c.prototype.toRGBA=function(){return 255*this.r<<24|255*this.g<<16|255*this.b<<8|255*this.a},W0c.prototype.toCSSStyle=function(){return rgbaToCSSStyle(this.toRGBA())},W0c.prototype.set=function(t){this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a},W0c.randomColor=function(t){return void 0===t&&(t=1),new W0c(Math.random(),Math.random(),Math.random(),t)},W0c.parseColor=function(t){if(W0c.colorCache||(W0c.colorCache=Object.create(null)),W0c.colorCache[t])return W0c.colorCache[t];var e=document.createElement("span");document.body.appendChild(e),e.style.backgroundColor=t;var i=getComputedStyle(e).backgroundColor;document.body.removeChild(e);var n=(n=/^rgb\((\d+), (\d+), (\d+)\)$/.exec(i))||/^rgba\((\d+), (\d+), (\d+), ([\d.]+)\)$/.exec(i),r=new W0c(0,0,0,0);return r.r=parseFloat(n[1])/255,r.g=parseFloat(n[2])/255,r.b=parseFloat(n[3])/255,r.a=n[4]?parseFloat(n[4])/255:1,W0c.colorCache[t]=r},W0c.Red=new W0c(1,0,0,1),W0c.Green=new W0c(0,1,0,1),W0c.Blue=new W0c(0,0,1,1),W0c.None=new W0c(0,0,0,0),W0c.White=new W0c(1,1,1,1),W0c.Black=new W0c(0,0,0,1),W0c.colorCache={},W0c),ImageType$1,i1c;function W0c(t,e,i,n){this.r=t,this.g=e,this.b=i,this.a=n}function t0c(t,e,i,n){assert$2(isInteger(t)),assert$2(isInteger(e)),assert$2(isInteger(i)),assert$2(isInteger(n)),this._xMin=0|t,this._yMin=0|e,this._xMax=0|i,this._yMax=0|n,this.assertValid()}function U_c(t,e,i,n){this.xMin=0|t,this.yMin=0|e,this.xMax=0|i,this.yMax=0|n}function d_c(t,e){void 0===t&&(t=!1),this._tab=" ",this._padding="",this._suppressOutput=t,this._out=e||d_c._consoleOut,this._outNoNewline=e||d_c._consoleOutNoNewline}function O$c(){void 0!==ShumwayCom&&ShumwayCom.getWeakMapKeys?(this._map=new WeakMap,this._id=0,this._newAdditions=[]):this._list=[]}i1c=ImageType$1=ImageType$1||{},i1c[i1c.None=0]="None",i1c[i1c.PremultipliedAlphaARGB=1]="PremultipliedAlphaARGB",i1c[i1c.StraightAlphaARGB=2]="StraightAlphaARGB",i1c[i1c.StraightAlphaRGBA=3]="StraightAlphaRGBA",i1c[i1c.JPEG=4]="JPEG",i1c[i1c.PNG=5]="PNG",i1c[i1c.GIF=6]="GIF";var PromiseWrapper=(j1c.prototype.then=function(t,e){return this.promise.then(t,e)},j1c);function j1c(){this.promise=new Promise(function(t,e){this.resolve=t,this.reject=e}.bind(this))}function o1c(t,e,i){t[e]||Object.defineProperty(t,e,{value:i,writable:!0,configurable:!0,enumerable:!1})}"undefined"!=typeof exports&&(exports.Shumway=Shumway),o1c(String.prototype,"padRight",function(t,e){var i=this,n=i.replace(/\033\[[0-9]*m/g,"").length;if(!t||e<=n)return i;for(var r=(e-n)/t.length,o=0;o>3,s=i*e*o,a=i*o,l=t.length+(1&t.length),c=new ArrayBuffer(WaveHeader.length+l),h=new Uint8Array(c);if(h.set(WaveHeader),r)for(var u=0,p=WaveHeader.length;u>>(s-=t)&(1<>16,d=n(6);1>16,u=n(6));for(var _=1<>1;b;b>>=1,g>>=1)m&b&&(y+=g);if(p+=(m&_?-1:1)*(y+g),t[a++]=p=p<-32768?-32768:32767>1;b;b>>=1,g>>=1)m&b&&(y+=g);h+=(m&_?-1:1)*(y+g),t[a++]=h=h<-32768?-32768:32767this.end)throw StreamNoDataError},I4c.prototype.remaining=function(){return this.end-this.pos},I4c.prototype.substream=function(t,e){var i=new I4c(this.bytes);return i.pos=t,i.end=e,i},I4c.prototype.push=function(t){var e=this.bytes,i=this.end+t.length;if(i>e.length)throw"stream buffer overfow";e.set(t,this.end),this.end=i},I4c.prototype.readSi8=function(){return this.view.getInt8(this.pos++)},I4c.prototype.readSi16=function(){var t=this.view.getInt16(this.pos,!0);return this.pos+=2,t},I4c.prototype.readSi32=function(){var t=this.view.getInt32(this.pos,!0);return this.pos+=4,t},I4c.prototype.readUi8=function(){return this.bytes[this.pos++]},I4c.prototype.readUi16=function(){var t=this.view.getUint16(this.pos,!0);return this.pos+=2,t},I4c.prototype.readUi32=function(){var t=this.view.getUint32(this.pos,!0);return this.pos+=4,t},I4c.prototype.readFixed=function(){var t=this.view.getInt32(this.pos,!0)/65536;return this.pos+=4,t},I4c.prototype.readFixed8=function(){var t=this.view.getInt16(this.pos,!0)/256;return this.pos+=2,t},I4c.prototype.readFloat16=function(){var t=this.view.getUint16(this.pos,!1);this.pos+=2;var e=t>>15?-1:1,i=(31744&t)>>10,n=1023&t;return i?31==i?n?NaN:1/0*e:e*Math.pow(2,i-15)*(1+n/1024):e*Math.pow(2,-14)*(n/1024)},I4c.prototype.readFloat=function(){var t=this.view.getFloat32(this.pos,!0);return this.pos+=4,t},I4c.prototype.readDouble=function(){var t=this.view.getFloat64(this.pos,!0);return this.pos+=8,t},I4c.prototype.readEncodedU32=function(){var t=this.bytes,e=t[this.pos++];return 128&e&&16384&(e=127&e|t[this.pos++]<<7)&&2097152&(e=16383&e|t[this.pos++]<<14)&&268435456&(e=2097151&e|t[this.pos++]<<21)?268435455&e|t[this.pos++]<<28:e},I4c.prototype.readBool=function(){return!!this.bytes[this.pos++]},I4c.prototype.readSb=function(t){return this.readUb(t)<<32-t>>32-t},I4c.prototype.readUb=function(t){for(var e=this.bitBuffer,i=this.bitLength,n=0;i>>(i-=t)&masks[t],this.bitBuffer=e,this.bitLength=i,n},I4c.prototype.readFb=function(t){return this.readSb(t)/65536},I4c.prototype.readString=function(t){var e,i=this.bytes,n=this.pos;if(-1>>0}function parseRgba(t){return t.readUi8()<<24|t.readUi8()<<16|t.readUi8()<<8|t.readUi8()}function parseArgb(t){return t.readUi8()|t.readUi8()<<24|t.readUi8()<<16|t.readUi8()<<8}function parseMatrix(t){var e,i={a:1,b:0,c:0,d:1,tx:0,ty:0};return t.align(),t.readUb(1)&&(e=t.readUb(5),i.a=t.readFb(e),i.d=t.readFb(e)),t.readUb(1)&&(e=t.readUb(5),i.b=t.readFb(e),i.c=t.readFb(e)),e=t.readUb(5),i.tx=t.readSb(e),i.ty=t.readSb(e),t.align(),i}function parseColorTransform(t,e){var i={redMultiplier:255,greenMultiplier:255,blueMultiplier:255,alphaMultiplier:255,redOffset:0,greenOffset:0,blueOffset:0,alphaOffset:0};t.align();var n=t.readUb(1),r=t.readUb(1),o=t.readUb(4);return r&&(i.redMultiplier=t.readSb(o),i.greenMultiplier=t.readSb(o),i.blueMultiplier=t.readSb(o),e&&(i.alphaMultiplier=t.readSb(o))),n&&(i.redOffset=t.readSb(o),i.greenOffset=t.readSb(o),i.blueOffset=t.readSb(o),e&&(i.alphaOffset=t.readSb(o))),t.align(),i}function parsePlaceObjectTag(t,e,i,n){var r={code:i};if(r.actionBlocksPrecedence=t.pos,4===i)return r.symbolId=t.readUi16(),r.depth=t.readUi16(),r.flags|=4,r.matrix=parseMatrix(t),t.posn){console.log("PlaceObject handler attempted to read clip events beyond tag end"),t.pos=n;break}c.push(l)}}return r}function parseEvents(t,e){var i=6<=e?t.readUi32():t.readUi16();if(!i)return null;var n={};6===e&&(i&=-262145),n.flags=i;var r=t.readUi32();131072&i&&(n.keyCode=t.readUi8(),r--);var o=t.pos+r;return n.actionsBlock=t.bytes.subarray(t.pos,o),t.pos=o,n}function parseFilter(t){var e={},i=e.type=t.readUi8();switch(i){case FilterType.DROPSHADOW:case FilterType.GLOW:case FilterType.BEVEL:case FilterType.GRADIENTGLOW:case FilterType.GRADIENTBEVEL:for(var n=e,r=i===FilterType.GRADIENTGLOW||i===FilterType.GRADIENTBEVEL?t.readUi8():i===FilterType.BEVEL?2:1,o=n.colors=[],s=r;s--;)o.push(parseRgba(t));if(i===FilterType.GRADIENTGLOW||i===FilterType.GRADIENTBEVEL)for(var a=n.ratios=[],s=r;s--;)a.push(t.readUi8());return n.blurX=t.readFixed(),n.blurY=t.readFixed(),i!==FilterType.GLOW&&(n.angle=t.readFixed(),n.distance=t.readFixed()),n.strength=t.readFixed8(),n.inner=!!t.readUb(1),n.knockout=!!t.readUb(1),n.compositeSource=!!t.readUb(1),i===FilterType.BEVEL||i===FilterType.GRADIENTGLOW||i===FilterType.GRADIENTBEVEL?(n.onTop=!!t.readUb(1),n.quality=t.readUb(4)):n.quality=t.readUb(5),n;case FilterType.BLUR:var l=e;return l.blurX=t.readFixed(),l.blurY=t.readFixed(),l.quality=t.readUb(5),t.readUb(3),l;case FilterType.CONVOLUTION:var c=e,h=c.matrixX=t.readUi8(),u=c.matrixY=t.readUi8();c.divisor=t.readFloat(),c.bias=t.readFloat();var p=c.matrix=[];for(s=h*u;s--;)p.push(t.readFloat());return c.color=parseRgba(t),t.readUb(6),c.clamp=!!t.readUb(1),c.preserveAlpha=!!t.readUb(1),c;case FilterType.COLORMATRIX:var d=e,p=d.matrix=[];for(s=20;s--;)p.push(t.readFloat());return d}return e}function parseRemoveObjectTag(t,e,i){var n={code:i};return 5===i?(n.depth=t.readUi16(),n.symbolId=t.readUi16()):n.depth=t.readUi16(),n}function parseDefineImageTag(t,e,i,n,r){var o,s,a={code:i};switch(a.id=t.readUi16(),21>7&1);for(var l=t.readUi16();o=parseButtonCharacter(t,e,i);)s.push(o);if(l){for(var c=r.buttonActions=[];t.posn)break;c.push(h)}t.pos=n}}return r}function parseButtonCharacter(t,e,i){var n=t.readUi8();if(!n)return null;var r={};if(e<8&&(n&=-769),r.flags=n,r.symbolId=t.readUi16(),r.depth=t.readUi16(),r.matrix=parseMatrix(t),34===i&&(r.cxform=parseColorTransform(t,!0)),16&r.flags)for(var o=t.readUi8(),s=r.filters=[],a=o;a--;)s.push(parseFilter(t));return 32&r.flags&&(r.blendMode=t.readUi8()),r}function parseButtonCondAction(t,e){var i=t.pos,n=t.readUi16(),r=n?i+n:e,o=t.readUi16();return t.pos=r,{keyCode:(65024&o)>>9,stateTransitionFlags:511&o,actionsData:t.bytes.subarray(i+4,r)}}function parseDefineBinaryDataTag(t,e,i,n){var r={code:i};return r.id=t.readUi16(),t.pos+=4,r.data=t.bytes.subarray(t.pos,n),t.pos=n,r}function parseDefineFontTag(t,e,i){var n={code:i};n.id=t.readUi16();for(var r=t.readUi16(),o=r/2,s=[],a=o-1;a--;)s.push(t.readUi16());n.offsets=[r].concat(s);for(var l=n.glyphs=[],a=o;a--;)l.push(parseGlyph(t,e,i));return n}function parseGlyph(t,e,i){t.align();var n=t.readUb(4),r=t.readUb(4);return parseShapeRecords(t,e,i,!1,n,r,!1)}function parseDefineTextTag(t,e,i){var n={code:i};n.id=t.readUi16(),n.bbox=parseBbox(t),n.matrix=parseMatrix(t);for(var r,o=t.readUi8(),s=t.readUi8(),a=n.records=[];r=parseTextRecord(t,e,i,o,s);)a.push(r);return n}function parseTextRecord(t,e,i,n,r){t.align();var o=t.readUb(8);if(!o)return null;var s={};8&(s.flags=o)&&(s.fontId=t.readUi16()),4&o&&(s.color=(33===i?parseRgba:parseRgb)(t)),1&o&&(s.moveX=t.readSi16()),2&o&&(s.moveY=t.readSi16()),8&o&&(s.fontHeight=t.readUi16());for(var a=t.readUi8(),l=s.entries=[],c=a;c--;)l.push({glyphIndex:t.readUb(n),advance:t.readSb(r)});return s}function parseDefineSoundTag(t,e,i,n){var r={code:i};r.id=t.readUi16();var o=t.readUi8();return r.soundFormat=o>>4&15,r.soundRate=o>>2&3,r.soundSize=o>>1&1,r.soundType=1&o,r.samplesCount=t.readUi32(),r.soundData=t.bytes.subarray(t.pos,n),t.pos=n,r}function parseStartSoundTag(t,e,i){var n={code:i};return 15==i&&(n.soundId=t.readUi16()),89==i&&(n.soundClassName=t.readString(-1)),n.soundInfo=parseSoundInfo(t),n}function parseSoundInfo(t){var e={},i=e.flags=t.readUi8();if(1&i&&(e.inPoint=t.readUi32()),2&i&&(e.outPoint=t.readUi32()),4&i&&(e.loopCount=t.readUi16()),8&i)for(var n=t.readUi8(),r=e.envelopes=[],o=n;o--;)r.push({pos44:t.readUi32(),volumeLeft:t.readUi16(),volumeRight:t.readUi16()});return e}function parseSoundStreamHeadTag(t,e){var i={},n=t.readUi8();i.playbackRate=n>>2&3,i.playbackSize=n>>1&1,i.playbackType=1&n;var r=t.readUi8(),o=i.streamCompression=r>>4&15;return i.streamRate=r>>2&3,i.streamSize=0==(r>>1&1)?8:16,i.streamType=1&r,i.samplesCount=t.readUi16(),2==o&&2<=e-t.pos&&(i.latencySeek=t.readSi16()),i}function parseDefineBitmapTag(t,e,i,n){var r={code:i};r.id=t.readUi16();var o=r.format=t.readUi8();return r.width=t.readUi16(),r.height=t.readUi16(),r.hasAlpha=36===i,3===o&&(r.colorTableSize=t.readUi8()),r.bmpData=t.bytes.subarray(t.pos,n),t.pos=n,r}function parseDefineEditTextTag(t,e,i){var n={code:i};n.id=t.readUi16(),n.bbox=parseBbox(t);var r=n.flags=t.readUi16();return 1&r&&(n.fontId=t.readUi16()),32768&r&&(n.fontClass=t.readString(-1)),1&r&&(n.fontHeight=t.readUi16()),4&r&&(n.color=parseRgba(t)),2&r&&(n.maxLength=t.readUi16()),8192&r&&(n.align=t.readUi8(),n.leftMargin=t.readUi16(),n.rightMargin=t.readUi16(),n.indent=t.readSi16(),n.leading=t.readSi16()),n.variableName=t.readString(-1),128&r&&(n.initialText=t.readString(-1)),n}function parseDefineFont2Tag(t,e,i,n){var r={code:i};r.id=t.readUi16();var o=r.flags=t.readUi8(),s=!!(4&o);5=2+(s?4:2);)g.push(parseKerning(t,s))}return r}function parseKerning(t,e){var i={};return e?(i.code1=t.readUi16(),i.code2=t.readUi16()):(i.code1=t.readUi8(),i.code2=t.readUi8()),i.adjustment=t.readUi16(),i}function parseDefineFont4Tag(t,e,i,n){var r={code:i};r.id=t.readUi16();var o=r.flags=t.readUi8();return r.name=t.readString(-1),4&o&&(r.data=t.bytes.subarray(t.pos,n),t.pos=n),r}function parseDefineScalingGridTag(t,e,i){var n={code:i};return n.symbolId=t.readUi16(),n.splitter=parseBbox(t),n}function parseDefineSceneTag(t,e){for(var i={code:e},n=t.readEncodedU32(),r=i.scenes=[],o=n;o--;)r.push({offset:t.readEncodedU32(),name:t.readString(-1)});for(var s=t.readEncodedU32(),a=i.labels=[],o=s;o--;)a.push({frame:t.readEncodedU32(),name:t.readString(-1)});return i}function parseDefineShapeTag(t,e,i){var n={code:i};n.id=t.readUi16(),n.lineBounds=parseBbox(t);var r=0,o=46===i||84===i;o&&(r|=8,n.lineBoundsMorph=parseBbox(t));var s=83===i||84===i;s&&(n.fillBounds=parseBbox(t),o&&(n.fillBoundsMorph=parseBbox(t)),r|=7&t.readUi8()),n.flags=r,o&&(t.pos+=4),n.fillStyles=parseFillStyles(t,e,i,o),n.lineStyles=parseLineStyles(t,e,i,o,s),t.align();var a=t.readUb(4),l=t.readUb(4);return n.records=parseShapeRecords(t,e,i,o,a,l,s),o&&(t.align(),a=t.readUb(4),l=t.readUb(4),n.recordsMorph=parseShapeRecords(t,e,i,o,a,l,s)),n}function parseShapeRecords(t,e,i,n,r,o,s){for(var a=[];;){var l,c={},h=c.type=t.readUb(1),u=t.readUb(5);if(!h&&!u)break;h?(l=2+(15&u),32&(u=(240&u)<<1)?(c.isGeneral=t.readUb(1))?(u|=64,c.deltaX=t.readSb(l),c.deltaY=t.readSb(l)):(c.isVertical=t.readUb(1))?(u|=128,c.deltaY=t.readSb(l)):c.deltaX=t.readSb(l):(c.controlDeltaX=t.readSb(l),c.controlDeltaY=t.readSb(l),c.anchorDeltaX=t.readSb(l),c.anchorDeltaY=t.readSb(l))):(i<=2&&(u&=-17),1&u&&(l=t.readUb(5),c.moveX=t.readSb(l),c.moveY=t.readSb(l)),2&u&&(c.fillStyle0=t.readUb(r)),4&u&&(c.fillStyle1=t.readUb(r)),8&u&&(c.lineStyle=t.readUb(o)),16&u&&(c.fillStyles=parseFillStyles(t,e,i,n),c.lineStyles=parseLineStyles(t,e,i,n,s),t.align(),r=t.readUb(4),o=t.readUb(4))),c.flags=u,a.push(c)}return a}function parseFillStyles(t,e,i,n){var r=t.readUi8();2>8&255,255&t)}function isScaledFont2(t){for(var e=0,i=0,n=0,r=0,o=0;oI&&(L[F].xMin=I),L[F].yMin>O&&(L[F].yMin=O),L[F].xMaxG[_t].depth;)G[ft]&&G[ft].masks.push(G[_t].sessionID),ft--;var mt=0,gt=0,yt=[];for(var _t in G){var bt=G[_t];if(bt.masks.sort(),bt.oldMasks.sort(),bt.masks.length!=bt.oldMasks.length)yt.push(bt),bt.maskingChanged=!0;else for(mt=0,gt=bt.masks.length,mt=0;mt>6;var n=63&i;if(63===n){if(e+4>this._uncompressedLoadedLength)return!1;n=this._dataView.getUint32(e,!0),e+=4}return this._dataStream.pos=e,t.byteOffset=e,t.byteLength=n,!0},odd.prototype.Utf8ArrayToStr=function(t){for(var e,i,n,r="",o=t.length,s=0;s>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r+=String.fromCharCode(e);break;case 12:case 13:i=t[s++],r+=String.fromCharCode((31&e)<<6|63&i);break;case 14:i=t[s++],n=t[s++],r+=String.fromCharCode((15&e)<<12|(63&i)<<6|(63&n)<<0)}return r},odd.prototype.scanTag=function(t,e){var i,n,r=this._dataStream,o=r.pos;assert(o===t.byteOffset);var s,a,l,c,h,u,p,d,_,f,m=t.tagCode,g=t.byteLength;if(39===m){this.addLazySymbol(m,o,g);var y=o+g;return r.pos+=4,this.scanTagsToOffset(y,!1),void(this._dataStream.pos!==y&&this.emitTagSlopWarning(t,y))}if(ImageDefinitionTags[m]){var b=this.addLazySymbol(m,o,g);this.decodeEmbeddedImage(b)}else{if(14===m){b=this.addLazySymbol(m,o,g);var v=this.getParsedTag(b),x=new EagerlyParsedDictionaryEntry(v.id,b,"sound",v);return this.eagerlyParsedSymbolsMap[x.id]=x,void this.eagerlyParsedSymbolsList.push(x)}if(FontDefinitionTags[m])b=this.addLazySymbol(m,o,g),this.registerEmbeddedFont(b);else{if(DefinitionTags[m])return this.addLazySymbol(m,o,g),void this.jumpToNextTag(g);if(e||76===m||56===m)if(ControlTags[m])this.addControlTag(m,o,g);else switch(m){case 69:this.setFileAttributes(g);break;case 86:this.setSceneAndFrameLabelData(g);break;case 9:this._swfFile.backgroundColor=this._swfFile.backgroundColor=parseRgb(this._dataStream);break;case 8:this._jpegTables||(this._jpegTables=0===g?new Uint8Array(0):this.swfData.subarray(r.pos,r.pos+g-2)),this.jumpToNextTag(g);break;case 82:case 72:this._swfFile.useAVM1?this.jumpToNextTag(g):(s=o+g,a=new ABCBlock,82===m?(a.flags=r.readUi32(),a.name=r.readString(-1)):(a.flags=0,a.name=""),a.data=this.swfData.subarray(r.pos,s),this.abcBlocks.push(a),r.pos=s);break;case 76:s=o+g;for(var A=r.readUi16();A--;){var S=r.readUi16(),w=r.readString(-1);this.symbolClassesMap[S]=w,this.symbolClassesList.push({id:S,className:w})}r.pos=s;break;case 59:this._swfFile.useAVM1&&(l=this._currentInitActionBlocks||(this._currentInitActionBlocks=[]),c=this._dataView.getUint16(r.pos,!0),h=this.swfData.subarray(o+2,o+g),d=this._isEncrypted&&null!==(i=this._currentEncrActionBlocks)&&void 0!==i?i.pop():void 0,l.push({spriteId:c,actionsData:h,encryptedData:d})),this.jumpToNextTag(g);break;case 12:this._swfFile.useAVM1&&(u=this._currentActionBlocks||(this._currentActionBlocks=[]),p=this.swfData.subarray(r.pos,r.pos+g),d=this._isEncrypted&&null!==(n=this._currentEncrActionBlocks)&&void 0!==n?n.pop():void 0,u.push({actionsData:p,precedence:r.pos,encryptedData:d})),this.jumpToNextTag(g);break;case 18:case 45:var C=parseSoundStreamHeadTag(this._dataStream,o+g);this._currentSoundStreamHead=SoundStream.FromTag(C);break;case 19:this._currentSoundStreamBlock=this.swfData.subarray(r.pos,r.pos+=g);break;case 43:s=r.pos+g,this._currentFrameLabels[this._currentFrameLabels.length]=r.readString(-1),r.pos=s;break;case 1:this.finishFrame();break;case 0:return;case 56:s=r.pos+g;for(var P=r.readUi16(),E=this._currentExports||(this._currentExports=[]);P--;){S=r.readUi16();var T=r.readString(-1);if(r.pos>s){r.pos=s;break}E.push(new SymbolExport(S,T))}r.pos=s;break;case 17:s=r.pos+g;var M=r.readUi16();this._buttonSounds[M]={};for(var D=0;D<4;D++)this._buttonSounds[M][D]={},this._buttonSounds[M][D].id=r.readUi16(),0!=this._buttonSounds[M][D].id&&(this._buttonSounds[M][D].info=parseSoundInfo(r));r.pos=s;break;case 23:case 13:case 62:case 78:case 57:case 71:this.jumpToNextTag(g);break;case 77:this.parseMetaData(g);break;case 74:case 73:case 65:case 66:case 58:case 64:case 63:case 88:case 40:case 41:case 24:case 25:case 93:case 55:case 49:this.jumpToNextTag(g);break;case 51:case 44:case 50:case 53:case 42:case 38:case 52:case 3:case 31:case 47:case 16:case 29:this.jumpToNextTag(g);break;case 255:console.log("Tag 255 present. SWF is encrypted"),this._isEncrypted=!0,this.jumpToNextTag(g);break;case 253:this._isEncrypted&&(_=this._currentEncrActionBlocks||(this._currentEncrActionBlocks=[]),f=this.swfData.subarray(o+2,o+g),_.push({data:f,bytePos:o+2,size:g,rawTagId:m})),this.jumpToNextTag(g);break;default:100o){console.log("DefineSprite child tags exceed DefineSprite tag length and are dropped");break}if(ControlTags[g])l.push(new UnparsedTag(g,i.pos,m)),i.pos+=m;else{switch(g){case 12:this._swfFile.useAVM1&&(u=u||[],_=e.subarray(i.pos,i.pos+m),u.push({actionsData:_,precedence:i.pos}));break;case 59:this._swfFile.useAVM1&&(p=p||[],f=n.getUint16(i.pos,!0),i.pos+=2,_=e.subarray(i.pos,i.pos+m),p.push({spriteId:f,actionsData:_}));break;case 43:var y=i.pos+m;a[a.length]=i.readString(-1),i.pos=y,m=0;break;case 1:s.push(new SWFFrame(l,a.concat(),c,h,u,p,null)),a.length=0,l=[],p=u=h=c=null;break;case 0:i.pos=o,m=0;break;case 18:case 45:var b=i.pos,v=parseSoundStreamHeadTag(i,y=i.pos+m),c=SoundStream.FromTag(v);i.pos=b;break;case 19:b=i.pos,y=i.pos+m,h=this.swfData.subarray(i.pos,y),i.pos=b}i.pos+=m,assert(i.pos<=o)}}return r},odd.prototype.parseMetaData=function(t){this._dataStream.pos+=t},odd.prototype.jumpToNextTag=function(t){this._dataStream.pos+=t},odd.prototype.emitTagSlopWarning=function(t,e){this._dataStream.pos,t.byteOffset,this._dataStream.pos=e},odd.prototype.finishFrame=function(){0===this.pendingUpdateDelays&&this._swfFile.framesLoaded++,this._swfFile.frames.push(new SWFFrame(this._currentControlTags,this._currentFrameLabels.concat(),this._currentSoundStreamHead,this._currentSoundStreamBlock,this._currentActionBlocks,this._currentInitActionBlocks,this._currentExports)),this._currentFrameLabels.length=0,this._currentControlTags=null,this._currentSoundStreamHead=null,this._currentSoundStreamBlock=null,this._currentActionBlocks=null,this._currentInitActionBlocks=null,this._currentExports=null},odd.prototype.setFileAttributes=function(t){this._swfFile.attributes&&this.jumpToNextTag(t);var e=this.swfData[this._dataStream.pos];this._dataStream.pos+=4,this._swfFile.attributes={network:1&e,relativeUrls:2&e,noCrossDomainCaching:4&e,doAbc:8&e,hasMetadata:16&e,useGpu:32&e,useDirectBlit:64&e},this._swfFile.useAVM1=!this._swfFile.attributes.doAbc},odd.prototype.setSceneAndFrameLabelData=function(t){this._swfFile.sceneAndFrameLabelData?this.jumpToNextTag(t):this._swfFile.sceneAndFrameLabelData=this._swfFile.sceneAndFrameLabelData=parseDefineSceneTag(this._dataStream,86)},odd.prototype.addControlTag=function(t,e,i){(this._currentControlTags||(this._currentControlTags=[])).push(new UnparsedTag(t,e,i)),this.jumpToNextTag(i)},odd.prototype.addLazySymbol=function(t,e,i){var n=this._dataView.getUint16(this._dataStream.pos,!0),r=new DictionaryEntry(n,t,e,i);return this.dictionary[n]=r},odd.prototype.decodeEmbeddedFont=function(t){var e=this.getParsedTag(t),i=new EagerlyParsedDictionaryEntry(e.id,t,"font",e);this.eagerlyParsedSymbolsMap[i.id]=i,this.eagerlyParsedSymbolsList.push(i);var n=flagsToFontStyle(e.bold,e.italic);this.fonts.push({name:e.name,id:e.id,style:n})},odd.prototype.registerEmbeddedFont=function(t){var e,i,n,r,o=this._dataStream,s=this._dataView.getUint16(o.pos,!0);10===t.tagCode?(e="__autofont__"+t.byteOffset,n="regular"):(n=flagsToFontStyle(!!(1&(i=this.swfData[o.pos+2])),!!(2&i)),r=this.swfData[o.pos+4],o.pos+=5,e=o.readString(r)),this.fonts.push({name:e,id:s,style:n}),o.pos=t.byteOffset+t.byteLength},odd.prototype.decodeEmbeddedImage=function(t){var e=this.getParsedTag(t),i=new EagerlyParsedDictionaryEntry(e.id,t,"image",e);this.eagerlyParsedSymbolsMap[i.id]=i,this.eagerlyParsedSymbolsList.push(i)},odd.factory=null,odd),ndd;function odd(t){void 0===t&&(t=null);var e=ndd.call(this,URLLoaderDataFormat.ARRAY_BUFFER)||this;return e._parsed_header=!1,e._debug=!1,e._isEncrypted=!1,e._currentEncrActionBlocks=[],e.soundExports={},e.externalDependenciesCount=0,e._buttonIds={},e._mcIds={},e.textFormatAlignMap=[TextFormatAlign.LEFT,TextFormatAlign.RIGHT,TextFormatAlign.CENTER,TextFormatAlign.JUSTIFY],e._buttonSounds={},e._swfFile=new SWFFile,e._factory=t,e._progressState=0,e}function flagsToFontStyle(t,e){return t&&e?"boldItalic":t?"bold":e?"italic":"regular"}function readSWFLength(t){return(t[4]|t[5]<<8|t[6]<<16|t[7]<<24)>>>0}function defineSymbol(t,e,i){switch(t.code){case 6:case 21:case 35:case 90:return defineImage(t);case 20:case 36:return defineBitmap(t);case 7:case 34:return defineButton(t,e);case 37:return defineText(t);case 10:case 48:case 75:case 91:return defineFont(t,i._iFileName);case 46:case 84:case 2:case 22:case 32:case 83:return defineShape(t,i);case 14:return defineSound(t);case 60:return{type:"video",id:t.id,width:t.width,height:t.height,deblocking:t.deblocking,smoothing:t.smoothing,codec:t.codecId};case 39:return t;case 87:return{type:"binary",id:t.id,data:t.data};case 11:case 33:return defineLabel(t);default:return t}}var StageAlign=(Uhd.BOTTOM="B",Uhd.BOTTOM_LEFT="BL",Uhd.BOTTOM_RIGHT="BR",Uhd.LEFT="L",Uhd.RIGHT="R",Uhd.TOP="T",Uhd.TOP_LEFT="TL",Uhd.TOP_RIGHT="TR",Uhd),StageScaleMode=(Vhd.EXACT_FIT="EXACT_FIT",Vhd.NO_BORDER="noBorder",Vhd.NO_SCALE="noScale",Vhd.SHOW_ALL="showAll",Vhd),hasshownServerError=!1,TEST_MODE,Xhd;function Vhd(){}function Uhd(){}function serverError(t){hasshownServerError||(hasshownServerError=!0,alert("Can not connect to Server. Is Server.js running ?"))}Xhd=TEST_MODE=TEST_MODE||{},Xhd.TESTING="TESTING",Xhd.RECORDING="RECORDING";var AVMTestHandler=(Yhd.prototype.addMessage=function(t){this._finished||(this.frames[this.frames.length-1].messages.push(t),this.checkIfFinished())},Yhd.prototype.setSWF=function(t){this.swfInfo={frameRate:t.frameRate,swfVersion:t.swfVersion,asVersion:t.useAVM1?2:3,width:t.bounds.width/20,height:t.bounds.height/20}},Yhd.prototype.recordEvent=function(t){var e;this.config.settings.snapShotOnMouseDown&&"mousedown"==t.type&&this.takeSnapshot(),this.config.settings.snapShotOnMouseUP&&"mouseup"==t.type&&this.takeSnapshot(),this.config.recordtest&&this.config.settings.recordInput&&(this.events[this.frameIdx]||(this.events[this.frameIdx]=[]),e={type:t.type,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey},this.events[this.frameIdx].push(e))},Yhd.prototype.dispatchEvents=function(){if(!this.config.recordtest&&this.config.events&&this.config.events[this.frameIdx])for(var t=0;tthis.config.settings.stopRecAfterFrame&&this.finishTest(),this._finished||(0!=this.config.settings.snapShotFrames&&this.frameIdx%this.config.settings.snapShotFrames==0&&this.takeSnapshot(),this.config.settings.onlyTraces||(0=t&&this.finishTest())}},Yhd.prototype.finishTest=function(){this._finished||(this._finished=!0,this.closeBrowserTab())},Yhd.prototype.finishAndUploadTest=function(){0==this.frames[this.frames.length-1].messages.length&&this.frames.pop();var t,e=window.location.pathname.split("/").pop().replace(".html",""),i={player:"awayflplayer",duration:Date.now()-this.config.startRecTime,date:(new Date).toLocaleString(),url:e,swf:this.config.swfPath,swfInfos:this.swfInfo,settings:this.config.settings,frames:this.frames,events:this.events,seed:this.config.seed},n=JSON.stringify(i),r=new FormData,o=new Blob([n],{type:"text/xml"});this.config.recordtest?(t=this.config.swfPath.replace(/\\/g,"/"),r.append("file",o,t),r.append("record","true")):(t=this.config.swfPath.replace(/\\/g,"/")+"/"+this.config.testPath,r.append("file",o,t));var s=new XMLHttpRequest;s.onreadystatechange=function(t){4==s.readyState&&(200==s.status||0==s.status?console.log("AWAYFLTEST END"):serverError())},s.onerror=function(t){serverError()};try{s.open("POST","http://localhost:"+this.config.port+"/upload",!0),s.send(r)}catch(e){serverError()}},Yhd),AVMStage=(Eid=DisplayObjectContainer,__extends(Fid,Eid),Fid.instance=function(){if(!Fid._instance)throw"AVMStage._instance should exists but does not";return Fid._instance},Object.defineProperty(Fid.prototype,"config",{get:function(){return this._gameConfig},enumerable:!0,configurable:!0}),Fid.prototype.registerAVMStageHandler=function(t){this._avmHandlers[t.avmVersion]=t},Fid.prototype.initAwayEninge=function(){this._scene=new Scene(new BasicPartition(new DisplayObjectContainer)),this._rendererStage=this.scene.view.stage,this._rendererStage.container.style.visibility="hidden",this._rendererStage.antiAlias=0,this._scene.renderer.renderableSorter=null,this._scene.forceMouseMove=!0,this._scene.mousePicker.shapeFlag=!0,this._projection=new PerspectiveProjection,this._projection.coordinateSystem=CoordinateSystem.RIGHT_HANDED,this._projection.originX=-1,this._projection.originY=1;var t=new Camera;t.projection=this._projection,this._scene.camera=t,this._projection.fieldOfView=360*Math.atan(window.innerHeight/1e3/2)/Math.PI,this.partition=new SceneGraphPartition(this,!0),this._scene.root.addChild(this)},Fid.prototype.playSWF=function(t,e){var i=this;this._gameConfig={files:[{data:t,path:e,resourceType:"GAME"}]},this.addEventListener(LoaderEvent.LOADER_COMPLETE,function(t){return i.play()}),this.loadNextResource()},Fid.prototype.snapshot=function(t){var e=new BitmapImage2D(this._stageWidth,this._stageHeight,!0,4294967295,!1);this._scene.renderer.queueSnapshot(e),this._scene.renderer.view.target=e,this._scene.render(),this._scene.renderer.view.target=null,e.invalidate();for(var i=e.data,n=new BitmapImage2D(this._stageWidth,this._stageHeight,!0,4278255615,!1),r=0,o=0,s=0,a=0,o=0;oi&&(a=(s=i)*(this._stageHeight/this._stageWidth)),r+=(i-s)/2,o+=(n-a)/2,this._projection.fieldOfView=360*Math.atan(this._stageHeight/1e3/2)/Math.PI;break;case StageScaleMode.EXACT_FIT:case StageScaleMode.NO_BORDER:this._projection.fieldOfView=360*Math.atan(n/1e3/2)/Math.PI;break;default:console.log("Stage: only implemented StageScaleMode are NO_SCALE, SHOW_ALL")}switch(this._align){case StageAlign.TOP_LEFT:this._scene.view.x=r,this._scene.view.y=o;break;default:this._scene.view.x=r,this._scene.view.y=o,console.log("Stage: only implemented StageAlign is TOP_LEFT")}this._scene.view.x=r,this._scene.view.y=o,this._scene.view.width=s,this._scene.view.height=a,this._fpsTextField&&(this._fpsTextField.style.left=.5*window.innerWidth-50+"px"),this._avmHandler&&this._avmHandler.resizeStage()},Fid.prototype.resizeCallback=function(t){this.resizeStageInternal()},Fid.prototype.pause=function(){AudioManager.setVolume(0),this._isPaused=!0},Fid.prototype.unPause=function(){AudioManager.setVolume(1),this._isPaused=!1},Object.defineProperty(Fid.prototype,"isPaused",{get:function(){return this._isPaused},set:function(t){this._isPaused=t},enumerable:!0,configurable:!0}),Fid.prototype.main_loop=function(t){if(!this._isPaused){if(!this._avmHandler)throw"error - can not render when no avm-stage is available";var e;this._scene&&this._scene.renderer?(e=Math.floor(1e3/this._frameRate),this._time+=Math.min(t,e),this._time>=e&&(this._currentFps++,this.showNextFrame(this._time),this._time-=e)):this._timer.stop()}},Fid.prototype.requestRender=function(){this._scene&&this._scene.renderer?(FrameScriptManager.execute_queue(),this._scene.render(!0)):this._timer.stop()},Fid.prototype.showNextFrame=function(t){if(this._isPaused)return MovieClipSoundsManager.enterFrame(),void MovieClipSoundsManager.exitFrame();MovieClipSoundsManager.enterFrame(),this.avmTestHandler&&this.avmTestHandler.dispatchEvents(),this._scene.fireMouseEvents(),this._avmHandler.enterFrame(t),this.avmTestHandler&&this.avmTestHandler.nextFrame(),this._scene&&this._scene.renderer?(this._scene.render(!0),MovieClipSoundsManager.exitFrame()):this._timer.stop()},Object.defineProperty(Fid.prototype,"align",{get:function(){return this._align},set:function(t){this._alignAllowUpdate&&(this._align=t,this.resizeCallback())},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"accessibilityImplementation",{get:function(){return console.log("AVMStage: get accessibilityImplementation not implemented"),this._align},set:function(t){console.log("AVMStage: accessibilityImplementation not implemented")},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"color",{get:function(){return this._scene.renderer.view.backgroundColor},set:function(t){this._scene.renderer.view.backgroundColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"frameRate",{get:function(){return this._frameRate},set:function(t){this._frameRate=t},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"mouseX",{get:function(){return this._scene.getLocalMouseX(this)},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"mouseY",{get:function(){return this._scene.getLocalMouseY(this)},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(t){this._scaleModeAllowUpdate&&(this._scaleMode=t,this.resizeCallback())},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"scene",{get:function(){return this._scene},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"showFrameRate",{get:function(){return this._showFrameRate},set:function(t){var e=this;t!=this._showFrameRate&&((this._showFrameRate=t)?(this._fpsTextField=document.createElement("div"),this._fpsTextField.style.cssFloat="none",this._fpsTextField.style.backgroundColor="#000",this._fpsTextField.style.position="fixed",this._fpsTextField.style.top="5px",this._fpsTextField.style.width="100px",this._fpsTextField.style.height="20px",this._fpsTextField.style.right="5px",this._fpsTextField.style.textAlign="center",this._fpsTextField.style.color="#ffffff",this._fpsTextField.style.fontSize="16",this._fpsTextField.style.visibility="hidden",this._fpsTextField.innerHTML="",document.body.appendChild(this._fpsTextField),this._showFrameRateIntervalID=setInterval(function(){return e.updateFPS()},1e3)):this._showFrameRateIntervalID&&(clearInterval(this._showFrameRateIntervalID),this._showFrameRateIntervalID=-1,document.body.removeChild(this._fpsTextField),this._fpsTextField=null))},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"stageHeight",{get:function(){return this._stageHeight},set:function(t){this._stageHeight=t,this.resizeCallback()},enumerable:!0,configurable:!0}),Object.defineProperty(Fid.prototype,"stageWidth",{get:function(){return this._stageWidth},set:function(t){this._stageWidth=t,this.resizeCallback()},enumerable:!0,configurable:!0}),Fid.runtimeStartTime=0,Fid._instance=null,Fid.forceINT=!1,Fid),globalRedirectRules=[],instance,Eid;function Fid(t){var e=Eid.call(this)||this;if(e._gameConfig=null,e._curFile=null,Fid._instance)throw"Only one AVMStage is allowed to be constructed";return Fid._instance=e,Loader.enableParsers([WaveAudioParser,SWFParser,Image2DParser]),e._time=0,e._currentFps=0,e._avmHandlers={},e._stageWidth=550,e._stageHeight=400,e._scaleMode=StageScaleMode.SHOW_ALL,e._align=StageAlign.TOP_LEFT,e._scaleModeAllowUpdate=!0,e._alignAllowUpdate=!0,t.stageScaleMode&&(e._scaleMode=t.stageScaleMode,e._scaleModeAllowUpdate=!1),t.stageAlign&&(e._align=t.stageAlign,e._alignAllowUpdate=!1),t.forceINT&&(Fid.forceINT=t.forceINT),e._frameRate=30,e._showFrameRate=!1,e._showFrameRateIntervalID=-1,e._x=t.x?t.x:0,e._y=t.y?t.y:0,e._w=t.w?t.w:"100%",e._h=t.h?t.h:"100%",e._isPaused=!1,e._gameConfig=t,e.initAwayEninge(),e._scene.renderer.view.backgroundColor=16777215,AudioManager.setVolume(1),e._resizeCallbackDelegate=function(t){return e.resizeCallback(t)},window.addEventListener("resize",e._resizeCallbackDelegate),e._onLoaderStartDelegate=function(t){return e.onLoaderStart(t)},e._onLoaderCompleteDelegate=function(t){return e.onLoaderComplete(t)},e._onAssetCompleteDelegate=function(t){return e._onAssetComplete(t)},e._onLoadErrorDelegate=function(t){return e._onLoadError(t)},e._gameConfig.testConfig&&(e.avmTestHandler=new AVMTestHandler(e._gameConfig.testConfig,e)),e}function Yhd(t,e){var i=this;this.frameIdx=0,this.snapshotCnt=0,this.snapShotsUploaded=0,this.config=t,this._avmStage=e,this.frameIdx=0,this.events={},this.reportedSWFInfos=!1,this.frames=[{messages:[],frameIdx:this.frameIdx}],this._finished=!1,this.snapshotCnt=0,this.config.recordtest&&(MouseManager.inputRecorder=this),window.addEventListener("keydown",function(t){t.ctrlKey&&69==t.keyCode&&i.finishTest()})}function matchRedirect(l,t){var c=void 0;return(t?globalRedirectRules.concat(t):globalRedirectRules).forEach(function(t){var e=t.test,i=t.resolve,n=t.supressErrors,r=void 0!==n&&n,o=t.supressLoad,s=void 0!==o&&o,a=!1;"function"==typeof e?a=e(l):e instanceof RegExp?a=e.test(l):"string"==typeof e&&(a=e===l),a&&(c&&console.warn("[LOADER] Duplicate redirect rules, latest rule would be used!"),c={url:l,supressErrors:r,supressLoad:s},"function"==typeof i?c.url=i(l):i instanceof RegExp?c.url=l.match(i)[0]:"string"==typeof i?c.url=i:"string"==typeof a&&(c.url=a),void 0===c.url&&(console.warn("[LOADER] Redirect url is null, would be used original url!"),c.url=l))}),c}var Telemetry={instance:instance};function boxValue(t){return isNullOrUndefined$1(t)||isObject(t)?t:Object(t)}function toKeyValueArray(t){var e=Object.prototype.hasOwnProperty,i=[];for(var n in t)e.call(t,n)&&i.push([n,t[n]]);return i}function isPrototypeWriteable(t){return Object.getOwnPropertyDescriptor(t,"prototype").writable}function hasOwnProperty(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function propertyIsEnumerable(t,e){return Object.prototype.propertyIsEnumerable.call(t,e)}function getPropertyDescriptor(t,e){do{var i=Object.getOwnPropertyDescriptor(t,e);if(i)return i;t=Object.getPrototypeOf(t)}while(t);return null}function hasOwnGetter(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.get)}function getOwnGetter(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return i?i.get:null}function hasOwnSetter(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!(!i||!i.set)}function createMap(){return Object.create(null)}function createArrayMap(){return[]}function defineReadOnlyProperty(t,e,i){Object.defineProperty(t,e,{value:i,writable:!1,configurable:!0,enumerable:!1})}function copyProperties(t,e){for(var i in e)t[i]=e[i]}function copyOwnProperties(t,e){for(var i in e)hasOwnProperty(e,i)&&(t[i]=e[i])}function copyOwnPropertyDescriptors(t,e,i,n,r){for(var o in void 0===i&&(i=null),void 0===n&&(n=!0),void 0===r&&(r=!1),e)if(hasOwnProperty(e,o)&&(!i||i(o))){var s=Object.getOwnPropertyDescriptor(e,o);if(!n&&hasOwnProperty(t,o))continue;try{r&&!1===s.writable&&(s.writable=!0),Object.defineProperty(t,o,s)}catch(t){assert$2("Can't define: "+o)}}}function copyPropertiesByList(t,e,i){for(var n=0;n>5&255,u[p++]=i>>13&255,u[p++]=i>>21&255,u[p++]=i>>>29&255,u[p++]=0,u[p++]=0,u[p++]=0;var d=new Int32Array(16);for(p=0;p>>32-S)|0,m=x}s=s+m|0,a=a+g|0,l=l+y|0,c=c+b|0}return s}function mixHash(t,e){return(31*t|0)+e|0}var HashUtilities={_md5R:_md5R,_md5K:_md5K,hashBytesTo32BitsMD5:hashBytesTo32BitsMD5,mixHash:mixHash},ExternalInterfaceService={enabled:!0,callback:null,initJS:function(t){this.callback=t},registerCallback:function(e){var i=this;window.flash||(window.flash={}),window.flash[e]=function(t){i.callback(e,t)}},unregisterCallback:function(t){window.flash||(window.flash={}),delete window.flash[t]},eval:function(t){return window.eval(t)},call:function(t){},getId:function(){return null}},FileLoadingService;console.debug("AwayFL - SWF-Loader - 0.4.40");var AVM1PropertyDescriptor=function(t,e,i,n,r){this.flags=t,this.value=e,this.get=i,this.set=n,this.watcher=r},NullPrototypeObject=function(){},DEBUG_PROPERTY_PREFIX="$Bg",AVM1Object=(Pld=NullPrototypeObject,__extends(Qld,Pld),Object.defineProperty(Qld.prototype,"eventObserver",{get:function(){return this._eventObserver},set:function(t){this._eventObserver=t},enumerable:!0,configurable:!0}),Qld.prototype.dispose=function(){},Qld.prototype.updateFilters=function(t){for(var e=0;e=t.precedence.length?t.precedence.length===e.precedence.length?0:-1:i>=e.precedence.length?1:t.precedence[i]-e.precedence[i]},qzd.prototype.executeScript=function(t){if("number"==typeof t&&(t=this.adaptee.timeline.get_script_for_frame(this.adaptee,this.adaptee.currentFrameIndex)),qzd.currentMCAssetNameSpace=this.adaptee.assetNamespace,AVM1TextField.syncQueedTextfields(),t){if(this.adaptee.parent){for(var e=[],i=0;it._depthID)&&(this._childrenByName[i]=getAVM1Object(t,this.context),e||this.alPut(i,this._childrenByName[i]))}},qzd.prototype.unregisterScriptObject=function(t){var e=t.name;if(e&&(this.context.swfVersion<8&&(e=e.toLowerCase()),this.context.swfVersion<8&&this.alDeleteOwnProperty(e),this._childrenByName[e]&&this._childrenByName[e].adaptee.id==t.id)){for(var i=this.adaptee._children,n=i.length,r=null,o=null,s=0;sr._depthID)&&(o=r);o?this._childrenByName[e]=getAVM1Object(o,this.context):delete this._childrenByName[e]}},qzd.prototype.getLatestObjectForName=function(t){if(!this.alHasOwnProperty(t)){for(var e=this.adaptee._children,i=e.length,n=null,r=null,o=0;on._depthID)&&(r=n);r&&(this._childrenByName[t]=getAVM1Object(r,this.context),this.unregisteredColors[t]&&(this.unregisteredColors[t].changeTarget(r.adapter),this.unregisteredColors[t]=null))}},Object.defineProperty(qzd.prototype,"graphics",{get:function(){return this.adaptee.graphics},enumerable:!0,configurable:!0}),qzd.prototype.initAVM1SymbolInstance=function(t,e){var i=this;this._childrenByName=Object.create(null),pzd.prototype.initAVM1SymbolInstance.call(this,t,e),this.dragListenerDelegate=function(t){return i.dragListener(t)},this.stopDragDelegate=function(t){return i.stopDrag(t)},this.dynamicallyCreated=!1,this.adaptee=e,this._initEventsHandlers()},qzd.prototype._lookupChildByName=function(t){return this._childrenByName[t]},qzd.prototype._lookupChildInAS3Object=function(t){return this.context.isPropertyCaseSensitive,getAVM1Object(this.adaptee.getChildByName(t),this.context)},Object.defineProperty(qzd.prototype,"__targetPath",{get:function(){var t=this.get_target(),e=this.adaptee.root,i="_level"+this.context.levelsContainer._getLevelForRoot(e);return"/"!=t?i+t.replace(/\//g,"."):i},enumerable:!0,configurable:!0}),qzd.prototype.getAwayJSID=function(){return this.adaptee.id},qzd.prototype.attachAudio=function(t){isNullOrUndefined$1(t)},qzd.prototype.attachBitmap=function(t,e,i,n){void 0===i&&(i="auto"),void 0===n&&(n=!1),i=alCoerceString(this.context,i),n=alToBoolean(this.context,n);var r=t.as3BitmapData;r.transparent=!0;var o=new MethodMaterial(r);o.alphaBlending=!0,o.useColorTransform=!0;var s=new Billboard(o,i,n);this._insertChildAtDepth(s,e)},qzd.prototype._constructMovieClipSymbol=function(t,e){t=alToString(this.context,t),e=alToString(this.context,e);var i,n=AssetLibrary.getAsset(t,this.adaptee.assetNamespace);if(n)return(i=n.adaptee.clone()).name=e,getAVM1Object(i,this._avm1Context),i},qzd.prototype.get$version=function(){return""},qzd.prototype.rgbaToArgb=function(t){return(255&t)<<24|(4278190080&t)>>>24<<16|(16711680&t)>>>16<<8|(65280&t)>>>8},qzd.prototype.attachMovie=function(t,e,i,n){if(this._constructMovieClipSymbol){e&&alIsArray(this.context,e)&&(e=e.value[0]);var r,o=this._constructMovieClipSymbol(t,e);if(o){o.name||(o.name=""),i=alToNumber(this.context,i),e&&(r=this._childrenByName[e.toLowerCase()]),o.reset();var s=this._insertChildAtDepth(o,avm2AwayDepth(i));return n&&s._init(n),r&&r.avmColor&&r.avmColor.changeTarget(s),o.timeline&&o.timeline.isButton&&o.addButtonListeners(),s.dynamicallyCreated=!0,e&&this.registerScriptObject(o,!0),s}}},qzd.prototype.beginFill=function(t,e){t=alToInt32(this.context,t),void 0===e&&(2==arguments.length?e=0:arguments.length<=1&&(e=100)),e=alToNumber(this.context,e),this.graphics.beginFill(t,e/100)},qzd.prototype.beginBitmapFill=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=!1),void 0===n&&(n=!1),alInstanceOf(this.context,t,this.context.globals.BitmapData)&&(toAS3BitmapData(t),isNullOrUndefined$1(e)||toAS3Matrix(e),i=alToBoolean(this.context,i),n=alToBoolean(this.context,n))},qzd.prototype.beginGradientFill=function(t,e,i,n,r,o,s,a){var l=this;void 0===o&&(o="pad"),void 0===s&&(s="rgb"),void 0===a&&(a=0),this.context;var c=AVM1ArrayNative.mapToJSArray(e,function(t){return alToInt32(l.context,t)}),h=AVM1ArrayNative.mapToJSArray(i,function(t){return alToNumber(l.context,t)/100}),u=AVM1ArrayNative.mapToJSArray(n,function(t){return alToNumber(l.context,t)});o=alToString(this.context,o),s=alToString(this.context,s),a=alToNumber(this.context,a),this.graphics.beginGradientFill(t,c,h,u,null,o,s,a)},qzd.prototype._callFrame=function(t){var e;"string"==typeof t?e=this.adaptee.timeline.getScriptForLabel(this.adaptee,t):"number"==typeof t&&(e=this.adaptee.timeline.get_script_for_frame(this.adaptee,t-1)),e&&this.executeScript(e)},qzd.prototype.clear=function(){this.graphics.clear()},qzd.prototype._insertChildAtDepth=function(t,e){return this.adaptee.addChildAtDepth(t,e),getAVM1Object(t,this._avm1Context)},qzd.prototype._updateChildName=function(t,e,i){e&&this._removeChildName(t,e),i&&this._addChildName(t,i)},qzd.prototype._removeChildName=function(t,e){var i;this.context.isPropertyCaseSensitive||(e=e.toLowerCase()),this._childrenByName&&this._childrenByName[e]&&this._childrenByName[e]===t&&((i=this._lookupChildInAS3Object(e))?this._childrenByName[e]=i:delete this._childrenByName[e])},qzd.prototype._addChildName=function(t,e){this.context.isPropertyCaseSensitive||(e=e.toLowerCase());var i=this._childrenByName[e];(!i||i.getDepth()>t.getDepth())&&(this._childrenByName[e]=t)},qzd.prototype.createEmptyMovieClip=function(t,e){t=alToString(this.context,t);var i=new MovieClip;i.name=t,i.assetNamespace=this.adaptee.assetNamespace,getAVM1Object(i,this._avm1Context);var n=this._insertChildAtDepth(i,avm2AwayDepth(e));return n.dynamicallyCreated=!0,this.registerScriptObject(i,!1),i.mouseEnabled=!1,n},qzd.prototype.createTextField=function(t,e,i,n,r,o){t=alToString(this.context,t);var s=new TextField;s.name=t,s.textFormat=new TextFormat,getAVM1Object(s,this._avm1Context);var a=this._insertChildAtDepth(s,avm2AwayDepth(e));return this.registerScriptObject(s,!1),s.x=i,s.y=n,s.width=r,s.height=o,a.dynamicallyCreated=!0,a},qzd.prototype.get_currentframe=function(){return this.adaptee.currentFrameIndex+1},qzd.prototype.curveTo=function(t,e,i,n){t=alToNumber(this.context,t),e=alToNumber(this.context,e),i=alToNumber(this.context,i),n=alToNumber(this.context,n),this.graphics.curveTo(t,e,i,n)},qzd.prototype.setDropTarget=function(t){if(t){for(var e=[];t;)t=t.isAVMScene?null:(null!=t.name&&e.push(t.name),t.parent);for(var i=e.length,n="";0this._dragBounds.right&&(this.adaptee.x=this._dragBounds.right),this.adaptee.ythis._dragBounds.bottom&&(this.adaptee.y=this._dragBounds.bottom)},qzd.prototype.stop=function(){return this.adaptee.stop()},qzd.prototype.stopDrag=function(t){qzd.currentDraggedMC&&qzd.currentDraggedMC!=this&&qzd.currentDraggedMC.stopDrag(),this.isDragging=!1,qzd.currentDraggedMC=null,AVM1Stage.avmStage.scene.mousePicker.dragEntity=null,MouseManager.getInstance(AVM1Stage.avmStage.scene.renderer.renderGroup.pickGroup).stopDragObject(),AVM1Stage.avmStage.removeEventListener("mouseMove3d",this.dragListenerDelegate),window.removeEventListener("mouseup",this.stopDragDelegate),window.removeEventListener("touchend",this.stopDragDelegate)},qzd.prototype.swapDepths=function(t){var e;this.adaptee.isAVMScene||!this.get_parent()||(e=getAwayJSAdaptee(this.get_parent()))&&void 0!==t&&("number"==typeof t?e.swapDepths(this.adaptee,avm2AwayDepth(t)):t.adaptee&&(t._blockedByScript=!0,t._ctBlockedByScript=!0,e.swapChildren(this.adaptee,t.adaptee)),this._blockedByScript=!0,this._ctBlockedByScript=!0,this.adaptee._depthID==this.initialDepth?this.hasSwappedDepth=!1:this.hasSwappedDepth=!0,this.adaptee.name&&e&&e.adapter&&e.adapter.getLatestObjectForName(this.adaptee.name.toLowerCase()))},qzd.prototype.getTabChildren=function(){return getAwayObjectOrTemplate(this).tabChildren},qzd.prototype.setTabChildren=function(t){getAwayObjectOrTemplate(this).tabChildren=alToBoolean(this.context,t)},qzd.prototype.get_totalframes=function(){return this.adaptee.numFrames},qzd.prototype.getTrackAsMenu=function(){return getAwayObjectOrTemplate(this).trackAsMenu},qzd.prototype.setTrackAsMenu=function(t){getAwayObjectOrTemplate(this).trackAsMenu=alToBoolean(this.context,t)},qzd.prototype.unloadMovie=function(){var t=this.adaptee;this.adaptee.constructedKeyFrameIndex=0,this.adaptee.stop(),t.removeChildren(0,t.numChildren),(this.dynamicallyCreated||this.hasSwappedDepth)&&t.parent&&t.parent.adapter&&t.parent.adapter.unregisterScriptObject(t)},qzd.prototype.getUseHandCursor=function(){return this.adaptee.useHandCursor},qzd.prototype.setUseHandCursor=function(t){this.adaptee&&(this.adaptee.useHandCursor=t)},qzd.prototype.setParameters=function(t){for(var e in t)this.alHasProperty(e)||this.alPut(e,t[e])},qzd.prototype._resolveLevelNProperty=function(t){if("_level0"===t||"_level"===t)return this.context.resolveRoot();if("_root"===t)return this.context.resolveRoot();if(0===t.indexOf("_level")){var e=t.substring(6),i=0|e;if(0>>0,n=(i*=n)>>>0,n+=4294967296*(i-=n)}return 2.3283064365386963e-10*(n>>>0)}n=4022871197}},uheprng=function(t){return function(){for(var e,i=1,n=48,r=new Array(48),o=0,s=new Mash,a=0;a<48;a++)r[a]=s(Math.random());function l(){48<=++n&&(n=0);var t=1768863*r[n]+2.3283064365386963e-10*i;return r[n]=t-(i=0|t)}function c(t){return Math.floor(t*(l()+11102230246251565e-32*(2097152*l()|0)))}c.string=function(t){for(var e="",i=0;i>>0,new AVM1ArrayNative(this.context,i.split(t,e))):new AVM1ArrayNative(this.context,[i])},gQd.prototype.substr=function(t,e){var i=alToString(this.context,this),n=i.length;if(t=alToInteger(this.context,t),e=void 0===e?n:alToInteger(this.context,e),t<0&&(t=Math.max(0,n+t)),e<0){if(-e<=t)return"";e=Math.max(0,n+e)}return i.substr(t,e)},gQd.prototype.substring=function(t,e){var i=alToString(this.context,this);return(t=alToInteger(this.context,t))>=i.length?"":(e=void 0===e?void 0:alToInteger(this.context,e),i.substring(t,e))},gQd.prototype.toLowerCase=function(){return alToString(this.context,this).toLowerCase()},gQd.prototype.toUpperCase=function(){return alToString(this.context,this).toUpperCase()},gQd),AVM1StringFunction=(IQd=AVM1Function,__extends(JQd,IQd),JQd.prototype.alConstruct=function(t){var e=t?alToString(this.context,t[0]):"";return new AVM1StringNative(this.context,e)},JQd.prototype.alCall=function(t,e){return e?alToString(this.context,e[0]):""},JQd.prototype.fromCharCode=function(){for(var e=this,t=[],i=0;i>>0,alEnsureType(this,AVM1ArrayNative).value.length=t)},CRd.prototype.concat=function(){for(var t=[],e=0;e=t.length);)o=t[n++],s=alIsArray(this.context,o);return new AVM1ArrayNative(this.context,r)},CRd.prototype.join=function(t){if(t=void 0===t?",":alCoerceString(this.context,t),this instanceof AVM1ArrayNative){var e=alEnsureType(this,AVM1ArrayNative).value;if(0===e.length)return"";if(e.every(function(t){return!(t instanceof AVM1Object)}))return e.join(t)}var i=this.context,n=alToInt32(i,this.alGet("length"))>>>0;if(0==n)return"";for(var r=[],o=0;o>>0;if(0!=t){var e=t-1,i=this.alGet(e);return this.alDeleteProperty(e),this.alPut("length",e),i}},CRd.prototype.push=function(){for(var t=[],e=0;e>>0,r=0;r>>0;if(0!=t){for(var e=this.alGet(0),i=1;i>>0;t=t<0?Math.max(r+t,0):Math.min(r,t),e=void 0===e?r:e<0?Math.max(r+e,0):Math.min(r,e);for(var o=t,s=0;o>>0;if(t=t<0?Math.max(r+t,0):Math.min(r,t),e=e||"number"==typeof e?alToInteger(this.context,e):r-t,this instanceof AVM1ArrayNative){var o=alEnsureType(this,AVM1ArrayNative).value;return new AVM1ArrayNative(this.context,Array.prototype.splice.apply(o,[t,e].concat(i)))}for(var s=[],a=0;a>>0,r=t.length,o=n-1;0<=o;o--)this.alHasProperty(o)?this.alPut(o+r,this.alGet(o)):this.alDeleteProperty(o+r);for(o=0;o>>0!==e)throw new Error("Range error");return new AVM1ArrayNative(this.context,new Array(e))},cTd.prototype.alCall=function(t,e){return this.alConstruct.apply(this,e)},cTd),AVM1MathObject=(jTd=AVM1Object,__extends(kTd,jTd),kTd.prototype.abs=function(t){return Math.abs(alToNumber(this.context,t))},kTd.prototype.acos=function(t){return Math.acos(alToNumber(this.context,t))},kTd.prototype.asin=function(t){return Math.asin(alToNumber(this.context,t))},kTd.prototype.atan=function(t){return Math.atan(alToNumber(this.context,t))},kTd.prototype.atan2=function(t,e){return Math.atan2(alToNumber(this.context,t),alToNumber(this.context,e))},kTd.prototype.ceil=function(t){return Math.ceil(alToNumber(this.context,t))},kTd.prototype.cos=function(t){return Math.cos(alToNumber(this.context,t))},kTd.prototype.exp=function(t){return Math.exp(alToNumber(this.context,t))},kTd.prototype.floor=function(t){return Math.floor(alToNumber(this.context,t))},kTd.prototype.log=function(t){return Math.log(alToNumber(this.context,t))},kTd.prototype.max=function(){for(var e=this,t=[],i=0;i++n&&v(t,i,s.RM),2==e&&(n=t.e+i+1);t.c.length=s.PE))o=o.charAt(0)+(1i)for(r-=i;r--;)o+="0";else rn[r]^e?1:-1;return s==a?0:a_[h]?1:-1;break}if(!(c<0))break;for(a=f==s?n:u;f;){if(_[--f]>=1;)e=e.times(e);return r?i.div(n):n},r.round=function(t,e){var i=this.constructor;if(void 0===t)t=0;else if(t!==~~t||t<-1e6||1e6>1|128;if((t&o)===n)break;n=o,--r}while(0<=r);for(var s=t&(1<>10&1023|55296,1023&s|56320):String.fromCharCode(s)}else e+=String.fromCharCode(t);return e},f0d.prototype.readString=function(){return this.readANSI?this.readANSIString():this.readUTF8String()},f0d.prototype.readBytes=function(t){var e=this.position,i=Math.max(this.end-e,0);i=this._stream.end},enumerable:!0,configurable:!0}),Object.defineProperty(R0d.prototype,"length",{get:function(){return this._stream.end},enumerable:!0,configurable:!0}),R0d.prototype.readNext=function(){var t=this._stream,e=t.position,i=t.readUI8(),n=128<=i?t.readUI16():0,r=t.position+n,o=null;switch(0|i){case 129:var s=t.readUI16(),a=!1;6!==(l=t.readUI8())&&7!==l?t.position--:(r++,a=6===l),o=[s,a];break;case 131:o=[t.readString(),t.readString()];break;case 138:o=[s=t.readUI16(),p=t.readUI8()];break;case 139:o=[t.readString()];break;case 140:var l,c=t.readString(),a=!1;6!==(l=t.readUI8())&&7!==l?t.position--:(r++,a=6===l),o=[c,a];break;case 150:for(var h,u,o=[];t.positiont.length)&&(l&&p<0?(console.debug("[LONG JUMP] Script "+s.id+", jump outside action "+p+"\n Try to parse encryptedData"),g=!0,y=Math.min(p)):(console.warn("[LONG JUMP] Script "+s.id+", jump outside action "+p+"\n Require encrypted data!"),p=t.length)),_?x.next=p:x.conditionalJumpTo=p,n[p]||(i.push(p),m.push(p),n[p]=!0)),e[c]=x,_)break;c=u}!g&&y&&console.warn("Process long jump!");var b,v,x,A=[];i.forEach(function(t){if(e[t]){for(b=[],v=t;x=e[v],b.push(x),v=x.next,!n[v]&&e[v];);A.push({label:t,items:b,jump:v})}});var S=null;return r?S=o:this.parentResults&&(S=this.parentResults.singleConstantPool),{actions:e,blocks:A,dataId:t.dataId,singleConstantPool:S,registersLimit:this.registersLimit}},B1d),cachedActionsCalls=null,U$d;function B1d(){this.parentResults=null,this.registersLimit=0}function R0d(t,e){this.swfVersion=e,this._actionsData=t,this.dataId=t.id,this._stream=new ActionsDataStream(t.bytes,e)}function f0d(t,e){this.array=t,this.position=0,this.end=t.length,this.readANSI=e<6;var i=new ArrayBuffer(4);if(new Int32Array(i)[0]=1,!new Uint8Array(i)[0])throw new Error("big-endian platform")}function t_d(t){this.swfVersion=t,this.globals=null,this.actionsDataFactory=new ActionsDataFactory,6=n.registersLimit?h.push("undefined"):h.push("registers["+l+"]"):r instanceof AVM1ActionsData&&(i[c="code_"+e+"_"+p]=r,h.push("res."+c));return h.join(",")},_1d.prototype.convertAction=function(t,e,i,n,r,o){switch(t.action.actionCode){case 153:case 62:return"";case 136:return i.constantPool=t.action.args[0]," constantPool = ["+this.convertArgs(t.action.args[0],e,i,r)+"];\n ectx.constantPool = constantPool;\n";case 150:return" stack.push("+this.convertArgs(t.action.args,e,i,r)+");\n";case 135:var s=t.action.args[0];return s<0||s>=r.registersLimit?"":" registers["+s+"] = stack[stack.length - 1];\n";case 138:case 141:return" if (calls."+t.action.actionName+"(ectx,["+this.convertArgs(t.action.args,e,i,r)+"])) { position = "+t.conditionalJumpTo+"; checkTimeAfter -= "+(n+1)+"; break; }\n";case 157:return" if (!!stack.pop()) { position = "+t.conditionalJumpTo+"; checkTimeAfter -= "+(n+1)+"; break; }\n";default:var a,l=" calls."+t.action.actionName+"(ectx"+(t.action.args?",["+this.convertArgs(t.action.args,e,i,r)+"]":"")+");\n";return"ActionCallMethod"==t.action.actionName&&150==o.action.actionCode&&('"gotoAndStop"'!=(a=this.convertArgs(o.action.args,e-1,i,r))&&'"gotoAndPlay"'!=a||(l+=" if(ectx.scopeList && ectx.scopeList.scope && ectx.scopeList.scope.adaptee && !ectx.scopeList.scope.adaptee.parent){ ectx.framescriptmanager.execute_avm1_constructors(); return;}\n")),l}},_1d.prototype.generate=function(n){var r=this,t=n.blocks,o={},s=0,e=n.dataId,a="return function "+e+"(ectx) {\nvar position = 0;\nvar checkTimeAfter = 0;\nvar constantPool = ectx.constantPool, registers = ectx.registers, stack = ectx.stack;\n";return avm1DebuggerEnabled.value&&(a+="/* Running "+e+" */ if (Shumway.AVM1.Debugger.pause || Shumway.AVM1.Debugger.breakpoints."+e+") { debugger; }\n"),a+="while (!ectx.isEndOfActions) {\nif (checkTimeAfter <= 0) { checkTimeAfter = "+CHECK_AVM1_HANG_EVERY+"; ectx.context.checkTimeout(); }\nswitch(position) {\n",t.forEach(function(t){var i;a+=" case "+t.label+":\n",t.items.forEach(function(t,e){a+=r.convertAction(t,s++,o,e,n,i),i=t}),a+=" position = "+t.jump+";\n checkTimeAfter -= "+t.items.length+";\n break;\n"}),a+=" default: ectx.isEndOfActions = true; break;\n}\n}\nreturn stack.pop();};",a+="//# sourceURL="+e,new Function("calls","res",a)(getActionsCalls(),o)},_1d),Debugger={pause:!1,breakpoints:{}};function _1d(){}function avm1Warn(t,e,i,n,r){if(avm1ErrorsEnabled.value)try{throw new Error(t)}catch(t){}avm1WarningsEnabled.value&&Debug.warning.apply(console,arguments)}var MAX_AVM1_HANG_TIMEOUT=1e3,CHECK_AVM1_HANG_EVERY=1e3,MAX_AVM1_ERRORS_LIMIT=1e3,MAX_AVM1_STACK_LIMIT=256,AVM1ScopeListItemFlags,M2d;M2d=AVM1ScopeListItemFlags=AVM1ScopeListItemFlags||{},M2d[M2d.DEFAULT=0]="DEFAULT",M2d[M2d.TARGET=1]="TARGET",M2d[M2d.REPLACE_TARGET=2]="REPLACE_TARGET";var AVM1ScopeListItem=function(t,e){this.scope=t,this.previousScopeItem=e,this.flags=AVM1ScopeListItemFlags.DEFAULT},GlobalPropertiesScope=(P2d=AVM1Object,__extends(Q2d,P2d),Q2d),AVM1CallFrame=(U2d.prototype.setCallee=function(t,e,i,n){this.calleeThis=t,this.calleeSuper=e,this.calleeFn=i},U2d.prototype.resetCallee=function(){this.calleeThis=null,this.calleeSuper=null,this.calleeFn=null},U2d),AVM1RuntimeUtilsImpl=(c3d.prototype.hasProperty=function(t,e){return as2HasProperty(this._context,t,e)},c3d.prototype.getProperty=function(t,e){return as2GetProperty(this._context,t,e)},c3d.prototype.setProperty=function(t,e,i){return as2SetProperty(this._context,t,e,i)},c3d.prototype.warn=function(t){avm1Warn.apply(null,arguments)},c3d),AVM1ContextImpl=(m3d=AVM1Context,__extends(n3d,m3d),n3d.prototype._getExecutionContext=function(){return this.frame.ectx},n3d.prototype.resolveTarget=function(t){return avm1ResolveTarget(this._getExecutionContext(),t,!0)},n3d.prototype.resolveRoot=function(){return avm1ResolveRoot(this._getExecutionContext())},n3d.prototype.checkTimeout=function(){Date.now(),this.abortExecutionAt},n3d.prototype.pushCallFrame=function(t,e,i,n){var r=new AVM1CallFrame(this.frame,t,e,i,n);return this.frame=r},n3d.prototype.popCallFrame=function(){var t=this.frame.previousFrame;return this.frame=t},n3d.prototype.executeActions=function(t,e){if(!this.executionProhibited){var i,n=this.isActive;n||(this.isActive=!0,this.abortExecutionAt=avm1TimeoutDisabled.value?Number.MAX_VALUE:Date.now()+MAX_AVM1_HANG_TIMEOUT,this.errorsIgnored=0);try{executeActionsData(this,t,e)}catch(t){i=t}this.isActive=n,i&&console.error("error in framescripts",i)}},n3d.prototype.executeFunction=function(t,e,i){if(!this.executionProhibited){var n,r,o=this.isActive;o||(this.isActive=!0,this.abortExecutionAt=avm1TimeoutDisabled.value?Number.MAX_VALUE:Date.now()+MAX_AVM1_HANG_TIMEOUT,this.errorsIgnored=0);try{r=t.alCall(e,i)}catch(t){n=t}if(this.isActive=o,n)throw n;return r}},n3d),m3d,P2d;function n3d(t){var e=m3d.call(this,t)||this;return e.globals=AVM1Globals.createGlobalsObject(e),e.actions=new AVM1NativeActions(e),e.initialScope=new AVM1ScopeListItem(e.globals,null),e.utils=new AVM1RuntimeUtilsImpl(e),e.isActive=!1,e.executionProhibited=!1,e.actionTracer=avm1TraceEnabled.value?new ActionTracer:null,e.abortExecutionAt=0,e.stackDepth=0,e.frame=null,e.isTryCatchListening=!1,e.errorsIgnored=0,e.deferScriptExecution=!0,e}function c3d(t){this._context=t}function U2d(t,e,i,n,r){this.previousFrame=t,this.currentThis=e,this.fn=i,this.args=n,this.ectx=r,this.inSequence=!!t&&t.calleeThis===e&&t.calleeFn===i,this.resetCallee()}function Q2d(t,e){var i=P2d.call(this,t)||this;return i.alSetOwnProperty("this",new AVM1PropertyDescriptor(71,e)),i.alSetOwnProperty("_global",new AVM1PropertyDescriptor(71,t.globals)),i}AVM1Context.create=function(t){return new AVM1ContextImpl(t)};var AVM1Error=function(t){this.error=t},AVM1CriticalError=(J3d=Error,__extends(K3d,J3d),K3d),J3d;function K3d(t,e){var i=J3d.call(this,t)||this;return i.error=e,i}function isAVM1MovieClip(t){return"object"==typeof t&&t&&t instanceof AVM1MovieClip}function as2GetType(t){if(null===t)return"null";if("object"==typeof t){if(t instanceof AVM1MovieClip)return"movieclip";if(t instanceof AVM1Function)return"function"}return typeof t}function as2ToAddPrimitive(t,e){return alToPrimitive(t,e)}function as2Compare(t,e,i){var n=alToPrimitive(t,e),r=alToPrimitive(t,i);if("string"==typeof n&&"string"==typeof r)return alToString(t,n)=MAX_AVM1_STACK_LIMIT)throw new AVM1CriticalError("long running script -- AVM1 recursion limit is reached");try{y=interpretActionsData(a,A)}catch(t){b=t}if(i.stackDepth--,i.popCallFrame(),a.dispose(),b)throw b;return y}},K5d),J5d,F5d,h5d,c5d;function K5d(t,e,i,n,r,o,s,a){var l=J5d.call(this,t)||this;l.functionName=n,l.actionsData=i,l.parametersNames=r,l.registersAllocation=s,l.suppressArguments=a,l.scopeList=e.scopeList,l.constantPool=e.constantPool;for(var c=null,h=s?s.length:0,u=0;ue?(avm1Warn("Truncating amount of arguments: from "+t+" to "+e),e):t}function avm1ReadFunctionArgs(t){for(var e=fixArgsCount(e=+t.pop(),t.length),i=[],n=0;n=i.length?r.push(void 0):r.push(i[e]):r.push(t)})}function avm1_0x17_ActionPop(t){t.stack.pop()}function avm1_0x0A_ActionAdd(t){var e=t.stack,i=alToNumber(t.context,e.pop()),n=alToNumber(t.context,e.pop());t.isSwfVersion7||(void 0===i&&(i=0),void 0===n&&(n=0)),isFinite(i)&&isFinite(n)?e.push(Number(big(Number(i)).add(big(Number(n))))):isNaN(i)||isNaN(n)?e.push(NaN):i===n?e.push(1/0):isFinite(i)||isFinite(n)?isFinite(i)?isFinite(n)||e.push(n):e.push(i):e.push(NaN)}function avm1_0x0B_ActionSubtract(t){var e=t.stack,i=alToNumber(t.context,e.pop()),n=alToNumber(t.context,e.pop());t.isSwfVersion7||(void 0===i&&(i=0),void 0===n&&(n=0)),isFinite(i)&&isFinite(n)?e.push(Number(big(Number(n)).sub(big(Number(i))))):isNaN(i)||isNaN(n)||i===n?e.push(NaN):isFinite(i)?isFinite(n)||e.push(n):e.push(-1/0)}function avm1_0x0C_ActionMultiply(t){var e=t.stack,i=alToNumber(t.context,e.pop()),n=alToNumber(t.context,e.pop());t.isSwfVersion7||(void 0===i&&(i=0),void 0===n&&(n=0)),isFinite(i)&&isFinite(n)?e.push(Number(big(Number(i)).mul(big(Number(n))))):isNaN(i)||isNaN(n)?e.push(NaN):i===n?e.push(1/0):isFinite(i)||isFinite(n)?isFinite(i)?isFinite(n)||e.push(n):e.push(i):e.push(-1/0)}function avm1_0x0D_ActionDivide(t){var e=t.stack,i=t.isSwfVersion5,n=alToNumber(t.context,e.pop()),r=alToNumber(t.context,e.pop());t.isSwfVersion7||(void 0===n&&(n=0),void 0===r&&(r=0)),!isFinite(n)||!isFinite(r)||0==n&&0==r?0==n&&0==r||!isFinite(n)&&!isFinite(r)?e.push(NaN):0==n?e.push(r):0==r?e.push(0):isFinite(r)?isFinite(n)||e.push(0):e.push(r):0==n?e.push(i?"#ERROR#":0>1),n=alNewObject(t.context),r=0;r>i)}function avm1_0x65_ActionBitURShift(t){var e=t.stack,i=alToInt32(t.context,e.pop()),n=alToInt32(t.context,e.pop());e.push(n>>>i)}function avm1_0x62_ActionBitXor(t){var e=t.stack,i=alToInt32(t.context,e.pop()),n=alToInt32(t.context,e.pop());e.push(n^i)}function avm1_0x51_ActionDecrement(t){var e=t.stack,i=alToNumber(t.context,e.pop());i--,e.push(i)}function avm1_0x50_ActionIncrement(t){var e=t.stack,i=alToNumber(t.context,e.pop());i++,e.push(i)}function avm1_0x4C_ActionPushDuplicate(t){var e=t.stack;e.push(e[e.length-1])}function avm1_0x3E_ActionReturn(t){t.isEndOfActions=!0}function avm1_0x4D_ActionStackSwap(t){var e=t.stack;e.push(e.pop(),e.pop())}function avm1_0x87_ActionStoreRegister(t,e){var i=t.stack,n=t.registers,r=e[0];r<0||r>=n.length||(n[r]=i[i.length-1])}function avm1_0x54_ActionInstanceOf(t){var e=t.stack,i=e.pop(),n=e.pop();e.push(as2InstanceOf(n,i))}function avm1_0x55_ActionEnumerate2(t){var e=t.stack,i=e.pop();e.push(null),isNullOrUndefined$1(i)?avm1Warn("AVM1 warning: cannot iterate over undefined object"):as2Enumerate(i,function(t){e.push(t)},null)}function avm1_0x66_ActionStrictEquals(t){var e=t.stack,i=e.pop(),n=e.pop();e.push(n===i)}function avm1_0x67_ActionGreater(t){var e=t.stack,i=e.pop(),n=e.pop();e.push(as2Compare(t.context,i,n))}function avm1_0x68_ActionStringGreater(t){var e=t.stack,i=t.isSwfVersion5,n=alToString(t.context,e.pop()),r=alToString(t.context,e.pop())>n;e.push(i?r:r?1:0)}function avm1_0x8E_ActionDefineFunction2(t,e){var i=t.stack,n=t.scopeList.scope,r=e[0],o=e[1],s=avm1DefineFunction(t,r,o,e[2],e[3],e[4],e[5]);o?(n.alPut(o,s),as2SyncEvents(t.context,o,n)):i.push(s)}function avm1_0x69_ActionExtends(t){var e=t.stack,i=t.context,n=alToObject(i,e.pop()),r=alToObject(i,e.pop()).alGetPrototypeProperty(),o=n.alGetPrototypeProperty();r.alPrototype=o;var s=new AVM1PropertyDescriptor(65,n);r.alSetOwnProperty("__constructor__",s)}function avm1_0x2B_ActionCastOp(t){var e=t.stack,i=e.pop(),n=e.pop();e.push(as2InstanceOf(i,n)?i:null)}function avm1_0x2C_ActionImplementsOp(t){var e=t.stack,i=e.pop(),n=+e.pop();fixArgsCount(n,e.length);for(var r=[],o=0;o=MAX_AVM1_ERRORS_LIMIT)throw new AVM1CriticalError("long running script -- AVM1 errors limit is reached");console.error("AVM1 error: "+e),t.recoveringFromError=!0}}return n}function analyzeAndCompileActionsData(t,e){var i,n=t.context,r=new ActionsDataParser(e,n.swfVersion),o=new ActionsDataAnalyzer;o.registersLimit=t.registers.length,o.parentResults=e.parent&&e.parent.ir;var s=o.analyze(r);if(e.ir=s,avm1CompilerEnabled.value)try{i=(new ActionsDataCompiler).generate(s),e.compiled=i}catch(t){console.error("Unable to compile AVM1 function: "+t)}}function interpretActionsData(t,e){e.ir||e.compiled||analyzeAndCompileActionsData(t,e);var i=t.context,n=t.scopeList.scope.adaptee;n&&n._deferScriptExecution&&(i.deferScriptExecution=!0),n&&(AVM1MovieClip.currentMCAssetNameSpace=n.assetNamespace);var r=e.compiled;if(r)return r(t);var o=0,s=i.abortExecutionAt;avm1DebuggerEnabled.value&&Debugger.breakpoints[a.dataId];for(var a=e.ir,l=0,c=a.actions[l];c&&!t.isEndOfActions;){if(o++%CHECK_AVM1_HANG_EVERY==0&&Date.now()>=s)throw new AVM1CriticalError("long running script -- AVM1 instruction hang timeout");l=interpretActionWithRecovery(t,c.action)?c.conditionalJumpTo:c.next,c=a.actions[l]}return t.stack.pop()}var ActionTracer=(Wfe.prototype._getIndentString=function(){return this._indentStringCache[this._indentation]||(this._indentStringCache[this._indentation]=new Array(this._indentation+1).join(".."))},Wfe.prototype.print=function(t,e){for(var i=t.position,n=t.actionCode,r=t.actionName,o=[],s=0;s"),t},Wie.prototype.toFlashlogString=function(){var t=this.uri;return t?t+"::"+this.name:this.name},Wie.stripPublicMangledName=function(t){if(0===t.indexOf("$Bg"))return t.substring(3)},Wie.FromSimpleName=function(t){t._children&&1==t._children.length&&t._children[0]._value&&(t=t._children[0]._value);var e=t.lastIndexOf(".");e<=0&&(e=t.lastIndexOf(" "));var i,n="";return 0".'},XMLOnlyWorksWithOneItemLists:{code:1086,message:"The %1 method only works on lists containing one item."},XMLAssignmentToIndexedXMLNotAllowed:{code:1087,message:"Assignment to indexed XML is not allowed."},XMLMarkupMustBeWellFormed:{code:1088,message:"The markup in the document following the root element must be well-formed."},XMLAssigmentOneItemLists:{code:1089,message:"Assignment to lists with more than one item is not supported."},XMLMalformedElement:{code:1090,message:"XML parser failure: element is malformed."},XMLUnterminatedCData:{code:1091,message:"XML parser failure: Unterminated CDATA section."},XMLUnterminatedXMLDecl:{code:1092,message:"XML parser failure: Unterminated XML declaration."},XMLUnterminatedDocTypeDecl:{code:1093,message:"XML parser failure: Unterminated DOCTYPE declaration."},XMLUnterminatedComment:{code:1094,message:"XML parser failure: Unterminated comment."},XMLUnterminatedElement:{code:1096,message:"XML parser failure: Unterminated element."},XMLNamespaceWithPrefixAndNoURI:{code:1098,message:"Illegal prefix %1 for no namespace."},RegExpFlagsArgumentError:{code:1100,message:"Cannot supply flags when constructing one RegExp from another."},InvalidBaseClassError:{code:1108,message:"The OP_newclass opcode was used with the incorrect base class."},XMLInvalidName:{code:1117,message:"Invalid XML name: %1."},XMLIllegalCyclicalLoop:{code:1118,message:"Illegal cyclical loop between nodes."},FilterError:{code:1123,message:"Filter operator not supported on type %1."},OutOfRangeError:{code:1125,message:"The index %1 is out of range %2."},VectorFixedError:{code:1126,message:"Cannot change the length of a fixed Vector."},TypeAppOfNonParamType:{code:1127,message:"Type application attempted on a non-parameterized type."},WrongTypeArgCountError:{code:1128,message:"Incorrect number of type parameters for %1. Expected %2, got %3."},JSONCyclicStructure:{code:1129,message:"Cyclic structure cannot be converted to JSON string."},JSONInvalidReplacer:{code:1131,message:"Replacer argument to JSON stringifier must be an array or a two parameter function."},JSONInvalidParseInput:{code:1132,message:"Invalid JSON parse input."},InvalidRangeError:{code:1506,message:"The specified range is invalid."},NullArgumentError:{code:1507,message:"Argument %1 cannot be null."},InvalidArgumentError:{code:1508,message:"The value specified for argument %1 is invalid."},ArrayFilterNonNullObjectError:{code:1510,message:"When the callback argument is a method of a class, the optional this argument must be null."},InvalidParamError:{code:2004,message:"One of the parameters is invalid."},ParamRangeError:{code:2006,message:"The supplied index is out of bounds."},NullPointerError:{code:2007,message:"Parameter %1 must be non-null."},InvalidEnumError:{code:2008,message:"Parameter %1 must be one of the accepted values."},CantInstantiateError:{code:2012,message:"%1 class cannot be instantiated."},InvalidBitmapData:{code:2015,message:"Invalid BitmapData."},EOFError:{code:2030,message:"End of file was encountered.",fqn:"flash.errors.EOFError"},CompressedDataError:{code:2058,message:"There was an error decompressing the data.",fqn:"flash.errors.IOError"},EmptyStringError:{code:2085,message:"Parameter %1 must be non-empty string."},ProxyGetPropertyError:{code:2088,message:"The Proxy class does not implement getProperty. It must be overridden by a subclass."},ProxySetPropertyError:{code:2089,message:"The Proxy class does not implement setProperty. It must be overridden by a subclass."},ProxyCallPropertyError:{code:2090,message:"The Proxy class does not implement callProperty. It must be overridden by a subclass."},ProxyHasPropertyError:{code:2091,message:"The Proxy class does not implement hasProperty. It must be overridden by a subclass."},ProxyDeletePropertyError:{code:2092,message:"The Proxy class does not implement deleteProperty. It must be overridden by a subclass."},ProxyGetDescendantsError:{code:2093,message:"The Proxy class does not implement getDescendants. It must be overridden by a subclass."},ProxyNextNameIndexError:{code:2105,message:"The Proxy class does not implement nextNameIndex. It must be overridden by a subclass."},ProxyNextNameError:{code:2106,message:"The Proxy class does not implement nextName. It must be overridden by a subclass."},ProxyNextValueError:{code:2107,message:"The Proxy class does not implement nextValue. It must be overridden by a subclass."},TooFewArgumentsError:{code:2001,message:"Too few arguments were specified; got %1, %2 expected."},ParamTypeError:{code:2005,message:"Parameter %1 is of the incorrect type. Should be type %2."},SocketConnectError:{code:2011,message:"Socket connection failed to %1:%2."},CantAddSelfError:{code:2024,message:"An object cannot be added as a child of itself."},NotAChildError:{code:2025,message:"The supplied DisplayObject must be a child of the caller."},UnhandledError:{code:2044,message:"Unhandled %1:."},AllowDomainArgumentError:{code:2052,message:"Only String arguments are permitted for allowDomain and allowInsecureDomain."},DelayRangeError:{code:2066,message:"The Timer delay specified is out of range."},ExternalInterfaceNotAvailableError:{code:2067,message:"The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime."},InvalidLoaderMethodError:{code:2069,message:"The Loader class does not implement this method."},InvalidStageMethodError:{code:2071,message:"The Stage class does not implement this property or method."},TimelineObjectNameSealedError:{code:2078,message:"The name property of a Timeline-placed object cannot be modified."},AlreadyConnectedError:{code:2082,message:"Connect failed because the object is already connected."},CloseNotConnectedError:{code:2083,message:"Close failed because the object is not connected."},ArgumentSizeError:{code:2084,message:"The AMF encoding of the arguments cannot exceed 40K."},AsyncError:{code:2095,message:"%1 was unable to invoke callback %2."},LoadingObjectNotSWFError:{code:2098,message:"The loading object is not a .swf file, you cannot request SWF properties from it."},LoadingObjectNotInitializedError:{code:2099,message:"The loading object is not sufficiently loaded to provide this information."},DecodeParamError:{code:2101,message:"The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs."},SceneNotFoundError:{code:2108,message:"Scene %1 was not found."},FrameLabelNotFoundError:{code:2109,message:"Frame label %1 not found in scene %2."},InvalidLoaderInfoMethodError:{code:2118,message:"The LoaderInfo class does not implement this method."},SecuritySwfNotAllowedError:{code:2121,message:"Security sandbox violation: %1: %2 cannot access %3. This may be worked around by calling Security.allowDomain."},UnknownFileTypeError:{code:2124,message:"Loaded file is an unknown type."},DefinitionNotFoundError:{code:2131,message:"Definition %1 cannot be found."},CantAddParentError:{code:2150,message:"An object cannot be added as a child to one of it's children (or children's children, etc.)."},Matrix3DRefCannontBeShared:{code:2189,message:"A Matrix3D can not be assigned to more than one DisplayObject."},ObjectWithStringsParamError:{code:2196,message:"Parameter %1 must be an Object with only String values."},AllowCodeImportError:{code:3226,message:"Cannot import a SWF file when LoaderContext.allowCodeImport is false."},PermissionDenied:{code:3315,message:"The current security context does not allow this operation."},InternalErrorIV:{code:3343,message:"Internal Error."}};for(var k in Errors$1){var error$1=Errors$1[k];error$1.typeName=k,Errors$1[error$1.code]=error$1}function getErrorMessage(t){var e="Error #"+t;if(!debuggerMode.value)return e;var i=Errors$1[t];return e+": "+(i&&i.message||"(unknown)")}function getErrorInfo(t){return Errors$1[t]}function formatErrorMessage(t){for(var e=[],i=1;i>>0,e=0;e>>0;if(t){var e=this.axGetNumericProperty(t-1);return rn.name=t-1,rn.namespaces=[Namespace.PUBLIC],this.axDeleteProperty(rn),this.axSetPublicProperty("length",t-1),e}this.axSetPublicProperty("length",0)},Xme.prototype.shift=function(){return this.value.shift()},Xme.prototype.generic_shift=function(){return coerceArray(this).shift()},Xme.prototype.unshift=function(){return this.value.unshift.apply(this.value,arguments)},Xme.prototype.generic_unshift=function(){var t=coerceArray(this);return t.value.unshift.apply(t.value,arguments)},Xme.prototype.reverse=function(){return this.value.reverse(),this},Xme.prototype.generic_reverse=function(){return coerceArray(this).reverse()},Xme.prototype.concat=function(){for(var t=this.value.slice(),e=0;e>>0},enumerable:!0,configurable:!0}),Xme.prototype.axGetEnumerableKeys=function(){return Object.keys(this.value).concat(Wme.prototype.axGetEnumerableKeys.call(this))},Xme.prototype.axHasPropertyInternal=function(t){var e=t.name;return"number"==typeof e||isNumeric(e=axCoerceName(e))?e in this.value:!!this.traits.getTrait(t.namespaces,e)||"$Bg"+e in this},Xme.prototype.axHasOwnProperty=function(t){var e=t.name;return"number"==typeof e||isNumeric(e=axCoerceName(e))?this.value.hasOwnProperty(e):!!this.traits.getTrait(t.namespaces,e)||this.hasOwnProperty("$Bg"+e)},Xme.prototype.axGetProperty=function(t){var e,i=t.name;return"number"==typeof i||isNumeric(i=axCoerceName(i))?null!=(e=this.value[i])?e:this[i]:Wme.prototype.axGetProperty.call(this,t)},Xme.prototype.axSetProperty=function(t,e,i){var n=t.name;"number"==typeof n||isNumeric(n=axCoerceName(n))?this.value[n]=e:Wme.prototype.axSetProperty.call(this,t,e,i)},Xme.prototype.axDeleteProperty=function(t){var e=t.name;return"number"==typeof e||isNumeric(e=axCoerceName(e))?delete this.value[e]:!this.traits.getTrait(t.namespaces,e)&&delete this["$Bg"+e]},Xme.prototype.axGetPublicProperty=function(t){return"number"==typeof t||isNumeric(t=axCoerceName(t))?this.value[t]:this["$Bg"+t]},Xme.prototype.axSetPublicProperty=function(t,e){"number"==typeof t||isNumeric(t=axCoerceName(t))?this.value[t]=e:this["$Bg"+t]=e},Xme),ASError=(Voe=ASObject,__extends(Woe,Voe),Woe.throwError=function(t,e){for(var i=[getErrorInfo(e)],n=2;n()",0,2);var e=this.value;if((t=String(t))===e)return 0;for(var i=Math.min(e.length,t.length),n=0;nt.length?1:-1},Pqe.prototype.match=function(t){t=this.sec.AXRegExp.axIsType(t)?t.value:axCoerceString$2(t);var e=this.value.match(t);if(!e)return null;try{return transformJStoASRegExpMatchArray(this.sec,e)}catch(t){return null}},Pqe.prototype.replace=function(t,e){t=this.sec.AXRegExp.axIsType(t)?t.value:axCoerceString$2(t),this.sec.AXFunction.axIsType(e)&&(e=e.value);try{return this.value.replace(t,e)}catch(t){return this.value}},Pqe.prototype.search=function(t){t=this.sec.AXRegExp.axIsType(t)?t.value:axCoerceString$2(t);try{return this.value.search(t)}catch(t){return-1}},Pqe.prototype.slice=function(t,e){return t=arguments.length<1?0:0|t,e=arguments.length<2?4294967295:0|e,this.value.slice(t,e)},Pqe.prototype.split=function(t,e){t=this.sec.AXRegExp.axIsType(t)?t.value:axCoerceString$2(t),e=void 0===e?-1:0|e;try{return this.sec.createArray(this.value.split(t,e))}catch(t){return this.sec.createArrayUnsafe([this.value])}},Pqe.prototype.substring=function(t,e){return this.value.substring(t,e)},Pqe.prototype.substr=function(t,e){return-1==e&&(e=this.value.length-t-1),this.value.substr(t,e)},Pqe.prototype.toLocaleLowerCase=function(){return this.value.toLowerCase()},Pqe.prototype.toLowerCase=function(){return as3ToLowerCase(this.value)},Pqe.prototype.toLocaleUpperCase=function(){return this.value.toUpperCase()},Pqe.prototype.toUpperCase=function(){return this.value.toUpperCase()},Pqe.prototype.generic_indexOf=function(t,e){var i=null==this?"":this;return String.prototype.indexOf.call(i,t,e)},Pqe.prototype.generic_lastIndexOf=function(t,e){var i=null==this?"":this;return String.prototype.lastIndexOf.call(i,t,e)},Pqe.prototype.generic_charAt=function(t){var e=null==this?"":this;return String.prototype.charAt.call(e,t)},Pqe.prototype.generic_charCodeAt=function(t){var e=null==this?"":this;return String.prototype.charCodeAt.call(e,t)},Pqe.prototype.generic_concat=function(){var t=null==this?"":this;return String.prototype.concat.apply(t,arguments)},Pqe.prototype.generic_localeCompare=function(t){var e=this.sec.AXString.axBox(String(this));return e.localeCompare.apply(e,arguments)},Pqe.prototype.generic_match=function(t){return this.sec.AXString.axBox(String(this)).match(t)},Pqe.prototype.generic_replace=function(t,e){return this.sec.AXString.axBox(String(this)).replace(t,e)},Pqe.prototype.generic_search=function(t){return this.sec.AXString.axBox(String(this)).search(t)},Pqe.prototype.generic_slice=function(t,e){var i=null==this?"":this;return String.prototype.slice.call(i,t,e)},Pqe.prototype.generic_split=function(t,e){return e=arguments.length<2?4294967295:0|e,this.sec.AXString.axBox(String(this)).split(t,e)},Pqe.prototype.generic_substring=function(t,e){var i=null==this?"":this;return String.prototype.substring.call(i,t,e)},Pqe.prototype.generic_substr=function(t,e){var i=null==this?"":this;return String.prototype.substr.call(i,t,e)},Pqe.prototype.generic_toLowerCase=function(){return as3ToLowerCase(String(null==this?"":this))},Pqe.prototype.generic_toUpperCase=function(){var t=null==this?"":this;return String.prototype.toUpperCase.call(t)},Pqe.prototype.toString=function(){return this.value.toString()},Pqe.prototype.public_toString=function(){return this===this.sec.AXString.dPrototype?"":(this.axClass!==this.sec.AXString&&this.sec.throwError("TypeError",Errors$1.InvokeOnIncompatibleObjectError,"String.prototype.toString"),this.value.toString())},Pqe.prototype.valueOf=function(){return this.value.valueOf()},Pqe.prototype.public_valueOf=function(){return this===this.sec.AXString.dPrototype?"":(this.axClass!==this.sec.AXString&&this.sec.throwError("TypeError",Errors$1.InvokeOnIncompatibleObjectError,"String.prototype.valueOf"),this.value.valueOf())},Object.defineProperty(Pqe.prototype,"length",{get:function(){return this.value.length},enumerable:!0,configurable:!0}),Pqe.classNatives=[String],Pqe),ASUint=(Sre=ASNumber,__extends(Tre,Sre),Tre.classInitializer=function(){var t=this.dPrototype,e=Tre.prototype;addPrototypeFunctionAlias(t,"$BgtoString",e.toString),addPrototypeFunctionAlias(t,"$BgtoLocaleString",e.toString),addPrototypeFunctionAlias(t,"$BgvalueOf",e.valueOf),defineNonEnumerableProperty(this,"$BgMAX_VALUE",4294967295),defineNonEnumerableProperty(this,"$BgMIN_VALUE",0)},Tre.prototype.toString=function(t){return 0===arguments.length?t=10:((t|=0)<2||36>>=0)>this._buffer.length)for(var e=this._buffer.length;e=this._buffer.length||e!=t)&&this.sec.throwError("RangeError",Errors$1.OutOfRangeError,t,this._buffer.length),this._buffer[e]},use.prototype.axSetNumericProperty=function(t,e){var i=this._buffer.length,n=0|t;(n<0||i>>0;return 0<=i&&i>2;return this._buffer.set(this._view(),i),void(this._offset=i)}var n=1+(3*this._buffer.length>>1);ns;)if(r[a]===t)return a-o;return-1},Eue.prototype.push=function(t,e,i,n,r,o,s,a){this._checkFixed(),this._ensureCapacity(this._length+arguments.length);for(var l=0;l>>=0)>this._length){this._ensureCapacity(t);for(var e=this._offset+this._length,i=this._offset+t;e>>0;return 0<=i&&i>2;return this._buffer.set(this._view(),i),void(this._offset=i)}var n=1+(3*this._buffer.length>>1);ns;)if(r[a]===t)return a-o;return-1},$we.prototype.push=function(t,e,i,n,r,o,s,a){this._checkFixed(),this._ensureCapacity(this._length+arguments.length);for(var l=0;l>>=0)>this._length){this._ensureCapacity(t);for(var e=this._offset+this._length,i=this._offset+t;e>>0;return 0<=i&&i>2;return this._buffer.set(this._view(),i),void(this._offset=i)}var n=1+(3*this._buffer.length>>1);ns;)if(r[a]===t)return a-o;return-1},uze.prototype.push=function(t,e,i,n,r,o,s,a){this._checkFixed(),this._ensureCapacity(this._length+arguments.length);for(var l=0;l>>=0)>this._length){this._ensureCapacity(t);for(var e=this._offset+this._length,i=this._offset+t;e>>0;return 0<=i&&i/.exec(t.substr(o)))return SBe.UNMATCHABLE_PATTERN;var a=RegExp.$1;"length"!==a&&i.push(a),i.indexOf(a),o+=RegExp.lastMatch.length-1}else i.push(null);if(406>>=0,i._fixed=!!e,i._buffer=new Float64Array(Math.max(uze.INITIAL_CAPACITY,t+uze.EXTRA_CAPACITY)),i._offset=0,i._length=t,i}function $we(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=Zwe.call(this)||this;return t>>>=0,i._fixed=!!e,i._buffer=new Uint32Array(Math.max($we.INITIAL_CAPACITY,t+$we.EXTRA_CAPACITY)),i._offset=0,i._length=t,i}function Eue(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=Due.call(this)||this;return t>>>=0,i._fixed=!!e,i._buffer=new Int32Array(Math.max(Eue.INITIAL_CAPACITY,t+Eue.EXTRA_CAPACITY)),i._offset=0,i._length=t,i}function use(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=tse.call(this)||this;return t>>>=0,e=!!e,i._fixed=!!e,i._buffer=new Array(t),i._fill(0,t,i.axClass.defaultValue),i}function rse(){return null!==qse&&qse.apply(this,arguments)||this}function cse(){return null!==bse&&bse.apply(this,arguments)||this}function transformJSValueToAS(t,e,i){if("object"!=typeof e)return e;if(isNullOrUndefined(e))return e;if(Array.isArray(e)){for(var n=[],r=0;r>8&255),t.writeByte(255&i.length);for(var n=0;n>>24&255),i.writeByte(e.length>>16&255),i.writeByte(e.length>>8&255),i.writeByte(255&e.length),forEachPublicProperty(n,function(t,e){writeString(i,t),this.write(i,e)},this)):(i.writeByte(3),forEachPublicProperty(n,function(t,e){writeString(i,t),this.write(i,e)},this)),i.writeByte(0),i.writeByte(0),i.writeByte(9)))}},xGe.read=function(t){var e,i=t.readByte();switch(i){case 0:return readDouble(t);case 1:return!!t.readByte();case 2:return readString(t);case 3:for(var n=t.sec.createObject();(e=readString(t)).length;)n.axSetPublicProperty(e,this.read(t));if(9!==t.readByte())throw"AMF0 End marker is not found";return n;case 5:return null;case 6:return;case 8:for((r=t.sec.createArray([])).length=t.readByte()<<24|t.readByte()<<16|t.readByte()<<8|t.readByte();(e=readString(t)).length;)r.axSetPublicProperty(e,this.read(t));if(9!==t.readByte())throw"AMF0 End marker is not found";return r;case 10:for(var r,o=(r=t.sec.createArray([])).length=t.readByte()<<24|t.readByte()<<16|t.readByte()<<8|t.readByte(),s=0;s>7&127),t.writeByte(127&e)):0==(4292870144&e)?(t.writeByte(128|e>>14&127),t.writeByte(128|e>>7&127),t.writeByte(127&e)):(t.writeByte(128|e>>22&127),t.writeByte(128|e>>15&127),t.writeByte(128|e>>8&127),t.writeByte(255&e))}function readUTF8(t,e){var i=readU29(t);if(1===i)return"";var n=e.strings;if(0==(1&i))return n[i>>1];for(var r=i>>1,o=new Uint8Array(r),s=0;s>1];if(0!=(4&o))throw"AMF3 Traits-Ext is not supported";var s,a=!0;if(0==(2&o))n=e.traits[o>>2],s=e.traitNames[o>>2];else{var l=readUTF8(t,e);l&&(n=i=t.sec.classAliases.getClassByAlias(l)),a=0!=(8&o),s=[];for(var c=0,h=o>>4;c>1];var d=t.sec.createArray([]);e.objects.push(d);for(var _,f=o>>1;;){if(!(_=readUTF8(t,e)).length)break;p=readAMF3Value(t,e),d.axSetPublicProperty(_,p)}for(c=0;c>>=0,this._defaultObjectEncoding=t},enumerable:!0,configurable:!0}),cIe.prototype.toJSON=function(){return"ByteArray"},cIe.prototype.readObject=function(){switch(this._objectEncoding){case ObjectEncoding.AMF0:return AMF0.read(this);case ObjectEncoding.AMF3:return AMF3.read(this);default:unexpected("Object Encoding")}},cIe.prototype.writeObject=function(t){switch(this._objectEncoding){case ObjectEncoding.AMF0:return AMF0.write(this,t);case ObjectEncoding.AMF3:return AMF3.write(this,t);default:unexpected("Object Encoding")}},cIe.prototype.axGetPublicProperty=function(t){return"number"==typeof t||isNumeric(t=axCoerceName(t))?this.axGetNumericProperty(t):this["$Bg"+t]},cIe.prototype.axGetNumericProperty=function(t){return this.getValue(t)},cIe.prototype.axSetPublicProperty=function(t,e){"number"==typeof t||isNumeric(t=axCoerceName(t))?this.axSetNumericProperty(t,e):this["$Bg"+t]=e},cIe.prototype.axSetNumericProperty=function(t,e){this.setValue(t,e)},cIe.prototype.axGetProperty=function(t){var e=t.name;return"number"==typeof e||isNumeric(e=axCoerceName(e))?this.getValue(+e):bIe.prototype.axGetProperty.call(this,t)},cIe.prototype.axSetProperty=function(t,e,i){var n=t.name;"number"==typeof n||isNumeric(n=axCoerceName(n))?this.setValue(+n,e):bIe.prototype.axSetProperty.call(this,t,e,i)},cIe.classNatives=[DataBuffer],cIe.instanceNatives=[DataBuffer.prototype],cIe.INITIAL_SIZE=128,cIe._defaultObjectEncoding=ObjectEncoding.DEFAULT,cIe),IME=(xIe=ASObject,__extends(yIe,xIe),Object.defineProperty(yIe,"enabled",{get:function(){return!1},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(yIe,"conversionMode",{get:function(){return"UNKNOWN"},set:function(t){},enumerable:!0,configurable:!0}),yIe.setCompositionString=function(t){},yIe.doConversion=function(){},yIe.compositionSelectionChanged=function(t,e){},yIe.compositionAbandoned=function(){},Object.defineProperty(yIe,"isSupported",{get:function(){return!1},enumerable:!0,configurable:!0}),yIe),System=(EIe=ASObject,__extends(FIe,EIe),FIe.classInitializer=function(){defineNonEnumerableProperty(this,"$Bgargv",this.sec.createArray([]))},Object.defineProperty(FIe,"ime",{get:function(){return null},enumerable:!0,configurable:!0}),FIe.setClipboard=function(t){t=axCoerceString$2(t),null!==ClipboardService&&ClipboardService.setClipboard(t)},Object.defineProperty(FIe,"totalMemoryNumber",{get:function(){return 2097152},enumerable:!0,configurable:!0}),Object.defineProperty(FIe,"freeMemory",{get:function(){return 1048576},enumerable:!0,configurable:!0}),Object.defineProperty(FIe,"privateMemory",{get:function(){return 1048576},enumerable:!0,configurable:!0}),Object.defineProperty(FIe,"useCodePage",{get:function(){return this._useCodePage},set:function(t){this._useCodePage=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(FIe,"vmVersion",{get:function(){return"1.0 Shumway - Mozilla Research"},enumerable:!0,configurable:!0}),FIe.pause=function(){},FIe.resume=function(){},FIe.exit=function(t){},FIe.gc=function(){},FIe.pauseForGCIfCollectionImminent=function(t){},FIe.disposeXML=function(t){},Object.defineProperty(FIe,"swfVersion",{get:function(){return 19},enumerable:!0,configurable:!0}),Object.defineProperty(FIe,"apiVersion",{get:function(){return 26},enumerable:!0,configurable:!0}),FIe.getArgv=function(){return[]},FIe.getRunmode=function(){return"mixed"},FIe._useCodePage=!1,FIe),OriginalSystem=System,EIe,xIe,bIe,$He;function FIe(){return null!==EIe&&EIe.apply(this,arguments)||this}function yIe(){return xIe.call(this)||this}function cIe(t){var e=bIe.call(this)||this;ByteArrayDataProvider.symbolForConstructor&&(t=ByteArrayDataProvider.symbolForConstructor,ByteArrayDataProvider.symbolForConstructor=null);var i,n,r=0;return t?(t instanceof ArrayBuffer?n=t.slice(0):Array.isArray(t)?n=new Uint8Array(t).buffer:"buffer"in t?n=t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer).buffer:t.buffer instanceof Uint8Array?(i=t.buffer.byteOffset,t.buffer.buffer.slice(i,i+t.buffer.length)):t.buffer.slice():unexpected("Source type."),r=n.byteLength):n=new ArrayBuffer(cIe.INITIAL_SIZE),e._buffer=n,e._length=r,e._position=0,e._resetViews(),e._objectEncoding=cIe.defaultObjectEncoding,e._littleEndian=!1,e._bitBuffer=0,e._bitLength=0,e}function _He(){return null!==$He&&$He.apply(this,arguments)||this}function initSystem(){initializeBuiltins()}var builtinNativeClasses=ObjectUtilities.createMap(),nativeClasses=ObjectUtilities.createMap(),nativeClassLoaderNames=[];function getCurrentScope(){return 0===scopeStacks.length?null:scopeStacks[scopeStacks.length-1].topScope()}function isXMLType(t,e){return"object"==typeof t&&t&&(t.axClass===e.AXXML||t.axClass===e.AXXMLList||t.axClass===e.AXQName||t.axClass===e.AXNamespace)}function isXMLCollection(t,e){return"object"==typeof e&&e&&(e.axClass===t.AXXML||e.axClass===t.AXXMLList)}function toString(t,e){if(!t||t.axClass!==e.AXXML)return axCoerceString$2(t);switch(t._kind){case 3:case 2:return t._value;default:if(t.hasSimpleContent()){for(var i="",n=0;n"!==i;)n++;if(n>=e.length)return e;for(var r=e.substring(0,n);n":r+=">";break;default:r+=i}return r}function escapeAttributeValue(t){t=String(t);for(var e,i=0;i=t.length)return t;for(var n=t.substring(0,i);i=t.length)return"";for(var i=t.length-1;isWhitespace(t,i);)i--;return 0===e&&i===t.length-1?t:t.substring(e,i+1)}var indentStringCache=[];function getIndentString(t){if(0'+t+"",e.sec)._children;if(i)for(var n=0;n";case"amp":return"&";case"quot":return'"'}return t})},WJe.prototype.parseContent=function(t,e){var i,n=e,r=[];function o(){for(;n"!==t[n]&&"/"!==t[n];)++n;for(i=t.substring(e,n),o();n"!==t[n]&&"/"!==t[n]&&"?"!==t[n];){o();for(var s,a="";n"!==t[n]&&"/"!==t[n];)++n;i=t.substring(e,n),function(){for(;n"!=t[n+1]);)++n;return{name:i,value:t.substring(r,n),parsed:n-e}},WJe.prototype.parseXml=function(t){for(var e=0;e",n))<0)return void this.onError(-9);this.onEndElement(t.substring(n,i)),n=i+1;break;case"?":++n;var r=this.parseProcessingInstruction(t,n);if("?>"!=t.substring(n+r.parsed,n+r.parsed+2))return void this.onError(-3);this.onPi(r.name,r.value),n+=r.parsed+2;break;case"!":if("--"===t.substring(n+1,n+3)){if((i=t.indexOf("--\x3e",n+3))<0)return void this.onError(-5);this.onComment(t.substring(n+3,i)),n=i+3}else if("[CDATA["===t.substring(n+1,n+8)){if((i=t.indexOf("]]>",n+8))<0)return void this.onError(-2);this.onCdata(t.substring(n+8,i)),n=i+3}else{if("DOCTYPE"!==t.substring(n+1,n+8))return void this.onError(-6);var o=t.indexOf("[",n+8),s=!1;if((i=t.indexOf(">",n+8))<0)return void this.onError(-4);if(0",n+8))<0)return void this.onError(-4);s=!0}var a=t.substring(n+8,i+(s?1:0));this.onDoctype(a),n=i+(s?2:1)}break;default:var l=this.parseContent(t,n);if(null===l)return void this.onError(-6);var c=!1;if("/>"===t.substring(n+l.parsed,n+l.parsed+2))c=!0;else if(">"!==t.substring(n+l.parsed,n+l.parsed+1))return void this.onError(-9);this.onBeginElement(l.name,l.attributes,c),n+=l.parsed+(c?2:1)}else{do{}while(n++i.length&&(t=i.length),e&&e.axClass===this.axClass&&2!==e._kind){if(1===e._kind)for(var n=this;n;)n===e&&this.sec.throwError("Error",Errors$1.XMLIllegalCyclicalLoop),n=n._parent;e._parent=this,i[t]&&(i[t]._parent=null),i[t]=e}else if(e&&e.axClass===this.sec.AXXMLList)if(0===e._children.length)this.deleteByIndex(t);else{var r=e._children.length;if(t"}r=r||[];for(var s=[],n=0;this._inScopeNamespaces&&n"},NMe.prototype.toJSON=function(t){return"XML"},NMe.prototype.axGetEnumerableKeys=function(){if(this===this.axClass.dPrototype)return MMe.prototype.axGetEnumerableKeys.call(this);for(var t=[],e=0;e>>0||n.throwError("TypeError",Errors$1.XMLAssignmentToIndexedXMLNotAllowed),3!==this._kind&&4!==this._kind&&5!==this._kind&&2!==this._kind)if(i=isXMLType(e,n)&&3!==e._kind&&2!==e._kind?e._deepCopy():toString(e,n),t.isAttribute()){if(i&&i.axClass===n.AXXMLList)if(0===i._children.length)i="";else{for(var r=toString(i._children[0],n),o=1;o>>0)!==String(t))throw"TypeError in XML.prototype.deleteByIndex(): invalid index "+t;var e=this._children;t=this._children.length||this.removeByIndex(i),!0;for(var i=0;i>>=0,this._type=t},enumerable:!0,configurable:!0}),Object.defineProperty(uUe.prototype,"empty",{get:function(){return this._empty},set:function(t){t=!!t,this._empty=t},enumerable:!0,configurable:!0}),Object.defineProperty(uUe.prototype,"value",{get:function(){return this._value},set:function(t){t=axCoerceString$2(t),this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(uUe.prototype,"attrs",{get:function(){return this._attrs},set:function(t){this._attrs=t},enumerable:!0,configurable:!0}),uUe),XMLNodeType$1=(AUe=ASObject,__extends(BUe,AUe),BUe),AUe,tUe,qUe,gUe;function BUe(){return AUe.call(this)||this}function uUe(){var t=tUe.call(this)||this;return t._type=0,t._value=null,t._empty=!1,t._attrs=null,t}function rUe(t){return qUe.call(this,1,"")||this}function hUe(t,e){return gUe.call(this)||this}function isWhitespace$1(t){for(var e=0;e "+this.object+" "+this.isWith},oVe.prototype.init=function(t,e,i){void 0===i&&(i=!1),this.parent=t,this.object=e,this.global=t?t.global:this,this.isWith=i,this.cache=[],this.defaultNamespace=null,e.__scope__=this},Object.defineProperty(oVe.prototype,"superConstructor",{get:function(){var t=this.object.superClass;if(!t)return null;var e=t[IS_AX_CLASS]?t.tPrototype.axInitializer:t;return Object.defineProperty(this,"superConstructor",{value:e}),e},enumerable:!0,configurable:!0}),oVe.prototype.extend=function(t){if(t===this.object)return this;var e=t.__scope__;return e&&e.parent==this?e:new oVe(this,t,!1)},oVe.prototype.findDepth=function(t){for(var e=this,i=0;e;){if(e.object===t)return i;i++,e=e.parent}return-1},oVe.prototype.getScopeObjects=function(){for(var t=[],e=this;e;)t.unshift(e.object),e=e.parent;return t},oVe.prototype.getScopeProperty=function(t,e,i){return this.findScopeProperty(t,e,i).axGetProperty(t)},oVe.prototype.findScopeProperty=function(t,e,i){if(t.mutable||i)return this._findScopeProperty(t,e,i);if(t.scope===this.object)return t.value;var n=this._findScopeProperty(t,e,i);return t.value=n,t.scope=this.object,n},oVe.prototype._findScopeProperty=function(t,e,i){if(null===t.name&&this.global.object.sec.throwError("ReferenceError",Errors$1.UndefinedVarError,"*"),n=this.cache[t.id])return n;if(this.object&&this.object[IS_AX_CLASS]&&(this.isWith?this.object.axHasPropertyInternal(t):this.object.traits.getTrait(t.namespaces,t.name)))return this.isWith||t.isRuntime()?this.object:this.cache[t.id]=this.object;if(this.parent){var n=this.parent.findScopeProperty(t,e,i);return 7===t.kind&&(this.cache[t.id]=n),n}if(i)return null;t.isAttribute()&&this.object.sec.throwError("ReferenceError",Errors$1.UndefinedVarError,t.name);var r=this.global.object;return(n=r.applicationDomain.findProperty(t,e,!0))?n:(e&&(t.getPublicMangledName()in r||this.global.object.sec.throwError("ReferenceError",Errors$1.UndefinedVarError,t.name)),r)},oVe.ID=0,oVe);function oVe(t,e,i){void 0===i&&(i=!1),oVe.ID++,this[IS_AX_CLASS]=!0,this.init(t,e,i)}function safeGetPrototypeOf(t){var e=t.axClass;if(!e||e===e.sec.AXObject)return null;var i=e.dPrototype;return i===t&&(i=e.superClass.dPrototype),i}var HasNext2Info=(TVe.prototype.next=function(t,e){if(isNullOrUndefined$1(t))return this.index=0,void(this.object=null);this.object=t,this.index=e;var i=t.axNextNameIndex(this.index);if(0>>0},sWe.u30=function(t,e){return sWe.u32(t,e)},sWe.s32Length=function(t,e){var i=t[e];return 128&i?16384&(i=127&i|t[e+1]<<7)?2097152&(i=16383&i|t[e+2]<<14)?268435456&(i=2097151&i|t[e+3]<<21)?5:4:3:2:1},sWe);function sWe(){}function lengthAt(t,e){var i=1,n=t[e];if(27===n){i+=3;var r=Bytes.u30(t,e+i)+1;return(i+=Bytes.s32Length(t,e+i))+3*r}var o=BytecodeFormat[n];if(""===o)return i;assert(o,"OP: "+getBytecodeName(n));for(var s=0;s "+(this.stack+this.delta)+", "+this.scope+" -> "+(this.scope+this.deltaScope)+", "+this.terminal+", ["+this.refs+"])"},JXe),CXe;function JXe(t,e,i,n,r,o,s){void 0===i&&(i=[]),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=!1),void 0===s&&(s=[]),this.position=t,this.name=e,this.params=i,this.delta=n,this.deltaScope=r,this.terminal=o,this.refs=s,this.stack=DEFAULT_STACK_INDEX,this.scope=DEFAULT_STACK_INDEX,this.catchStart=!1,this.catchEnd=!1,this.returnTypeId=-1,this.childs=[]}function DXe(t,e,i,n){var r=CXe.call(this,t,e,i)||this;return r.methodInfo=n,r.method=null,r}function wXe(t,e,i){this.abc=t,this.kind=e,this.name=i,this.metadata=null,this.holder=null}function propagateStack(t,e,i){for(var n=e,r=i.length,o=0;o=t){if(0<=i[o].stack)return;i[o].stack=n,n+=i[o].delta;for(var s=0;s=t){if(0<=i[o].scope)return;i[o].scope=n,n+=i[o].deltaScope;for(var s=0;s=Bytecode.IFNLT&&s.name<=Bytecode.LOOKUPSWITCH&&n.push(s)}for(var a=0,l=n;a>>0}function t(){var t=i(),e=B.getMultiname(t);return e.isRuntimeName()||e.isRuntimeNamespace()?[t,256,e.isRuntimeName()&&e.isRuntimeNamespace()?-2:-1]:[t,0,0]}function n(){return(N[e++]|N[e++]<<8|N[e++]<<16)<<8>>8}function r(){return N[e++]<<24>>24}var o,s,a,l,c,h,u,p,d,_,f,m,g,y,b,v,x,A=e,S=N[e++],w=void 0;switch(S){case Bytecode.LABEL:w=new Instruction(A,S);break;case Bytecode.DXNSLATE:w=new Instruction(A,S,[0],-1);break;case Bytecode.DEBUGFILE:case Bytecode.DEBUGLINE:w=new Instruction(A,S,[i()]);break;case Bytecode.DEBUG:w=new Instruction(A,S,[r(),i(),r(),i()]);break;case Bytecode.THROW:w=new Instruction(A,S,[],-1,0,!0);break;case Bytecode.PUSHSCOPE:(w=new Instruction(A,S,[],-1,1)).returnTypeId=k=++V;break;case Bytecode.PUSHWITH:w=new Instruction(A,S,[],-1,1);break;case Bytecode.POPSCOPE:w=new Instruction(A,S,[],0,-1);break;case Bytecode.GETSCOPEOBJECT:(w=new Instruction(A,S,[r()],1,0)).returnTypeId=k=++V;break;case Bytecode.GETGLOBALSCOPE:(w=new Instruction(A,S,[],1)).returnTypeId=k=++V;break;case Bytecode.GETSLOT:(w=new Instruction(A,S,[i()],0)).returnTypeId=k=++V;break;case Bytecode.SETSLOT:w=new Instruction(A,S,[i()],-2);break;case Bytecode.NEXTNAME:case Bytecode.NEXTVALUE:(w=new Instruction(A,S,[],-1)).returnTypeId=k=++V;break;case Bytecode.HASNEXT:(w=new Instruction(A,S,[],-1)).returnTypeId=k=-2;break;case Bytecode.HASNEXT2:(w=new Instruction(A,S,[i(),i()],1)).returnTypeId=k=-2;break;case Bytecode.IN:(w=new Instruction(A,S,[],-1)).returnTypeId=k=-2;break;case Bytecode.DUP:(w=new Instruction(A,S,[],1)).returnTypeId=k=V;break;case Bytecode.POP:(w=new Instruction(A,S,[],-1)).returnTypeId=k=V;break;case Bytecode.SWAP:w=new Instruction(A,S,[],0);break;case Bytecode.PUSHTRUE:case Bytecode.PUSHFALSE:(w=new Instruction(A,S,[],1)).returnTypeId=k=-2;break;case Bytecode.PUSHBYTE:(w=new Instruction(A,S,[r()],1)).returnTypeId=k=-3;break;case Bytecode.PUSHSHORT:(w=new Instruction(A,S,[i()<<16>>16],1)).returnTypeId=k=-3;break;case Bytecode.PUSHINT:case Bytecode.PUSHUINT:case Bytecode.PUSHDOUBLE:(w=new Instruction(A,S,[i()],1)).returnTypeId=k=-3;break;case Bytecode.PUSHNAN:(w=new Instruction(A,S,[],1)).returnTypeId=k=-3;break;case Bytecode.PUSHNULL:(w=new Instruction(A,S,[],1)).returnTypeId=k=-6;break;case Bytecode.PUSHUNDEFINED:(w=new Instruction(A,S,[],1)).returnTypeId=k=-5;break;case Bytecode.PUSHSTRING:(w=new Instruction(A,S,[i()],1)).returnTypeId=k=-4;break;case Bytecode.IFEQ:case Bytecode.IFNE:case Bytecode.IFSTRICTEQ:case Bytecode.IFSTRICTNE:M=n(),w=new Instruction(A,S,[e+M],-2,0,!1,[e+M]);break;case Bytecode.IFGT:case Bytecode.IFNLE:M=n(),w=new Instruction(A,Bytecode.IFGT,[e+M],-2,0,!1,[e+M]);break;case Bytecode.IFGE:case Bytecode.IFNLT:M=n(),w=new Instruction(A,Bytecode.IFGE,[e+M],-2,0,!1,[e+M]);break;case Bytecode.IFLT:case Bytecode.IFNGE:M=n(),w=new Instruction(A,Bytecode.IFLT,[e+M],-2,0,!1,[e+M]);break;case Bytecode.IFLE:case Bytecode.IFNGT:M=n(),w=new Instruction(A,Bytecode.IFLE,[e+M],-2,0,!1,[e+M]);break;case Bytecode.IFTRUE:case Bytecode.IFFALSE:M=n(),w=new Instruction(A,S,[e+M],-1,0,!1,[e+M]);break;case Bytecode.LOOKUPSWITCH:P=A+n(),E=i(),T=[P];for(var C=0;C<=E;C++)T.push(A+n());w=new Instruction(A,S,T,-1,0,!0,T);break;case Bytecode.JUMP:M=n(),w=new Instruction(A,S,[e+M],0,0,!0,[e+M]);break;case Bytecode.RETURNVALUE:w=new Instruction(A,S,[],-1,0,!0);break;case Bytecode.RETURNVOID:w=new Instruction(A,S,[],0,0,!0);break;case Bytecode.NOT:(w=new Instruction(A,S,[],0)).returnTypeId=k=-2;break;case Bytecode.BITNOT:case Bytecode.NEGATE:case Bytecode.INCREMENT:case Bytecode.DECREMENT:(w=new Instruction(A,S,[],0)).returnTypeId=k=-3;break;case Bytecode.INCLOCAL:case Bytecode.DECLOCAL:(w=new Instruction(A,S,[i()],0)).returnTypeId=k=-3;break;case Bytecode.INCREMENT_I:case Bytecode.DECREMENT_I:(w=new Instruction(A,S,[],0)).returnTypeId=k=-3;break;case Bytecode.INCLOCAL_I:case Bytecode.DECLOCAL_I:(w=new Instruction(A,S,[i()],0)).returnTypeId=k=-3;break;case Bytecode.NEGATE_I:(w=new Instruction(A,S,[],0)).returnTypeId=k=-3;break;case Bytecode.ADD_I:case Bytecode.SUBTRACT_I:case Bytecode.MULTIPLY_I:case Bytecode.ADD:case Bytecode.SUBTRACT:case Bytecode.MULTIPLY:case Bytecode.DIVIDE:case Bytecode.MODULO:case Bytecode.LSHIFT:case Bytecode.RSHIFT:case Bytecode.URSHIFT:case Bytecode.BITAND:case Bytecode.BITOR:case Bytecode.BITXOR:(w=new Instruction(A,S,[],-1)).returnTypeId=k=-3;break;case Bytecode.EQUALS:case Bytecode.STRICTEQUALS:case Bytecode.GREATERTHAN:case Bytecode.GREATEREQUALS:case Bytecode.LESSTHAN:case Bytecode.LESSEQUALS:(w=new Instruction(A,S,[],-1)).returnTypeId=k=-2;break;case Bytecode.TYPEOF:(w=new Instruction(A,S,[],0)).returnTypeId=k=++V;break;case Bytecode.INSTANCEOF:(w=new Instruction(A,S,[],-1)).returnTypeId=k=-2;break;case Bytecode.ISTYPE:o=t(),I=o[0],O=o[1],L=o[2],(w=new Instruction(A,S,[I],0+L)).returnTypeId=k=-2;break;case Bytecode.ISTYPELATE:(w=new Instruction(A,S,[],-1)).returnTypeId=k=-2;break;case Bytecode.ASTYPELATE:w=new Instruction(A,S,[],-1);break;case Bytecode.ASTYPE:s=t(),I=s[0],O=s[1],L=s[2],w=new Instruction(A,S,[I],0+L);break;case Bytecode.CALL:D=i(),w=new Instruction(A,S,[D],-D-1);break;case Bytecode.CONSTRUCT:D=i(),(w=new Instruction(A,S,[D,I],-D)).returnTypeId=k=++V;break;case Bytecode.CALLPROPERTY:a=t(),I=a[0],O=a[1],L=a[2],D=i(),(w=new Instruction(A,S+O,[D,I],-D+L)).returnTypeId=k=++V;break;case Bytecode.CALLPROPLEX:l=t(),I=l[0],O=l[1],L=l[2],D=i(),(w=new Instruction(A,S+O,[D,I],-D+L)).returnTypeId=k=++V;break;case Bytecode.CALLPROPVOID:c=t(),I=c[0],O=c[1],L=c[2],D=i(),w=new Instruction(A,S+O,[D,I],-(D+1)+L);break;case Bytecode.APPLYTYPE:D=i(),(w=new Instruction(A,S,[D],-D)).returnTypeId=k=V;break;case Bytecode.FINDPROPSTRICT:h=t(),I=h[0],O=h[1],L=h[2],(w=new Instruction(A,S+O,[I],1+L)).returnTypeId=k=++V;break;case Bytecode.FINDPROPERTY:u=t(),I=u[0],O=u[1],L=u[2],(w=new Instruction(A,S+O,[I],1+L)).returnTypeId=k=++V;break;case Bytecode.NEWFUNCTION:(w=new Instruction(A,S,[i()],1)).returnTypeId=k=++V;break;case Bytecode.NEWCLASS:(w=new Instruction(A,S,[i()],0)).returnTypeId=k=++V;break;case Bytecode.NEWARRAY:D=i(),(w=new Instruction(A,S,[D],1-D)).returnTypeId=k=++V;break;case Bytecode.NEWOBJECT:D=i(),(w=new Instruction(A,S,[D],-2*D+1)).returnTypeId=k=++V;break;case Bytecode.NEWACTIVATION:(w=new Instruction(A,S,[],1)).returnTypeId=k=++V;break;case Bytecode.NEWCATCH:w=new Instruction(A,S,[i()],1);break;case Bytecode.CONSTRUCTSUPER:D=i(),w=new Instruction(A,S,[D],-(D+1));break;case Bytecode.CALLSUPER:p=t(),I=p[0],O=p[1],L=p[2],D=i(),w=new Instruction(A,S+O,[D,I],-D+L);break;case Bytecode.CALLSUPERVOID:d=t(),I=d[0],O=d[1],L=d[2],D=i(),w=new Instruction(A,S+O,[D,I],-(D+1)+L);break;case Bytecode.CONSTRUCTPROP:_=t(),I=_[0],O=_[1],L=_[2],D=i(),(w=new Instruction(A,S+O,[D,I],-D+L)).returnTypeId=k=++V;break;case Bytecode.GETPROPERTY:f=t(),I=f[0],O=f[1],L=f[2],(w=new Instruction(A,Bytecode.GETPROPERTY+O,[I],0+L)).returnTypeId=k=++V;break;case Bytecode.INITPROPERTY:case Bytecode.SETPROPERTY:m=t(),I=m[0],O=m[1],L=m[2],w=new Instruction(A,Bytecode.SETPROPERTY+O,[I],-2+L);break;case Bytecode.DELETEPROPERTY:g=t(),I=g[0],O=g[1],L=g[2],w=new Instruction(A,S+O,[I],0+L);break;case Bytecode.GETSUPER:y=t(),I=y[0],O=y[1],L=y[2],(w=new Instruction(A,S+O,[I],0+L)).returnTypeId=k=++V;break;case Bytecode.SETSUPER:b=t(),I=b[0],O=b[1],L=b[2],w=new Instruction(A,S+O,[I],-2+L);break;case Bytecode.COERCE:v=t(),I=v[0],O=v[1],L=v[2],(w=new Instruction(A,S+O,[I],0+L)).returnTypeId=k;break;case Bytecode.COERCE_A:(w=new Instruction(A,S,[],0)).returnTypeId=k;break;case Bytecode.COERCE_S:(w=new Instruction(A,S,[],0)).returnTypeId=-4;break;case Bytecode.CONVERT_I:case Bytecode.CONVERT_D:case Bytecode.CONVERT_B:case Bytecode.CONVERT_U:case Bytecode.CONVERT_S:case Bytecode.CONVERT_O:case Bytecode.CHECKFILTER:w=new Instruction(A,S,[],0);break;case Bytecode.GETLOCAL:(w=new Instruction(A,Bytecode.GETLOCAL,[i()],1)).returnTypeId=k;break;case Bytecode.GETLOCAL0:(w=new Instruction(A,Bytecode.GETLOCAL,[0],1)).returnTypeId=k;break;case Bytecode.GETLOCAL1:(w=new Instruction(A,Bytecode.GETLOCAL,[1],1)).returnTypeId=k;break;case Bytecode.GETLOCAL2:(w=new Instruction(A,Bytecode.GETLOCAL,[2],1)).returnTypeId=k;break;case Bytecode.GETLOCAL3:(w=new Instruction(A,Bytecode.GETLOCAL,[3],1)).returnTypeId=k;break;case Bytecode.SETLOCAL:(w=new Instruction(A,Bytecode.SETLOCAL,[i()],-1)).returnTypeId=k;break;case Bytecode.SETLOCAL0:(w=new Instruction(A,Bytecode.SETLOCAL,[0],-1)).returnTypeId=k;break;case Bytecode.SETLOCAL1:(w=new Instruction(A,Bytecode.SETLOCAL,[1],-1)).returnTypeId=k;break;case Bytecode.SETLOCAL2:(w=new Instruction(A,Bytecode.SETLOCAL,[2],-1)).returnTypeId=k;break;case Bytecode.SETLOCAL3:(w=new Instruction(A,Bytecode.SETLOCAL,[3],-1)).returnTypeId=k;break;case Bytecode.KILL:w=new Instruction(A,S,[i()],0);break;case Bytecode.GETLEX:x=t(),I=x[0],O=x[1],L=x[2],(w=new Instruction(A,S+O,[I],1+L)).returnTypeId=k=++V;break;case Bytecode.SI8:case Bytecode.SI16:case Bytecode.SI32:case Bytecode.SF32:case Bytecode.SF64:w=new Instruction(A,S,[],-2);break;case Bytecode.LI8:case Bytecode.LI16:case Bytecode.LI32:case Bytecode.LF32:case Bytecode.LF64:(w=new Instruction(A,S,[],0)).returnTypeId=k=-3;break;default:return{value:{error:"UNKNOWN BYTECODE "+N[e-1].toString(16)+" "+BytecodeName[N[e-1]]+" at "+A}}}R.push(w),F=e}(i),i=F;if("object"==typeof n)return n.value}propagateStack(0,0,R),propagateScope(0,0,R);var r,o,s=[0];for(i=0;ic.start){u=l;break}h=R[_].stack,d=R[_].scope}for(_=R.length-1;0<=_;_--){if((l=R[_].position)<=c.end){p=l;break}}r[u]||(r[u]=[]),r[u].push(c),o[p]||(o[p]=[]),o[p].push(c),propagateStack(c.target,h+1,R),propagateScope(c.target,d,R),s.push(c.target)}return propogateTree(R,s),{set:R,jumps:s,catchStart:r,catchEnd:o,error:void 0}}var TinyConstructor=(tZe.prototype.test=function(t){if(!t.isConstructor)return!1;if(0e?e:i.minCompileTime,i.maxCompileTime=i.minCompileTimei.maxCompilerBatchTime?this._taskBathTime:i.maxCompilerBatchTime,this._lastCompilerStop=t,this._currentTask=null)},KZe.reset=function(){Object.assign(this.statRecords,{compiled:0,droped:0,minCompileTime:Number.MAX_VALUE,maxCompileTime:-Number.MAX_VALUE,totalCompileTime:-0,maxCompilerTaskTime:-Number.MAX_VALUE,overhead:0}),this._currentTask=null,this._taskBathTime=0},KZe.TASK_DELAY=10,KZe.statRecords={runs:0,drops:0,minCompileTime:Number.MAX_VALUE,maxCompileTime:-Number.MAX_VALUE,totalCompileTime:-0,maxCompilerBatchTime:-Number.MAX_VALUE,overhead:0},KZe._firstCompilerRun=-1,KZe._lastCompilerStop=-1,KZe._taskBathTime=0,KZe),GZe;function KZe(){}function HZe(){return null!==GZe&&GZe.apply(this,arguments)||this}function yZe(){this._block=null,this._used=!1,this._needSafe=!1}function tZe(){}window.AWAY_COMPILER_STAT=Stat;var b2Mat22=(QZe.prototype.Set=function(t){var e=Math.cos(t),i=Math.sin(t);this.col1.x=e,this.col2.x=-i,this.col1.y=i,this.col2.y=e},QZe.prototype.SetVV=function(t,e){this.col1.SetV(t),this.col2.SetV(e)},QZe.prototype.Copy=function(){return new QZe(0,this.col1,this.col2)},QZe.prototype.SetM=function(t){this.col1.SetV(t.col1),this.col2.SetV(t.col2)},QZe.prototype.AddM=function(t){this.col1.x+=t.col1.x,this.col1.y+=t.col1.y,this.col2.x+=t.col2.x,this.col2.y+=t.col2.y},QZe.prototype.SetIdentity=function(){this.col1.x=1,this.col2.x=0,this.col1.y=0,this.col2.y=1},QZe.prototype.SetZero=function(){this.col1.x=0,this.col2.x=0,this.col1.y=0,this.col2.y=0},QZe.prototype.GetAngle=function(){return Math.atan2(this.col1.y,this.col1.x)},QZe.prototype.Invert=function(t){var e=this.col1.x,i=this.col2.x,n=this.col1.y,r=this.col2.y,o=1/(e*r-i*n);return t.col1.x=o*r,t.col2.x=-o*i,t.col1.y=-o*n,t.col2.y=o*e,t},QZe.prototype.Solve=function(t,e,i){var n=this.col1.x,r=this.col2.x,o=this.col1.y,s=this.col2.y,a=1/(n*s-r*o);return t.x=a*(s*e-r*i),t.y=a*(n*i-o*e),t},QZe.prototype.Abs=function(){this.col1.Abs(),this.col2.Abs()},QZe),b2Sweep=(p$e.prototype.GetXForm=function(t,e){var i,n;1-this.t0>Number.MIN_VALUE?(i=(e-this.t0)/(1-this.t0),t.position.x=(1-i)*this.c0.x+i*this.c.x,t.position.y=(1-i)*this.c0.y+i*this.c.y,n=(1-i)*this.a0+i*this.a,t.R.Set(n)):(t.position.SetV(this.c),t.R.Set(this.a));var r=t.R;t.position.x-=r.col1.x*this.localCenter.x+r.col2.x*this.localCenter.y,t.position.y-=r.col1.y*this.localCenter.x+r.col2.y*this.localCenter.y},p$e.prototype.Advance=function(t){var e;this.t0Number.MIN_VALUE&&(e=(t-this.t0)/(1-this.t0),this.c0.x=(1-e)*this.c0.x+e*this.c.x,this.c0.y=(1-e)*this.c0.y+e*this.c.y,this.a0=(1-e)*this.a0+e*this.a,this.t0=t)},p$e),b2Vec2=(x$e.prototype.SetZero=function(){this.x=0,this.y=0},x$e.prototype.Set=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},x$e.prototype.SetV=function(t){this.x=t.x,this.y=t.y},x$e.prototype.Negative=function(){return new x$e(-this.x,-this.y)},x$e.Make=function(t,e){return new x$e(t,e)},x$e.prototype.Copy=function(){return new x$e(this.x,this.y)},x$e.prototype.Add=function(t){this.x+=t.x,this.y+=t.y},x$e.prototype.Subtract=function(t){this.x-=t.x,this.y-=t.y},x$e.prototype.Multiply=function(t){this.x*=t,this.y*=t},x$e.prototype.MulM=function(t){var e=this.x;this.x=t.col1.x*e+t.col2.x*this.y,this.y=t.col1.y*e+t.col2.y*this.y},x$e.prototype.MulTM=function(t){var e=b2Math.b2Dot(this,t.col1);this.y=b2Math.b2Dot(this,t.col2),this.x=e},x$e.prototype.CrossVF=function(t){var e=this.x;this.x=t*this.y,this.y=-t*e},x$e.prototype.CrossFV=function(t){var e=this.x;this.x=-t*this.y,this.y=t*e},x$e.prototype.MinV=function(t){this.x=this.xt.x?this.x:t.x,this.y=this.y>t.y?this.y:t.y},x$e.prototype.Abs=function(){this.x<0&&(this.x=-this.x),this.y<0&&(this.y=-this.y)},x$e.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},x$e.prototype.LengthSquared=function(){return this.x*this.x+this.y*this.y},x$e.prototype.Normalize=function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);if(t>1&2147483647,t|=t>>2&1073741823,t|=t>>4&268435455,t|=t>>8&16777215,1+(t|=t>>16&65535)},$$e.b2IsPowerOfTwo=function(t){return 0r.upperBound.x?n.upperBound.x:r.upperBound.x,n.upperBound.y>r.upperBound.y?n.upperBound.y:r.upperBound.y)},h2e.prototype.ComputeMass=function(t){for(var e=0,i=0,n=0,r=0,o=0;othis.m_sweepRadius&&(this.m_sweepRadius=n)}},h2e.ComputeCentroid=function(t,e){for(var i=new b2Vec2,n=0,r=0;r>12&1048575,i+=i<<2&4294967292,i^=i>>4&268435455,(i*=2057)^i>>16&65535},L4e.Equals=function(t,e,i){return t.proxyId1==e&&t.proxyId2==i},L4e.EqualsPair=function(t,e){return t.proxyId1==e.proxyId1&&t.proxyId2==e.proxyId2},L4e),b2BroadPhase=(I5e.prototype.InRange=function(t){var e,i,n=t.lowerBound.x,r=t.lowerBound.y;return n-=this.m_worldAABB.upperBound.x,r-=this.m_worldAABB.upperBound.y,e=this.m_worldAABB.lowerBound.x,i=this.m_worldAABB.lowerBound.y,e-=t.upperBound.x,i-=t.upperBound.y,n=b2Math.b2Max(n,e),r=b2Math.b2Max(r,i),b2Math.b2Max(n,r)<0},I5e.prototype.GetProxy=function(t){var e=this.m_proxyPool[t];return t==b2Pair.b2_nullProxy||0==e.IsValid()?null:e},I5e.prototype.CreateProxy=function(t,e){var i,n=this.m_freeProxy,r=this.m_proxyPool[n];this.m_freeProxy=r.GetNext(),r.overlapCount=0,r.userData=e;var o=2*this.m_proxyCount,s=[],a=[];this.ComputeBounds(s,a,t);for(var l=0;l<2;++l){var c=this.m_bounds[l],h=0,u=0,p=[h],d=[u];this.Query(p,d,s[l],a[l],c,o,l),h=p[0];for(var _,f,m,g=[],y=o-(u=d[0]),b=0;b>>0&b2Settings.USHRT_MAX-1,e[0]=this.m_quantizationFactor.x*(o-this.m_worldAABB.lowerBound.x)>>>0&65535|1,t[1]=this.m_quantizationFactor.y*(r-this.m_worldAABB.lowerBound.y)>>>0&b2Settings.USHRT_MAX-1,e[1]=this.m_quantizationFactor.y*(s-this.m_worldAABB.lowerBound.y)>>>0&65535|1},I5e.prototype.TestOverlapValidate=function(t,e){for(var i=0;i<2;++i){var n=this.m_bounds[i],r=n[t.lowerBounds[i]],o=n[e.upperBounds[i]];if(r.value>o.value)return!1;if(r=n[t.upperBounds[i]],o=n[e.lowerBounds[i]],r.valuer.value)return!1;if(r=n[e.lowerBounds[i]],t.upperValues[i]i)r=o-1;else{if(!(s.value>>0;n=1+o}}return n>>>0},I5e.s_validate=!1,I5e.b2_invalid=b2Settings.USHRT_MAX,I5e.b2_nullEdge=b2Settings.USHRT_MAX,I5e),Features=(Object.defineProperty(i8e.prototype,"referenceEdge",{get:function(){return this._referenceEdge},set:function(t){this._referenceEdge=t,this._m_id._key=4294967040&this._m_id._key|255&this._referenceEdge},enumerable:!0,configurable:!0}),Object.defineProperty(i8e.prototype,"incidentEdge",{get:function(){return this._incidentEdge},set:function(t){this._incidentEdge=t,this._m_id._key=4294902015&this._m_id._key|this._incidentEdge<<8&65280},enumerable:!0,configurable:!0}),Object.defineProperty(i8e.prototype,"incidentVertex",{get:function(){return this._incidentVertex},set:function(t){this._incidentVertex=t,this._m_id._key=4278255615&this._m_id._key|this._incidentVertex<<16&16711680},enumerable:!0,configurable:!0}),Object.defineProperty(i8e.prototype,"flip",{get:function(){return this._flip},set:function(t){this._flip=t,this._m_id._key=16777215&this._m_id._key|this._flip<<24&4278190080},enumerable:!0,configurable:!0}),i8e),b2ContactID=(n8e.prototype.Set=function(t){this.key=t._key},n8e.prototype.Copy=function(){var t=new n8e;return t.key=this.key,t},Object.defineProperty(n8e.prototype,"key",{get:function(){return this._key},set:function(t){this._key=t,this.features._referenceEdge=255&this._key,this.features._incidentEdge=(65280&this._key)>>8&255,this.features._incidentVertex=(16711680&this._key)>>16&255,this.features._flip=(4278190080&this._key)>>24&255},enumerable:!0,configurable:!0}),n8e),ClipVertex=function(){this.v=new b2Vec2,this.id=new b2ContactID},b2Collision=(r8e.ClipSegmentToLine=function(t,e,i,n){var r,o,s,a,l=0,c=(r=e[0]).v,h=(r=e[1]).v,u=b2Math.b2Dot(i,c)-n,p=b2Math.b2Dot(i,h)-n;return u<=0&&(t[l++]=e[0]),p<=0&&(t[l++]=e[1]),u*p<0&&(s=u/(u-p),(a=(r=t[l]).v).x=c.x+s*(h.x-c.x),a.y=c.y+s*(h.y-c.y),r=t[l],o=0Number.MIN_VALUE*Number.MIN_VALUE?(p/=y=Math.sqrt(p*p+d*d),d/=y,t.x=l+f*p,t.y=c+f*d):(t.x=l,t.y=c),e.x=t.x,e.y=t.y,0},Ubf.DistancePC=function(t,e,i,n,r,o){var s=this.gPoint,a=r.m_localPosition,l=o.R;s.p.x=o.position.x+(l.col1.x*a.x+l.col2.x*a.y),s.p.y=o.position.y+(l.col1.y*a.x+l.col2.y*a.y);var c,h,u,p=this.DistanceGeneric(t,e,i,n,s,b2Math.b2XForm_identity),d=r.m_radius-b2Settings.b2_toiSlop;return d2*b2Settings.b2_toiSlop?1.5*b2Settings.b2_toiSlop:(r=.05*b2Settings.b2_toiSlop)>(o=x-.5*b2Settings.b2_toiSlop)?r:o),x-A<.05*b2Settings.b2_toiSlop||20==y)break;b=g.x-m.x,v=g.y-m.y;var P=Math.sqrt(b*b+v*v),E=(b/=P)*(c-u)+(v/=P)*(h-p)+(d<0?-d:d)*s+(_<0?-_:_)*a;if(0==E){f=1;break}var T=f+(x-A)/E;if(T<0||1>>0,this._g=255*b2Math.b2Clamp(e,0,1)>>>0,this._b=255*b2Math.b2Clamp(i,0,1)>>>0},Object.defineProperty(vff.prototype,"r",{set:function(t){this._r=255*b2Math.b2Clamp(t,0,1)>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(vff.prototype,"g",{set:function(t){this._g=255*b2Math.b2Clamp(t,0,1)>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(vff.prototype,"b",{set:function(t){this._b=255*b2Math.b2Clamp(t,0,1)>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(vff.prototype,"color",{get:function(){return this._r|this._g<<8|this._b<<16},enumerable:!0,configurable:!0}),vff),b2ContactEdge=function(){},b2Contact=(Fff.prototype.GetManifolds=function(){return null},Fff.prototype.GetManifoldCount=function(){return this.m_manifoldCount},Fff.prototype.IsSolid=function(){return 0==(this.m_flags&Fff.e_nonSolidFlag)},Fff.prototype.GetNext=function(){return this.m_next},Fff.prototype.GetShape1=function(){return this.m_shape1},Fff.prototype.GetShape2=function(){return this.m_shape2},Fff.AddType=function(t,e,i,n){Fff.s_registers[i][n].createFcn=t,Fff.s_registers[i][n].destroyFcn=e,Fff.s_registers[i][n].primary=!0,i!=n&&(Fff.s_registers[n][i].createFcn=t,Fff.s_registers[n][i].destroyFcn=e,Fff.s_registers[n][i].primary=!1)},Fff.prototype.Update=function(t){var e=this.m_manifoldCount;this.Evaluate(t);var i=this.m_manifoldCount,n=this.m_shape1.m_body,r=this.m_shape2.m_body;0==i&&0=-1.5*b2Settings.b2_linearSlop},kgf),b2NullContact=(Mif=b2Contact,__extends(Nif,Mif),Nif.prototype.b2NullContact=function(){},Nif.prototype.Evaluate=function(t){},Nif.prototype.GetManifolds=function(){return null},Nif),b2PolyAndCircleContact=(Pif=b2Contact,__extends(Qif,Pif),Qif.Create=function(t,e,i){return new Qif(t,e)},Qif.Destroy=function(t,e){},Qif.prototype.Evaluate=function(t){var e,i,n,r,o=this.m_shape1.m_body,s=this.m_shape2.m_body;this.m0.Set(this.m_manifold),b2Collision.b2CollidePolygonAndCircle(this.m_manifold,this.m_shape1,o.m_xf,this.m_shape2,s.m_xf);var a=[!1,!1],l=Qif.s_evalCP;if(l.shape1=this.m_shape1,l.shape2=this.m_shape2,l.friction=this.m_friction,l.restitution=this.m_restitution,0this.m_maxForce&&this.m_impulse.Multiply(this.m_maxForce/d),c=this.m_impulse.x-u,h=this.m_impulse.y-p;var _=t.dt*c,f=t.dt*h;i.m_linearVelocity.x+=i.m_invMass*_,i.m_linearVelocity.y+=i.m_invMass*f,i.m_angularVelocity+=i.m_invI*(r*f-o*_)},Zkf.prototype.SolvePositionConstraints=function(){return!0},Zkf),b2MouseJointDef=(Ilf=b2JointDef,__extends(Jlf,Ilf),Jlf),b2PrismaticJoint=(Llf=b2Joint,__extends(Mlf,Llf),Mlf.prototype.GetAnchor1=function(){return this.m_body1.GetWorldPoint(this.m_localAnchor1)},Mlf.prototype.GetAnchor2=function(){return this.m_body2.GetWorldPoint(this.m_localAnchor2)},Mlf.prototype.GetReactionForce=function(){var t=this.m_body1.m_xf.R,e=this.m_limitForce*(t.col1.x*this.m_localXAxis1.x+t.col2.x*this.m_localXAxis1.y),i=this.m_limitForce*(t.col1.y*this.m_localXAxis1.x+t.col2.y*this.m_localXAxis1.y),n=this.m_force*(t.col1.x*this.m_localYAxis1.x+t.col2.x*this.m_localYAxis1.y),r=this.m_force*(t.col1.y*this.m_localYAxis1.x+t.col2.y*this.m_localYAxis1.y);return new b2Vec2(this.m_limitForce*e+this.m_force*n,this.m_limitForce*i+this.m_force*r)},Mlf.prototype.GetReactionTorque=function(){return this.m_torque},Mlf.prototype.GetJointTranslation=function(){var t=this.m_body1,e=this.m_body2,i=t.GetWorldPoint(this.m_localAnchor1),n=e.GetWorldPoint(this.m_localAnchor2),r=n.x-i.x,o=n.y-i.y,s=t.GetWorldVector(this.m_localXAxis1);return s.x*r+s.y*o},Mlf.prototype.GetJointSpeed=function(){var t=this.m_body1,e=this.m_body2,i=t.m_xf.R,n=this.m_localAnchor1.x-t.m_sweep.localCenter.x,r=this.m_localAnchor1.y-t.m_sweep.localCenter.y,o=i.col1.x*n+i.col2.x*r,r=i.col1.y*n+i.col2.y*r,n=o;i=e.m_xf.R;var s=this.m_localAnchor2.x-e.m_sweep.localCenter.x,a=this.m_localAnchor2.y-e.m_sweep.localCenter.y,o=i.col1.x*s+i.col2.x*a,a=i.col1.y*s+i.col2.y*a,s=o,l=t.m_sweep.c.x+n,c=t.m_sweep.c.y+r,h=e.m_sweep.c.x+s-l,u=e.m_sweep.c.y+a-c,p=t.GetWorldVector(this.m_localXAxis1),d=t.m_linearVelocity,_=e.m_linearVelocity,f=t.m_angularVelocity,m=e.m_angularVelocity;return h*(-f*p.y)+u*(f*p.x)+(p.x*(_.x+-m*a-d.x- -f*r)+p.y*(_.y+m*s-d.y-f*n))},Mlf.prototype.IsLimitEnabled=function(){return this.m_enableLimit},Mlf.prototype.EnableLimit=function(t){this.m_enableLimit=t},Mlf.prototype.GetLowerLimit=function(){return this.m_lowerTranslation},Mlf.prototype.GetUpperLimit=function(){return this.m_upperTranslation},Mlf.prototype.SetLimits=function(t,e){this.m_lowerTranslation=t,this.m_upperTranslation=e},Mlf.prototype.IsMotorEnabled=function(){return this.m_enableMotor},Mlf.prototype.EnableMotor=function(t){this.m_enableMotor=t},Mlf.prototype.SetMotorSpeed=function(t){this.m_motorSpeed=t},Mlf.prototype.GetMotorSpeed=function(){return this.m_motorSpeed},Mlf.prototype.SetMaxMotorForce=function(t){this.m_maxMotorForce=t},Mlf.prototype.GetMotorForce=function(){return this.m_motorForce},Mlf.prototype.InitVelocityConstraints=function(t){var e=this.m_body1,i=this.m_body2,n=e.m_xf.R,r=this.m_localAnchor1.x-e.m_sweep.localCenter.x,o=this.m_localAnchor1.y-e.m_sweep.localCenter.y,s=n.col1.x*r+n.col2.x*o,o=n.col1.y*r+n.col2.y*o,r=s;n=i.m_xf.R;var a=this.m_localAnchor2.x-i.m_sweep.localCenter.x,l=this.m_localAnchor2.y-i.m_sweep.localCenter.y;s=n.col1.x*a+n.col2.x*l,l=n.col1.y*a+n.col2.y*l,a=s;var c,h,u,p,d,_,f,m,g,y=e.m_invMass,b=i.m_invMass,v=e.m_invI,x=i.m_invI,A=(n=e.m_xf.R).col1.x*this.m_localYAxis1.x+n.col2.x*this.m_localYAxis1.y,S=n.col1.y*this.m_localYAxis1.x+n.col2.y*this.m_localYAxis1.y,w=i.m_sweep.c.x+a-e.m_sweep.c.x,C=i.m_sweep.c.y+l-e.m_sweep.c.y;this.m_linearJacobian.linear1.x=-A,this.m_linearJacobian.linear1.y=-S,this.m_linearJacobian.linear2.x=A,this.m_linearJacobian.linear2.y=S,this.m_linearJacobian.angular1=-(w*S-C*A),this.m_linearJacobian.angular2=a*S-l*A,this.m_linearMass=y+v*this.m_linearJacobian.angular1*this.m_linearJacobian.angular1+b+x*this.m_linearJacobian.angular2*this.m_linearJacobian.angular2,this.m_linearMass=1/this.m_linearMass,this.m_angularMass=v+x,this.m_angularMass>Number.MIN_VALUE&&(this.m_angularMass=1/this.m_angularMass),(this.m_enableLimit||this.m_enableMotor)&&(c=(n=e.m_xf.R).col1.x*this.m_localXAxis1.x+n.col2.x*this.m_localXAxis1.y,h=n.col1.y*this.m_localXAxis1.x+n.col2.y*this.m_localXAxis1.y,this.m_motorJacobian.linear1.x=-c,this.m_motorJacobian.linear1.y=-h,this.m_motorJacobian.linear2.x=c,this.m_motorJacobian.linear2.y=h,this.m_motorJacobian.angular1=-(w*h-C*c),this.m_motorJacobian.angular2=a*h-l*c,this.m_motorMass=y+v*this.m_motorJacobian.angular1*this.m_motorJacobian.angular1+b+x*this.m_motorJacobian.angular2*this.m_motorJacobian.angular2,this.m_motorMass=1/this.m_motorMass,this.m_enableLimit&&(u=c*(w-r)+h*(C-o),b2Math.b2Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings.b2_linearSlop?this.m_limitState=Mlf.e_equalLimits:u<=this.m_lowerTranslation?(this.m_limitState!=Mlf.e_atLowerLimit&&(this.m_limitForce=0),this.m_limitState=Mlf.e_atLowerLimit):u>=this.m_upperTranslation?(this.m_limitState!=Mlf.e_atUpperLimit&&(this.m_limitForce=0),this.m_limitState=Mlf.e_atUpperLimit):(this.m_limitState=Mlf.e_inactiveLimit,this.m_limitForce=0))),0==this.m_enableMotor&&(this.m_motorForce=0),0==this.m_enableLimit&&(this.m_limitForce=0),t.warmStarting?(p=t.dt*(this.m_force*this.m_linearJacobian.linear1.x+(this.m_motorForce+this.m_limitForce)*this.m_motorJacobian.linear1.x),d=t.dt*(this.m_force*this.m_linearJacobian.linear1.y+(this.m_motorForce+this.m_limitForce)*this.m_motorJacobian.linear1.y),_=t.dt*(this.m_force*this.m_linearJacobian.linear2.x+(this.m_motorForce+this.m_limitForce)*this.m_motorJacobian.linear2.x),f=t.dt*(this.m_force*this.m_linearJacobian.linear2.y+(this.m_motorForce+this.m_limitForce)*this.m_motorJacobian.linear2.y),m=t.dt*(this.m_force*this.m_linearJacobian.angular1-this.m_torque+(this.m_motorForce+this.m_limitForce)*this.m_motorJacobian.angular1),g=t.dt*(this.m_force*this.m_linearJacobian.angular2+this.m_torque+(this.m_motorForce+this.m_limitForce)*this.m_motorJacobian.angular2),e.m_linearVelocity.x+=y*p,e.m_linearVelocity.y+=y*d,e.m_angularVelocity+=v*m,i.m_linearVelocity.x+=b*_,i.m_linearVelocity.y+=b*f,i.m_angularVelocity+=x*g):(this.m_force=0,this.m_torque=0,this.m_limitForce=0,this.m_motorForce=0),this.m_limitPositionImpulse=0},Mlf.prototype.SolveVelocityConstraints=function(t){var e,i=this.m_body1,n=this.m_body2,r=i.m_invMass,o=n.m_invMass,s=i.m_invI,a=n.m_invI,l=this.m_linearJacobian.Compute(i.m_linearVelocity,i.m_angularVelocity,n.m_linearVelocity,n.m_angularVelocity),c=-t.inv_dt*this.m_linearMass*l;this.m_force+=c;var h=t.dt*c;i.m_linearVelocity.x+=r*h*this.m_linearJacobian.linear1.x,i.m_linearVelocity.y+=r*h*this.m_linearJacobian.linear1.y,i.m_angularVelocity+=s*h*this.m_linearJacobian.angular1,n.m_linearVelocity.x+=o*h*this.m_linearJacobian.linear2.x,n.m_linearVelocity.y+=o*h*this.m_linearJacobian.linear2.y,n.m_angularVelocity+=a*h*this.m_linearJacobian.angular2;var u=n.m_angularVelocity-i.m_angularVelocity,p=-t.inv_dt*this.m_angularMass*u;this.m_torque+=p;var d,_,f,m,g,y=t.dt*p;i.m_angularVelocity-=s*y,n.m_angularVelocity+=a*y,this.m_enableMotor&&this.m_limitState!=Mlf.e_equalLimits&&(d=this.m_motorJacobian.Compute(i.m_linearVelocity,i.m_angularVelocity,n.m_linearVelocity,n.m_angularVelocity)-this.m_motorSpeed,_=-t.inv_dt*this.m_motorMass*d,f=this.m_motorForce,this.m_motorForce=b2Math.b2Clamp(this.m_motorForce+_,-this.m_maxMotorForce,this.m_maxMotorForce),_=this.m_motorForce-f,h=t.dt*_,i.m_linearVelocity.x+=r*h*this.m_motorJacobian.linear1.x,i.m_linearVelocity.y+=r*h*this.m_motorJacobian.linear1.y,i.m_angularVelocity+=s*h*this.m_motorJacobian.angular1,n.m_linearVelocity.x+=o*h*this.m_motorJacobian.linear2.x,n.m_linearVelocity.y+=o*h*this.m_motorJacobian.linear2.y,n.m_angularVelocity+=a*h*this.m_motorJacobian.angular2),this.m_enableLimit&&this.m_limitState!=Mlf.e_inactiveLimit&&(m=this.m_motorJacobian.Compute(i.m_linearVelocity,i.m_angularVelocity,n.m_linearVelocity,n.m_angularVelocity),g=-t.inv_dt*this.m_motorMass*m,this.m_limitState==Mlf.e_equalLimits?this.m_limitForce+=g:this.m_limitState==Mlf.e_atLowerLimit?(e=this.m_limitForce,this.m_limitForce=b2Math.b2Max(this.m_limitForce+g,0),g=this.m_limitForce-e):this.m_limitState==Mlf.e_atUpperLimit&&(e=this.m_limitForce,this.m_limitForce=b2Math.b2Min(this.m_limitForce+g,0),g=this.m_limitForce-e),h=t.dt*g,i.m_linearVelocity.x+=r*h*this.m_motorJacobian.linear1.x,i.m_linearVelocity.y+=r*h*this.m_motorJacobian.linear1.y,i.m_angularVelocity+=s*h*this.m_motorJacobian.angular1,n.m_linearVelocity.x+=o*h*this.m_motorJacobian.linear2.x,n.m_linearVelocity.y+=o*h*this.m_motorJacobian.linear2.y,n.m_angularVelocity+=a*h*this.m_motorJacobian.angular2)},Mlf.prototype.SolvePositionConstraints=function(){var t,e,i=this.m_body1,n=this.m_body2,r=i.m_invMass,o=n.m_invMass,s=i.m_invI,a=n.m_invI,l=i.m_xf.R,c=this.m_localAnchor1.x-i.m_sweep.localCenter.x,h=this.m_localAnchor1.y-i.m_sweep.localCenter.y,u=l.col1.x*c+l.col2.x*h,h=l.col1.y*c+l.col2.y*h,c=u;l=n.m_xf.R;var p=this.m_localAnchor2.x-n.m_sweep.localCenter.x,d=this.m_localAnchor2.y-n.m_sweep.localCenter.y;u=l.col1.x*p+l.col2.x*d,d=l.col1.y*p+l.col2.y*d,p=u;var _=i.m_sweep.c.x+c,f=i.m_sweep.c.y+h,m=n.m_sweep.c.x+p-_,g=n.m_sweep.c.y+d-f,y=((l=i.m_xf.R).col1.x*this.m_localYAxis1.x+l.col2.x*this.m_localYAxis1.y)*m+(l.col1.y*this.m_localYAxis1.x+l.col2.y*this.m_localYAxis1.y)*g,y=b2Math.b2Clamp(y,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection),b=-this.m_linearMass*y;i.m_sweep.c.x+=r*b*this.m_linearJacobian.linear1.x,i.m_sweep.c.y+=r*b*this.m_linearJacobian.linear1.y,i.m_sweep.a+=s*b*this.m_linearJacobian.angular1,n.m_sweep.c.x+=o*b*this.m_linearJacobian.linear2.x,n.m_sweep.c.y+=o*b*this.m_linearJacobian.linear2.y,n.m_sweep.a+=a*b*this.m_linearJacobian.angular2;var v=b2Math.b2Abs(y),x=n.m_sweep.a-i.m_sweep.a-this.m_refAngle,x=b2Math.b2Clamp(x,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection),A=-this.m_angularMass*x;i.m_sweep.a-=i.m_invI*A,n.m_sweep.a+=n.m_invI*A,i.SynchronizeTransform(),n.SynchronizeTransform();var S,w,C=b2Math.b2Abs(x);return this.m_enableLimit&&this.m_limitState!=Mlf.e_inactiveLimit&&(l=i.m_xf.R,c=this.m_localAnchor1.x-i.m_sweep.localCenter.x,h=this.m_localAnchor1.y-i.m_sweep.localCenter.y,u=l.col1.x*c+l.col2.x*h,h=l.col1.y*c+l.col2.y*h,c=u,l=n.m_xf.R,p=this.m_localAnchor2.x-n.m_sweep.localCenter.x,d=this.m_localAnchor2.y-n.m_sweep.localCenter.y,u=l.col1.x*p+l.col2.x*d,d=l.col1.y*p+l.col2.y*d,p=u,_=i.m_sweep.c.x+c,f=i.m_sweep.c.y+h,m=n.m_sweep.c.x+p-_,g=n.m_sweep.c.y+d-f,S=((l=i.m_xf.R).col1.x*this.m_localXAxis1.x+l.col2.x*this.m_localXAxis1.y)*m+(l.col1.y*this.m_localXAxis1.x+l.col2.y*this.m_localXAxis1.y)*g,w=0,this.m_limitState==Mlf.e_equalLimits?(t=b2Math.b2Clamp(S,-b2Settings.b2_maxLinearCorrection,b2Settings.b2_maxLinearCorrection),w=-this.m_motorMass*t,v=b2Math.b2Max(v,b2Math.b2Abs(x))):this.m_limitState==Mlf.e_atLowerLimit?(t=S-this.m_lowerTranslation,v=b2Math.b2Max(v,-t),t=b2Math.b2Clamp(t+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0),w=-this.m_motorMass*t,e=this.m_limitPositionImpulse,this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+w,0),w=this.m_limitPositionImpulse-e):this.m_limitState==Mlf.e_atUpperLimit&&(t=S-this.m_upperTranslation,v=b2Math.b2Max(v,t),t=b2Math.b2Clamp(t-b2Settings.b2_linearSlop,0,b2Settings.b2_maxLinearCorrection),w=-this.m_motorMass*t,e=this.m_limitPositionImpulse,this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+w,0),w=this.m_limitPositionImpulse-e),i.m_sweep.c.x+=r*w*this.m_motorJacobian.linear1.x,i.m_sweep.c.y+=r*w*this.m_motorJacobian.linear1.y,i.m_sweep.a+=s*w*this.m_motorJacobian.angular1,n.m_sweep.c.x+=o*w*this.m_motorJacobian.linear2.x,n.m_sweep.c.y+=o*w*this.m_motorJacobian.linear2.y,n.m_sweep.a+=a*w*this.m_motorJacobian.angular2,i.SynchronizeTransform(),n.SynchronizeTransform()),v<=b2Settings.b2_linearSlop&&C<=b2Settings.b2_angularSlop},Mlf),b2PrismaticJointDef=(Pnf=b2JointDef,__extends(Qnf,Pnf),Qnf.prototype.Initialize=function(t,e,i,n){this.body1=t,this.body2=e,this.localAnchor1=this.body1.GetLocalPoint(i),this.localAnchor2=this.body2.GetLocalPoint(i),this.localAxis1=this.body1.GetLocalVector(n),this.referenceAngle=this.body2.GetAngle()-this.body1.GetAngle()},Qnf),b2PulleyJoint=(Wnf=b2Joint,__extends(Xnf,Wnf),Xnf.prototype.GetAnchor1=function(){return this.m_body1.GetWorldPoint(this.m_localAnchor1)},Xnf.prototype.GetAnchor2=function(){return this.m_body2.GetWorldPoint(this.m_localAnchor2)},Xnf.prototype.GetReactionForce=function(){var t=this.m_u2.Copy();return t.Multiply(this.m_force),t},Xnf.prototype.GetReactionTorque=function(){return 0},Xnf.prototype.GetGroundAnchor1=function(){var t=this.m_ground.m_xf.position.Copy();return t.Add(this.m_groundAnchor1),t},Xnf.prototype.GetGroundAnchor2=function(){var t=this.m_ground.m_xf.position.Copy();return t.Add(this.m_groundAnchor2),t},Xnf.prototype.GetLength1=function(){var t=this.m_body1.GetWorldPoint(this.m_localAnchor1),e=this.m_ground.m_xf.position.x+this.m_groundAnchor1.x,i=this.m_ground.m_xf.position.y+this.m_groundAnchor1.y,n=t.x-e,r=t.y-i;return Math.sqrt(n*n+r*r)},Xnf.prototype.GetLength2=function(){var t=this.m_body2.GetWorldPoint(this.m_localAnchor2),e=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,i=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y,n=t.x-e,r=t.y-i;return Math.sqrt(n*n+r*r)},Xnf.prototype.GetRatio=function(){return this.m_ratio},Xnf.prototype.InitVelocityConstraints=function(t){var e=this.m_body1,i=this.m_body2,n=e.m_xf.R,r=this.m_localAnchor1.x-e.m_sweep.localCenter.x,o=this.m_localAnchor1.y-e.m_sweep.localCenter.y,s=n.col1.x*r+n.col2.x*o,o=n.col1.y*r+n.col2.y*o,r=s;n=i.m_xf.R;var a=this.m_localAnchor2.x-i.m_sweep.localCenter.x,l=this.m_localAnchor2.y-i.m_sweep.localCenter.y,s=n.col1.x*a+n.col2.x*l,l=n.col1.y*a+n.col2.y*l,a=s,c=e.m_sweep.c.x+r,h=e.m_sweep.c.y+o,u=i.m_sweep.c.x+a,p=i.m_sweep.c.y+l,d=this.m_ground.m_xf.position.x+this.m_groundAnchor1.x,_=this.m_ground.m_xf.position.y+this.m_groundAnchor1.y,f=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,m=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y;this.m_u1.Set(c-d,h-_),this.m_u2.Set(u-f,p-m);var g=this.m_u1.Length(),y=this.m_u2.Length();g>b2Settings.b2_linearSlop?this.m_u1.Multiply(1/g):this.m_u1.SetZero(),y>b2Settings.b2_linearSlop?this.m_u2.Multiply(1/y):this.m_u2.SetZero(),0b2Settings.b2_linearSlop?this.m_u1.Multiply(1/c):this.m_u1.SetZero(),h>b2Settings.b2_linearSlop?this.m_u2.Multiply(1/h):this.m_u2.SetZero(),u=this.m_constant-c-this.m_ratio*h,A=b2Math.b2Max(A,-u),u=b2Math.b2Clamp(u+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0),p=-this.m_pulleyMass*u,d=this.m_positionImpulse,this.m_positionImpulse=b2Math.b2Max(0,this.m_positionImpulse+p),o=-(p=this.m_positionImpulse-d)*this.m_u1.x,s=-p*this.m_u1.y,a=-this.m_ratio*p*this.m_u2.x,l=-this.m_ratio*p*this.m_u2.y,m.m_sweep.c.x+=m.m_invMass*o,m.m_sweep.c.y+=m.m_invMass*s,m.m_sweep.a+=m.m_invI*(e*s-i*o),g.m_sweep.c.x+=g.m_invMass*a,g.m_sweep.c.y+=g.m_invMass*l,g.m_sweep.a+=g.m_invI*(n*l-r*a),m.SynchronizeTransform(),g.SynchronizeTransform()),this.m_limitState1==Xnf.e_atUpperLimit&&(t=m.m_xf.R,e=this.m_localAnchor1.x-m.m_sweep.localCenter.x,i=this.m_localAnchor1.y-m.m_sweep.localCenter.y,f=t.col1.x*e+t.col2.x*i,i=t.col1.y*e+t.col2.y*i,e=f,o=m.m_sweep.c.x+e,s=m.m_sweep.c.y+i,this.m_u1.Set(o-y,s-b),(c=this.m_u1.Length())>b2Settings.b2_linearSlop?(this.m_u1.x*=1/c,this.m_u1.y*=1/c):this.m_u1.SetZero(),u=this.m_maxLength1-c,A=b2Math.b2Max(A,-u),u=b2Math.b2Clamp(u+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0),p=-this.m_limitMass1*u,_=this.m_limitPositionImpulse1,this.m_limitPositionImpulse1=b2Math.b2Max(0,this.m_limitPositionImpulse1+p),o=-(p=this.m_limitPositionImpulse1-_)*this.m_u1.x,s=-p*this.m_u1.y,m.m_sweep.c.x+=m.m_invMass*o,m.m_sweep.c.y+=m.m_invMass*s,m.m_sweep.a+=m.m_invI*(e*s-i*o),m.SynchronizeTransform()),this.m_limitState2==Xnf.e_atUpperLimit&&(t=g.m_xf.R,n=this.m_localAnchor2.x-g.m_sweep.localCenter.x,r=this.m_localAnchor2.y-g.m_sweep.localCenter.y,f=t.col1.x*n+t.col2.x*r,r=t.col1.y*n+t.col2.y*r,n=f,a=g.m_sweep.c.x+n,l=g.m_sweep.c.y+r,this.m_u2.Set(a-v,l-x),(h=this.m_u2.Length())>b2Settings.b2_linearSlop?(this.m_u2.x*=1/h,this.m_u2.y*=1/h):this.m_u2.SetZero(),u=this.m_maxLength2-h,A=b2Math.b2Max(A,-u),u=b2Math.b2Clamp(u+b2Settings.b2_linearSlop,-b2Settings.b2_maxLinearCorrection,0),p=-this.m_limitMass2*u,_=this.m_limitPositionImpulse2,this.m_limitPositionImpulse2=b2Math.b2Max(0,this.m_limitPositionImpulse2+p),a=-(p=this.m_limitPositionImpulse2-_)*this.m_u2.x,l=-p*this.m_u2.y,g.m_sweep.c.x+=g.m_invMass*a,g.m_sweep.c.y+=g.m_invMass*l,g.m_sweep.a+=g.m_invI*(n*l-r*a),g.SynchronizeTransform()),A=this.m_upperAngle?(this.m_limitState!=Ppf.e_atUpperLimit&&(this.m_limitForce=0),this.m_limitState=Ppf.e_atUpperLimit):(this.m_limitState=Ppf.e_inactiveLimit,this.m_limitForce=0)):this.m_limitForce=0,t.warmStarting?(e.m_linearVelocity.x-=t.dt*h*this.m_pivotForce.x,e.m_linearVelocity.y-=t.dt*h*this.m_pivotForce.y,e.m_angularVelocity-=t.dt*p*(r*this.m_pivotForce.y-o*this.m_pivotForce.x+this.m_motorForce+this.m_limitForce),i.m_linearVelocity.x+=t.dt*u*this.m_pivotForce.x,i.m_linearVelocity.y+=t.dt*u*this.m_pivotForce.y,i.m_angularVelocity+=t.dt*d*(a*this.m_pivotForce.y-l*this.m_pivotForce.x+this.m_motorForce+this.m_limitForce)):(this.m_pivotForce.SetZero(),this.m_motorForce=0,this.m_limitForce=0),this.m_limitPositionImpulse=0},Ppf.prototype.SolveVelocityConstraints=function(t){var e=this.m_body1,i=this.m_body2,n=e.m_xf.R,r=this.m_localAnchor1.x-e.m_sweep.localCenter.x,o=this.m_localAnchor1.y-e.m_sweep.localCenter.y,s=n.col1.x*r+n.col2.x*o,o=n.col1.y*r+n.col2.y*o,r=s;n=i.m_xf.R;var a,l=this.m_localAnchor2.x-i.m_sweep.localCenter.x,c=this.m_localAnchor2.y-i.m_sweep.localCenter.y;s=n.col1.x*l+n.col2.x*c,c=n.col1.y*l+n.col2.y*c,l=s;var h=i.m_linearVelocity.x+-i.m_angularVelocity*c-e.m_linearVelocity.x- -e.m_angularVelocity*o,u=i.m_linearVelocity.y+i.m_angularVelocity*l-e.m_linearVelocity.y-e.m_angularVelocity*r,p=-t.inv_dt*(this.m_pivotMass.col1.x*h+this.m_pivotMass.col2.x*u),d=-t.inv_dt*(this.m_pivotMass.col1.y*h+this.m_pivotMass.col2.y*u);this.m_pivotForce.x+=p,this.m_pivotForce.y+=d;var _,f,m,g,y,b=t.dt*p,v=t.dt*d;e.m_linearVelocity.x-=e.m_invMass*b,e.m_linearVelocity.y-=e.m_invMass*v,e.m_angularVelocity-=e.m_invI*(r*v-o*b),i.m_linearVelocity.x+=i.m_invMass*b,i.m_linearVelocity.y+=i.m_invMass*v,i.m_angularVelocity+=i.m_invI*(l*v-c*b),this.m_enableMotor&&this.m_limitState!=Ppf.e_equalLimits&&(_=i.m_angularVelocity-e.m_angularVelocity-this.m_motorSpeed,f=-t.inv_dt*this.m_motorMass*_,m=this.m_motorForce,this.m_motorForce=b2Math.b2Clamp(this.m_motorForce+f,-this.m_maxMotorTorque,this.m_maxMotorTorque),f=this.m_motorForce-m,e.m_angularVelocity-=e.m_invI*t.dt*f,i.m_angularVelocity+=i.m_invI*t.dt*f),this.m_enableLimit&&this.m_limitState!=Ppf.e_inactiveLimit&&(g=i.m_angularVelocity-e.m_angularVelocity,y=-t.inv_dt*this.m_motorMass*g,this.m_limitState==Ppf.e_equalLimits?this.m_limitForce+=y:this.m_limitState==Ppf.e_atLowerLimit?(a=this.m_limitForce,this.m_limitForce=b2Math.b2Max(this.m_limitForce+y,0),y=this.m_limitForce-a):this.m_limitState==Ppf.e_atUpperLimit&&(a=this.m_limitForce,this.m_limitForce=b2Math.b2Min(this.m_limitForce+y,0),y=this.m_limitForce-a),e.m_angularVelocity-=e.m_invI*t.dt*y,i.m_angularVelocity+=i.m_invI*t.dt*y)},Ppf.prototype.SolvePositionConstraints=function(){var t,e,i=this.m_body1,n=this.m_body2,r=i.m_xf.R,o=this.m_localAnchor1.x-i.m_sweep.localCenter.x,s=this.m_localAnchor1.y-i.m_sweep.localCenter.y,a=r.col1.x*o+r.col2.x*s,s=r.col1.y*o+r.col2.y*s,o=a;r=n.m_xf.R;var l=this.m_localAnchor2.x-n.m_sweep.localCenter.x,c=this.m_localAnchor2.y-n.m_sweep.localCenter.y,a=r.col1.x*l+r.col2.x*c,c=r.col1.y*l+r.col2.y*c,l=a,h=i.m_sweep.c.x+o,u=i.m_sweep.c.y+s,p=n.m_sweep.c.x+l-h,d=n.m_sweep.c.y+c-u,_=Math.sqrt(p*p+d*d),f=i.m_invMass,m=n.m_invMass,g=i.m_invI,y=n.m_invI;this.K1.col1.x=f+m,this.K1.col2.x=0,this.K1.col1.y=0,this.K1.col2.y=f+m,this.K2.col1.x=g*s*s,this.K2.col2.x=-g*o*s,this.K2.col1.y=-g*o*s,this.K2.col2.y=g*o*o,this.K3.col1.x=y*c*c,this.K3.col2.x=-y*l*c,this.K3.col1.y=-y*l*c,this.K3.col2.y=y*l*l,this.K.SetM(this.K1),this.K.AddM(this.K2),this.K.AddM(this.K3),this.K.Solve(Ppf.tImpulse,-p,-d);var b=Ppf.tImpulse.x,v=Ppf.tImpulse.y;i.m_sweep.c.x-=i.m_invMass*b,i.m_sweep.c.y-=i.m_invMass*v,i.m_sweep.a-=i.m_invI*(o*v-s*b),n.m_sweep.c.x+=n.m_invMass*b,n.m_sweep.c.y+=n.m_invMass*v,n.m_sweep.a+=n.m_invI*(l*v-c*b),i.SynchronizeTransform(),n.SynchronizeTransform();var x,A,S=0;return this.m_enableLimit&&this.m_limitState!=Ppf.e_inactiveLimit&&(x=n.m_sweep.a-i.m_sweep.a-this.m_referenceAngle,A=0,this.m_limitState==Ppf.e_equalLimits?(e=b2Math.b2Clamp(x,-b2Settings.b2_maxAngularCorrection,b2Settings.b2_maxAngularCorrection),A=-this.m_motorMass*e,S=b2Math.b2Abs(e)):this.m_limitState==Ppf.e_atLowerLimit?(e=x-this.m_lowerAngle,S=b2Math.b2Max(0,-e),e=b2Math.b2Clamp(e+b2Settings.b2_angularSlop,-b2Settings.b2_maxAngularCorrection,0),A=-this.m_motorMass*e,t=this.m_limitPositionImpulse,this.m_limitPositionImpulse=b2Math.b2Max(this.m_limitPositionImpulse+A,0),A=this.m_limitPositionImpulse-t):this.m_limitState==Ppf.e_atUpperLimit&&(e=x-this.m_upperAngle,S=b2Math.b2Max(0,e),e=b2Math.b2Clamp(e-b2Settings.b2_angularSlop,0,b2Settings.b2_maxAngularCorrection),A=-this.m_motorMass*e,t=this.m_limitPositionImpulse,this.m_limitPositionImpulse=b2Math.b2Min(this.m_limitPositionImpulse+A,0),A=this.m_limitPositionImpulse-t),i.m_sweep.a-=i.m_invI*A,n.m_sweep.a+=n.m_invI*A,i.SynchronizeTransform(),n.SynchronizeTransform()),_<=b2Settings.b2_linearSlop&&S<=b2Settings.b2_angularSlop},Ppf.tImpulse=new b2Vec2,Ppf),b2RevoluteJointDef=(brf=b2JointDef,__extends(crf,brf),crf.prototype.Initialize=function(t,e,i){this.body1=t,this.body2=e,this.localAnchor1=this.body1.GetLocalPoint(i),this.localAnchor2=this.body2.GetLocalPoint(i),this.referenceAngle=this.body2.GetAngle()-this.body1.GetAngle()},crf),b2DistanceJoint=(hrf=b2Joint,__extends(irf,hrf),irf.prototype.InitVelocityConstraints=function(t){this.m_inv_dt=t.inv_dt;var e=this.m_body1,i=this.m_body2,n=e.m_xf.R,r=this.m_localAnchor1.x-e.m_sweep.localCenter.x,o=this.m_localAnchor1.y-e.m_sweep.localCenter.y,s=n.col1.x*r+n.col2.x*o,o=n.col1.y*r+n.col2.y*o,r=s;n=i.m_xf.R;var a=this.m_localAnchor2.x-i.m_sweep.localCenter.x,l=this.m_localAnchor2.y-i.m_sweep.localCenter.y;s=n.col1.x*a+n.col2.x*l,l=n.col1.y*a+n.col2.y*l,a=s,this.m_u.x=i.m_sweep.c.x+a-e.m_sweep.c.x-r,this.m_u.y=i.m_sweep.c.y+l-e.m_sweep.c.y-o;var c=Math.sqrt(this.m_u.x*this.m_u.x+this.m_u.y*this.m_u.y);c>b2Settings.b2_linearSlop?this.m_u.Multiply(1/c):this.m_u.SetZero();var h,u,p,d,_,f,m=r*this.m_u.y-o*this.m_u.x,g=a*this.m_u.y-l*this.m_u.x,y=e.m_invMass+e.m_invI*m*m+i.m_invMass+i.m_invI*g*g;this.m_mass=1/y,0b2Settings.b2_maxLinearVelocitySquared&&(r.m_linearVelocity.Normalize(),r.m_linearVelocity.x*=b2Settings.b2_maxLinearVelocity,r.m_linearVelocity.y*=b2Settings.b2_maxLinearVelocity),r.m_angularVelocity*r.m_angularVelocity>b2Settings.b2_maxAngularVelocitySquared&&(r.m_angularVelocity<0?r.m_angularVelocity=-b2Settings.b2_maxAngularVelocity:r.m_angularVelocity=b2Settings.b2_maxAngularVelocity));var o=new b2ContactSolver(t,this.m_contacts,this.m_contactCount,this.m_allocator);for(o.InitVelocityConstraints(t),c=0;cd||b2Math.b2Dot(r.m_linearVelocity,r.m_linearVelocity)>p?r.m_sleepTime=0:(r.m_sleepTime+=t.dt,b2Math.b2Min(u,r.m_sleepTime)));if(u>=b2Settings.b2_timeToSleep)for(c=0;cthis.m_positionIterationCount&&(this.m_positionIterationCount=e.m_positionIterationCount);for(var p=0;pNumber.MIN_VALUE&&(e=(t-this.t0)/(1-this.t0),this.c0.x=(1-e)*this.c0.x+e*this.c.x,this.c0.y=(1-e)*this.c0.y+e*this.c.y,this.a0=(1-e)*this.a0+e*this.a,this.t0=t)},zzf),b2Transform=(Izf.prototype.Initialize=function(t,e){this.position.SetV(t),this.R.SetM(e)},Izf.prototype.SetIdentity=function(){this.position.SetZero(),this.R.SetIdentity()},Izf.prototype.Set=function(t){this.position.SetV(t.position),this.R.SetM(t.R)},Izf.prototype.GetAngle=function(){return Math.atan2(this.R.col1.y,this.R.col1.x)},Izf),b2Vec2$1=(Ozf.prototype.SetZero=function(){this.x=0,this.y=0},Ozf.prototype.Set=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e},Ozf.prototype.SetV=function(t){this.x=t.x,this.y=t.y},Ozf.prototype.GetNegative=function(){return new Ozf(-this.x,-this.y)},Ozf.prototype.NegativeSelf=function(){this.x=-this.x,this.y=-this.y},Ozf.Make=function(t,e){return new Ozf(t,e)},Ozf.prototype.Copy=function(){return new Ozf(this.x,this.y)},Ozf.prototype.Add=function(t){this.x+=t.x,this.y+=t.y},Ozf.prototype.Subtract=function(t){this.x-=t.x,this.y-=t.y},Ozf.prototype.Multiply=function(t){this.x*=t,this.y*=t},Ozf.prototype.MulM=function(t){var e=this.x;this.x=t.col1.x*e+t.col2.x*this.y,this.y=t.col1.y*e+t.col2.y*this.y},Ozf.prototype.MulTM=function(t){var e=b2Math$1.Dot(this,t.col1);this.y=b2Math$1.Dot(this,t.col2),this.x=e},Ozf.prototype.CrossVF=function(t){var e=this.x;this.x=t*this.y,this.y=-t*e},Ozf.prototype.CrossFV=function(t){var e=this.x;this.x=-t*this.y,this.y=t*e},Ozf.prototype.MinV=function(t){this.x=this.xt.x?this.x:t.x,this.y=this.y>t.y?this.y:t.y},Ozf.prototype.Abs=function(){this.x<0&&(this.x=-this.x),this.y<0&&(this.y=-this.y)},Ozf.prototype.Length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},Ozf.prototype.LengthSquared=function(){return this.x*this.x+this.y*this.y},Ozf.prototype.Normalize=function(){var t=Math.sqrt(this.x*this.x+this.y*this.y);if(t>1&2147483647,t|=t>>2&1073741823,t|=t>>4&268435455,t|=t>>8&16777215,1+(t|=t>>16&65535)},uAf.IsPowerOfTwo=function(t){return 0>>0;for(var e=this.m_vertices,i=0;ic+h&&t.distance>Number.MIN_VALUE?(t.distance-=c+h,(u=b2Math$1.SubtractVV(t.pointB,t.pointA)).Normalize(),t.pointA.x+=c*u.x,t.pointA.y+=c*u.y,t.pointB.x-=h*u.x,t.pointB.y-=h*u.y):((l=new b2Vec2$1).x=.5*(t.pointA.x+t.pointB.x),l.y=.5*(t.pointA.y+t.pointB.y),t.pointA.x=t.pointB.x=l.x,t.pointA.y=t.pointB.y=l.y,t.distance=0))},ECf.s_simplex=new b2Simplex,ECf.s_saveA=new Array(3),ECf.s_saveB=new Array(3),ECf),b2Shape$1=($Cf.prototype.Copy=function(){return null},$Cf.prototype.Set=function(t){this.m_radius=t.m_radius},$Cf.prototype.GetType=function(){return this.m_type},$Cf.prototype.TestPoint=function(t,e){return!1},$Cf.prototype.RayCast=function(t,e,i){return!1},$Cf.prototype.ComputeAABB=function(t,e){},$Cf.prototype.ComputeMass=function(t,e){},$Cf.prototype.ComputeSubmergedArea=function(t,e,i,n){return 0},$Cf.TestOverlap=function(t,e,i,n){var r=new b2DistanceInput;r.proxyA=new b2DistanceProxy,r.proxyA.Set(t),r.proxyB=new b2DistanceProxy,r.proxyB.Set(i),r.transformA=e,r.transformB=n,r.useRadii=!0;var o=new b2SimplexCache;o.count=0;var s=new b2DistanceOutput;return b2Distance$1.Distance(s,o,r),s.distance<10*Number.MIN_VALUE},$Cf.e_unknownShape=-1,$Cf.e_circleShape=0,$Cf.e_polygonShape=1,$Cf.e_edgeShape=2,$Cf.e_shapeTypeCount=3,$Cf.e_hitCollide=1,$Cf.e_missCollide=0,$Cf.e_startsInsideCollide=-1,$Cf),b2CircleShape$1=(uDf=b2Shape$1,__extends(vDf,uDf),vDf.prototype.Copy=function(){var t=new vDf;return t.Set(this),t},vDf.prototype.Set=function(t){uDf.prototype.Set.call(this,t),t instanceof vDf&&this.m_p.SetV(t.m_p)},vDf.prototype.TestPoint=function(t,e){var i=t.R,n=t.position.x+(i.col1.x*this.m_p.x+i.col2.x*this.m_p.y),r=t.position.y+(i.col1.y*this.m_p.x+i.col2.y*this.m_p.y);return(n=e.x-n)*n+(r=e.y-r)*r<=this.m_radius*this.m_radius},vDf.prototype.RayCast=function(t,e,i){var n=i.R,r=i.position.x+(n.col1.x*this.m_p.x+n.col2.x*this.m_p.y),o=i.position.y+(n.col1.y*this.m_p.x+n.col2.y*this.m_p.y),s=e.p1.x-r,a=e.p1.y-o,l=s*s+a*a-this.m_radius*this.m_radius,c=e.p2.x-e.p1.x,h=e.p2.y-e.p1.y,u=s*c+a*h,p=c*c+h*h,d=u*u-p*l;if(d<0||pthis.m_radius)return n.SetV(r),Math.PI*this.m_radius*this.m_radius;var s=this.m_radius*this.m_radius,a=o*o,l=s*(Math.asin(o/this.m_radius)+Math.PI/2)+o*Math.sqrt(s-a),c=-2/3*Math.pow(s-a,1.5)/l;return n.x=r.x+t.x*c,n.y=r.y+t.y*c,l},vDf.prototype.GetLocalPosition=function(){return this.m_p},vDf.prototype.SetLocalPosition=function(t){this.m_p.SetV(t)},vDf.prototype.GetRadius=function(){return this.m_radius},vDf.prototype.SetRadius=function(t){this.m_radius=t},vDf),b2EdgeShape=(mEf=b2Shape$1,__extends(nEf,mEf),nEf.prototype.TestPoint=function(t,e){return!1},nEf.prototype.RayCast=function(t,e,i){var n=e.p2.x-e.p1.x,r=e.p2.y-e.p1.y,o=i.R,s=i.position.x+(o.col1.x*this.m_v1.x+o.col2.x*this.m_v1.y),a=i.position.y+(o.col1.y*this.m_v1.x+o.col2.y*this.m_v1.y),l=i.position.y+(o.col1.y*this.m_v2.x+o.col2.y*this.m_v2.y)-a,c=-(i.position.x+(o.col1.x*this.m_v2.x+o.col2.x*this.m_v2.y)-s),h=100*Number.MIN_VALUE,u=-(n*l+r*c);if(hNumber.MIN_VALUE),this.m_normals[i].SetV(b2Math$1.CrossVF(r,1)),this.m_normals[i].Normalize()}this.m_centroid=tFf.ComputeCentroid(this.m_vertices,this.m_vertexCount)},tFf.AsVector=function(t,e){var i=new tFf;return i.SetAsVector(t,e),i},tFf.prototype.SetAsBox=function(t,e){this.m_vertexCount=4,this.Reserve(4),this.m_vertices[0].Set(-t,-e),this.m_vertices[1].Set(t,-e),this.m_vertices[2].Set(t,e),this.m_vertices[3].Set(-t,e),this.m_normals[0].Set(0,-1),this.m_normals[1].Set(1,0),this.m_normals[2].Set(0,1),this.m_normals[3].Set(-1,0),this.m_centroid.SetZero()},tFf.AsBox=function(t,e){var i=new tFf;return i.SetAsBox(t,e),i},tFf.prototype.SetAsOrientedBox=function(t,e,i,n){void 0===i&&(i=null),void 0===n&&(n=0),this.m_vertexCount=4,this.Reserve(4),this.m_vertices[0].Set(-t,-e),this.m_vertices[1].Set(t,-e),this.m_vertices[2].Set(t,e),this.m_vertices[3].Set(-t,e),this.m_normals[0].Set(0,-1),this.m_normals[1].Set(1,0),this.m_normals[2].Set(0,1),this.m_normals[3].Set(-1,0),this.m_centroid=i;var r=new b2Transform;r.position=i,r.R.Set(n);for(var o=0;o(r=(this.upperBound.x-c)*i)&&(o=n,n=r,r=o,s=1),a(l=Math.min(l,r)))return!1;if(_(r=(this.upperBound.y-h)*i)&&(o=n,n=r,r=o,s=1),a(l=Math.min(l,r)))return!1;return t.fraction=a,!0},zIf.prototype.TestOverlap=function(t){var e=t.lowerBound.x-this.upperBound.x,i=t.lowerBound.y-this.upperBound.y,n=this.lowerBound.x-t.upperBound.x,r=this.lowerBound.y-t.upperBound.y;return!(0>8&255,this.features._incidentVertex=(16711680&this._key)>>16&255,this.features._flip=(4278190080&this._key)>>24&255},enumerable:!0,configurable:!0}),iJf),ClipVertex$1=(mJf.prototype.Set=function(t){this.v.SetV(t.v),this.id.Set(t.id)},mJf),b2ManifoldPoint$1=(oJf.prototype.Reset=function(){this.m_localPoint.SetZero(),this.m_normalImpulse=0,this.m_tangentImpulse=0,this.m_id.key=0},oJf.prototype.Set=function(t){this.m_localPoint.SetV(t.m_localPoint),this.m_normalImpulse=t.m_normalImpulse,this.m_tangentImpulse=t.m_tangentImpulse,this.m_id.Set(t.m_id)},oJf),b2Manifold$1=(qJf.prototype.Reset=function(){for(var t=0;ty;)g=d,y=v;return t[0]=g,y},wJf.FindIncidentEdge=function(t,e,i,n,r,o){e.m_vertexCount;for(var s=e.m_normals,a=r.m_vertexCount,l=r.m_vertices,c=r.m_normals,h=i.R,u=s[n],p=h.col1.x*u.x+h.col2.x*u.y,d=h.col1.y*u.x+h.col2.y*u.y,_=(h=o.R).col1.x*p+h.col1.y*d,d=h.col2.x*p+h.col2.y*d,p=_,f=0,m=Number.MAX_VALUE,g=0;gf*f)return;t.m_pointCount=1,t.m_type=b2Manifold$1.e_faceA,t.m_localPlaneNormal.x=u-S.x,t.m_localPlaneNormal.y=p-S.y,t.m_localPlaneNormal.Normalize(),t.m_localPoint.SetV(S),t.m_points[0].m_localPoint.SetV(n.m_p),t.m_points[0].m_id.key=0}else if(P<=0){if((u-w.x)*(u-w.x)+(p-w.y)*(p-w.y)>f*f)return;t.m_pointCount=1,t.m_type=b2Manifold$1.e_faceA,t.m_localPlaneNormal.x=u-w.x,t.m_localPlaneNormal.y=p-w.y,t.m_localPlaneNormal.Normalize(),t.m_localPoint.SetV(w),t.m_points[0].m_localPoint.SetV(n.m_p),t.m_points[0].m_id.key=0}else{var E=.5*(S.x+w.x),T=.5*(S.y+w.y);if((_=(u-E)*y[x].x+(p-T)*y[x].y)>f)return;t.m_pointCount=1,t.m_type=b2Manifold$1.e_faceA,t.m_localPlaneNormal.x=y[x].x,t.m_localPlaneNormal.y=y[x].y,t.m_localPlaneNormal.Normalize(),t.m_localPoint.Set(E,T),t.m_points[0].m_localPoint.SetV(n.m_p),t.m_points[0].m_id.key=0}},wJf.TestOverlap=function(t,e){var i=e.lowerBound,n=t.upperBound,r=i.x-n.x,o=i.y-n.y,i=t.lowerBound,n=e.upperBound,s=i.x-n.x,a=i.y-n.y;return!(0>n&1?i.child2:i.child1,n=n+1&31;++this.m_path,this.RemoveLeaf(i),this.InsertLeaf(i)}},OMf.prototype.GetFatAABB=function(t){return t.aabb},OMf.prototype.GetUserData=function(t){return t.userData},OMf.prototype.Query=function(t,e){if(null!=this.m_root){var i=new Array,n=0;for(i[n++]=this.m_root;0Number.MIN_VALUE);var o=e.m_radius+i.m_radius,s=t.tolerance,a=0,l=0,c=0;for(this.s_cache.count=0,this.s_distanceInput.useRadii=!1;;){if(n.GetTransform(this.s_xfA,a),r.GetTransform(this.s_xfB,a),this.s_distanceInput.proxyA=e,this.s_distanceInput.proxyB=i,this.s_distanceInput.transformA=this.s_xfA,this.s_distanceInput.transformB=this.s_xfB,b2Distance$1.Distance(this.s_distanceOutput,this.s_cache,this.s_distanceInput),this.s_distanceOutput.distance<=0){a=1;break}this.s_fcn.Initialize(this.s_cache,e,this.s_xfA,i,this.s_xfB);var h=this.s_fcn.Evaluate(this.s_xfA,this.s_xfB);if(h<=0){a=1;break}if(0==l&&(c=oNumber.MIN_VALUE*Number.MIN_VALUE?(p=Math.sqrt(x),this.m_normal.x=b/p,this.m_normal.y=v/p):(this.m_normal.x=1,this.m_normal.y=0);var A=d+i*this.m_normal.x,S=_+i*this.m_normal.y,w=g-r*this.m_normal.x,C=y-r*this.m_normal.y;this.m_points[0].x=.5*(A+w),this.m_points[0].y=.5*(S+C);break;case b2Manifold$1.e_faceA:for(f=e.R,m=t.m_localPlaneNormal,s=f.col1.x*m.x+f.col2.x*m.y,a=f.col1.y*m.x+f.col2.y*m.y,f=e.R,m=t.m_localPoint,l=e.position.x+f.col1.x*m.x+f.col2.x*m.y,c=e.position.y+f.col1.y*m.x+f.col2.y*m.y,this.m_normal.x=s,this.m_normal.y=a,o=0;o>>0,this._g=255*b2Math$1.Clamp(e,0,1)>>>0,this._b=255*b2Math$1.Clamp(i,0,1)>>>0},Object.defineProperty(cQf.prototype,"r",{set:function(t){this._r=255*b2Math$1.Clamp(t,0,1)>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(cQf.prototype,"g",{set:function(t){this._g=255*b2Math$1.Clamp(t,0,1)>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(cQf.prototype,"b",{set:function(t){this._b=255*b2Math$1.Clamp(t,0,1)>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(cQf.prototype,"color",{get:function(){return this._r<<16|this._g<<8|this._b},enumerable:!0,configurable:!0}),cQf),b2PositionSolverManifold=(mQf.prototype.Initialize=function(t){var e,i,n,r,o;switch(b2Settings$1.b2Assert(0Number.MIN_VALUE*Number.MIN_VALUE?(s=Math.sqrt(f),this.m_normal.x=d/s,this.m_normal.y=_/s):(this.m_normal.x=1,this.m_normal.y=0),this.m_points[0].x=.5*(a+u),this.m_points[0].y=.5*(l+p),this.m_separations[0]=d*this.m_normal.x+_*this.m_normal.y-t.radius;break;case b2Manifold$1.e_faceA:for(c=t.bodyA.m_xf.R,h=t.localPlaneNormal,this.m_normal.x=c.col1.x*h.x+c.col2.x*h.y,this.m_normal.y=c.col1.y*h.x+c.col2.y*h.y,c=t.bodyA.m_xf.R,h=t.localPoint,r=t.bodyA.m_xf.position.x+(c.col1.x*h.x+c.col2.x*h.y),o=t.bodyA.m_xf.position.y+(c.col1.y*h.x+c.col2.y*h.y),c=t.bodyB.m_xf.R,e=0;eb2Settings$1.b2_maxTranslationSquared&&(n.m_linearVelocity.Normalize(),n.m_linearVelocity.x*=b2Settings$1.b2_maxTranslation*t.inv_dt,n.m_linearVelocity.y*=b2Settings$1.b2_maxTranslation*t.inv_dt),(s=t.dt*n.m_angularVelocity)*s>b2Settings$1.b2_maxRotationSquared&&(n.m_angularVelocity<0?n.m_angularVelocity=-b2Settings$1.b2_maxRotation*t.inv_dt:n.m_angularVelocity=b2Settings$1.b2_maxRotation*t.inv_dt),n.m_sweep.c0.SetV(n.m_sweep.c),n.m_sweep.a0=n.m_sweep.a,n.m_sweep.c.x+=t.dt*n.m_linearVelocity.x,n.m_sweep.c.y+=t.dt*n.m_linearVelocity.y,n.m_sweep.a+=t.dt*n.m_angularVelocity,n.SynchronizeTransform());for(f=0;f_||b2Math$1.Dot(n.m_linearVelocity,n.m_linearVelocity)>d?n.m_sleepTime=0:(n.m_sleepTime+=t.dt,b2Math$1.Min(p,n.m_sleepTime)));if(p>=b2Settings$1.b2_timeToSleep)for(f=0;fb2Settings$1.b2_maxTranslationSquared&&(s.m_linearVelocity.Normalize(),s.m_linearVelocity.x*=b2Settings$1.b2_maxTranslation*t.inv_dt,s.m_linearVelocity.y*=b2Settings$1.b2_maxTranslation*t.inv_dt),(o=t.dt*s.m_angularVelocity)*o>b2Settings$1.b2_maxRotationSquared&&(s.m_angularVelocity<0?s.m_angularVelocity=-b2Settings$1.b2_maxRotation*t.inv_dt:s.m_angularVelocity=b2Settings$1.b2_maxRotation*t.inv_dt),s.m_sweep.c0.SetV(s.m_sweep.c),s.m_sweep.a0=s.m_sweep.a,s.m_sweep.c.x+=t.dt*s.m_linearVelocity.x,s.m_sweep.c.y+=t.dt*s.m_linearVelocity.y,s.m_sweep.a+=t.dt*s.m_angularVelocity,s.SynchronizeTransform())}for(i=0;ib2Settings$1.b2_linearSlop?this.m_u.Multiply(1/c):this.m_u.SetZero();var h,u,p,d,_,f,m=r*this.m_u.y-o*this.m_u.x,g=a*this.m_u.y-l*this.m_u.x,y=e.m_invMass+e.m_invI*m*m+i.m_invMass+i.m_invI*g*g;this.m_mass=0!=y?1/y:0,0v*v&&(this.m_linearImpulse.Normalize(),this.m_linearImpulse.Multiply(v)),S=b2Math$1.SubtractVV(this.m_linearImpulse,w),n.x-=a*S.x,n.y-=a*S.y,r-=c*(p*S.y-d*S.x),o.x+=l*S.x,o.y+=l*S.y,s+=h*(f*S.y-m*S.x),e.m_angularVelocity=r,i.m_angularVelocity=s},CTf.prototype.SolvePositionConstraints=function(t){return!0},CTf),b2FrictionJointDef=(wUf=b2JointDef$1,__extends(xUf,wUf),xUf.prototype.Initialize=function(t,e,i){this.bodyA=t,this.bodyB=e,this.localAnchorA.SetV(this.bodyA.GetLocalPoint(i)),this.localAnchorB.SetV(this.bodyB.GetLocalPoint(i))},xUf),b2GearJoint$1=(CUf=b2Joint$1,__extends(DUf,CUf),DUf.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)},DUf.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)},DUf.prototype.GetReactionForce=function(t){return new b2Vec2$1(t*this.m_impulse*this.m_J.linearB.x,t*this.m_impulse*this.m_J.linearB.y)},DUf.prototype.GetReactionTorque=function(t){var e=this.m_bodyB.m_xf.R,i=this.m_localAnchor1.x-this.m_bodyB.m_sweep.localCenter.x,n=this.m_localAnchor1.y-this.m_bodyB.m_sweep.localCenter.y,r=e.col1.x*i+e.col2.x*n,n=e.col1.y*i+e.col2.y*n,i=r,o=this.m_impulse*this.m_J.linearB.x,s=this.m_impulse*this.m_J.linearB.y;return t*(this.m_impulse*this.m_J.angularB-i*s+n*o)},DUf.prototype.GetRatio=function(){return this.m_ratio},DUf.prototype.SetRatio=function(t){this.m_ratio=t},DUf.prototype.InitVelocityConstraints=function(t){var e,i,n,r,o,s,a,l,c=this.m_ground1,h=this.m_ground2,u=this.m_bodyA,p=this.m_bodyB,d=0;this.m_J.SetZero(),this.m_revolute1?(this.m_J.angularA=-1,d+=u.m_invI):(o=c.m_xf.R,s=this.m_prismatic1.m_localXAxis1,e=o.col1.x*s.x+o.col2.x*s.y,i=o.col1.y*s.x+o.col2.y*s.y,o=u.m_xf.R,n=this.m_localAnchor1.x-u.m_sweep.localCenter.x,r=this.m_localAnchor1.y-u.m_sweep.localCenter.y,l=o.col1.x*n+o.col2.x*r,r=o.col1.y*n+o.col2.y*r,a=(n=l)*i-r*e,this.m_J.linearA.Set(-e,-i),this.m_J.angularA=-a,d+=u.m_invMass+u.m_invI*a*a),this.m_revolute2?(this.m_J.angularB=-this.m_ratio,d+=this.m_ratio*this.m_ratio*p.m_invI):(o=h.m_xf.R,s=this.m_prismatic2.m_localXAxis1,e=o.col1.x*s.x+o.col2.x*s.y,i=o.col1.y*s.x+o.col2.y*s.y,o=p.m_xf.R,n=this.m_localAnchor2.x-p.m_sweep.localCenter.x,r=this.m_localAnchor2.y-p.m_sweep.localCenter.y,l=o.col1.x*n+o.col2.x*r,r=o.col1.y*n+o.col2.y*r,a=(n=l)*i-r*e,this.m_J.linearB.Set(-this.m_ratio*e,-this.m_ratio*i),this.m_J.angularB=-this.m_ratio*a,d+=this.m_ratio*this.m_ratio*(p.m_invMass+p.m_invI*a*a)),this.m_mass=0Number.MIN_VALUE?1/this.m_motorMass:0,this.m_perp.SetV(b2Math$1.MulMV(n.R,this.m_localYAxis1)),this.m_s1=(h+r)*this.m_perp.y-(u+o)*this.m_perp.x,this.m_s2=l*this.m_perp.y-c*this.m_perp.x;var p,d,_,f,m,g=this.m_invMassA,y=this.m_invMassB,b=this.m_invIA,v=this.m_invIB;this.m_K.col1.x=g+y+b*this.m_s1*this.m_s1+v*this.m_s2*this.m_s2,this.m_K.col1.y=b*this.m_s1*this.m_a1+v*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=g+y+b*this.m_a1*this.m_a1+v*this.m_a2*this.m_a2,this.m_enableLimit?(p=this.m_axis.x*h+this.m_axis.y*u,b2Math$1.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings$1.b2_linearSlop?this.m_limitState=b2Joint$1.e_equalLimits:p<=this.m_lowerTranslation?this.m_limitState!=b2Joint$1.e_atLowerLimit&&(this.m_limitState=b2Joint$1.e_atLowerLimit,this.m_impulse.y=0):p>=this.m_upperTranslation?this.m_limitState!=b2Joint$1.e_atUpperLimit&&(this.m_limitState=b2Joint$1.e_atUpperLimit,this.m_impulse.y=0):(this.m_limitState=b2Joint$1.e_inactiveLimit,this.m_impulse.y=0)):this.m_limitState=b2Joint$1.e_inactiveLimit,0==this.m_enableMotor&&(this.m_motorImpulse=0),t.warmStarting?(this.m_impulse.x*=t.dtRatio,this.m_impulse.y*=t.dtRatio,this.m_motorImpulse*=t.dtRatio,d=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.x,_=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.y)*this.m_axis.y,f=this.m_impulse.x*this.m_s1+(this.m_motorImpulse+this.m_impulse.y)*this.m_a1,m=this.m_impulse.x*this.m_s2+(this.m_motorImpulse+this.m_impulse.y)*this.m_a2,e.m_linearVelocity.x-=this.m_invMassA*d,e.m_linearVelocity.y-=this.m_invMassA*_,e.m_angularVelocity-=this.m_invIA*f,i.m_linearVelocity.x+=this.m_invMassB*d,i.m_linearVelocity.y+=this.m_invMassB*_,i.m_angularVelocity+=this.m_invIB*m):(this.m_impulse.SetZero(),this.m_motorImpulse=0)},EVf.prototype.SolveVelocityConstraints=function(t){var e,i,n,r,o,s,a,l,c=this.m_bodyA,h=this.m_bodyB,u=c.m_linearVelocity,p=c.m_angularVelocity,d=h.m_linearVelocity,_=h.m_angularVelocity;this.m_enableMotor&&this.m_limitState!=b2Joint$1.e_equalLimits&&(o=this.m_axis.x*(d.x-u.x)+this.m_axis.y*(d.y-u.y)+this.m_a2*_-this.m_a1*p,s=this.m_motorMass*(this.m_motorSpeed-o),a=this.m_motorImpulse,l=t.dt*this.m_maxMotorForce,this.m_motorImpulse=b2Math$1.Clamp(this.m_motorImpulse+s,-l,l),e=(s=this.m_motorImpulse-a)*this.m_axis.x,i=s*this.m_axis.y,n=s*this.m_a1,r=s*this.m_a2,u.x-=this.m_invMassA*e,u.y-=this.m_invMassA*i,p-=this.m_invIA*n,d.x+=this.m_invMassB*e,d.y+=this.m_invMassB*i,_+=this.m_invIB*r);var f,m,g,y,b,v,x=this.m_perp.x*(d.x-u.x)+this.m_perp.y*(d.y-u.y)+this.m_s2*_-this.m_s1*p;r=this.m_enableLimit&&this.m_limitState!=b2Joint$1.e_inactiveLimit?(f=this.m_axis.x*(d.x-u.x)+this.m_axis.y*(d.y-u.y)+this.m_a2*_-this.m_a1*p,m=this.m_impulse.Copy(),g=this.m_K.Solve(new b2Vec2$1,-x,-f),this.m_impulse.Add(g),this.m_limitState==b2Joint$1.e_atLowerLimit?this.m_impulse.y=b2Math$1.Max(this.m_impulse.y,0):this.m_limitState==b2Joint$1.e_atUpperLimit&&(this.m_impulse.y=b2Math$1.Min(this.m_impulse.y,0)),y=-x-(this.m_impulse.y-m.y)*this.m_K.col2.x,b=0!=this.m_K.col1.x?y/this.m_K.col1.x+m.x:m.x,this.m_impulse.x=b,g.x=this.m_impulse.x-m.x,g.y=this.m_impulse.y-m.y,e=g.x*this.m_perp.x+g.y*this.m_axis.x,i=g.x*this.m_perp.y+g.y*this.m_axis.y,n=g.x*this.m_s1+g.y*this.m_a1,g.x*this.m_s2+g.y*this.m_a2):(v=0!=this.m_K.col1.x?-x/this.m_K.col1.x:0,this.m_impulse.x+=v,e=v*this.m_perp.x,i=v*this.m_perp.y,n=v*this.m_s1,v*this.m_s2),u.x-=this.m_invMassA*e,u.y-=this.m_invMassA*i,p-=this.m_invIA*n,d.x+=this.m_invMassB*e,d.y+=this.m_invMassB*i,_+=this.m_invIB*r,c.m_linearVelocity.SetV(u),c.m_angularVelocity=p,h.m_linearVelocity.SetV(d),h.m_angularVelocity=_},EVf.prototype.SolvePositionConstraints=function(t){var e,i,n,r,o=this.m_bodyA,s=this.m_bodyB,a=o.m_sweep.c,l=o.m_sweep.a,c=s.m_sweep.c,h=s.m_sweep.a,u=0,p=!1,d=0,_=b2Mat22$1.FromAngle(l),f=b2Mat22$1.FromAngle(h),m=_,g=this.m_localAnchor1.x-this.m_localCenterA.x,y=this.m_localAnchor1.y-this.m_localCenterA.y,b=m.col1.x*g+m.col2.x*y,y=m.col1.y*g+m.col2.y*y,g=b;m=f;var v=this.m_localAnchor2.x-this.m_localCenterB.x,x=this.m_localAnchor2.y-this.m_localCenterB.y;b=m.col1.x*v+m.col2.x*x,x=m.col1.y*v+m.col2.y*x,v=b;var A,S=c.x+v-a.x-g,w=c.y+x-a.y-y;this.m_enableLimit&&(this.m_axis=b2Math$1.MulMV(_,this.m_localXAxis1),this.m_a1=(S+g)*this.m_axis.y-(w+y)*this.m_axis.x,this.m_a2=v*this.m_axis.y-x*this.m_axis.x,A=this.m_axis.x*S+this.m_axis.y*w,b2Math$1.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings$1.b2_linearSlop?(d=b2Math$1.Clamp(A,-b2Settings$1.b2_maxLinearCorrection,b2Settings$1.b2_maxLinearCorrection),u=b2Math$1.Abs(A),p=!0):A<=this.m_lowerTranslation?(d=b2Math$1.Clamp(A-this.m_lowerTranslation+b2Settings$1.b2_linearSlop,-b2Settings$1.b2_maxLinearCorrection,0),u=this.m_lowerTranslation-A,p=!0):A>=this.m_upperTranslation&&(d=b2Math$1.Clamp(A-this.m_upperTranslation+b2Settings$1.b2_linearSlop,0,b2Settings$1.b2_maxLinearCorrection),u=A-this.m_upperTranslation,p=!0)),this.m_perp=b2Math$1.MulMV(_,this.m_localYAxis1),this.m_s1=(S+g)*this.m_perp.y-(w+y)*this.m_perp.x,this.m_s2=v*this.m_perp.y-x*this.m_perp.x;var C,P,E=new b2Vec2$1,T=this.m_perp.x*S+this.m_perp.y*w,u=b2Math$1.Max(u,b2Math$1.Abs(T));p?(e=this.m_invMassA,i=this.m_invMassB,n=this.m_invIA,r=this.m_invIB,this.m_K.col1.x=e+i+n*this.m_s1*this.m_s1+r*this.m_s2*this.m_s2,this.m_K.col1.y=n*this.m_s1*this.m_a1+r*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=e+i+n*this.m_a1*this.m_a1+r*this.m_a2*this.m_a2,this.m_K.Solve(E,-T,-d)):(e=this.m_invMassA,i=this.m_invMassB,n=this.m_invIA,r=this.m_invIB,P=0!=(C=e+i+n*this.m_s1*this.m_s1+r*this.m_s2*this.m_s2)?-T/C:0,E.x=P,E.y=0);var M=E.x*this.m_perp.x+E.y*this.m_axis.x,D=E.x*this.m_perp.y+E.y*this.m_axis.y,I=E.x*this.m_s1+E.y*this.m_a1,O=E.x*this.m_s2+E.y*this.m_a2;return a.x-=this.m_invMassA*M,a.y-=this.m_invMassA*D,l-=this.m_invIA*I,c.x+=this.m_invMassB*M,c.y+=this.m_invMassB*D,h+=this.m_invIB*O,o.m_sweep.a=l,s.m_sweep.a=h,o.SynchronizeTransform(),s.SynchronizeTransform(),u<=b2Settings$1.b2_linearSlop&&0<=b2Settings$1.b2_angularSlop},EVf),b2LineJointDef=(HXf=b2JointDef$1,__extends(IXf,HXf),IXf.prototype.Initialize=function(t,e,i,n){this.bodyA=t,this.bodyB=e,this.localAnchorA=this.bodyA.GetLocalPoint(i),this.localAnchorB=this.bodyB.GetLocalPoint(i),this.localAxisA=this.bodyA.GetLocalVector(n)},IXf),b2MouseJoint$1=(OXf=b2Joint$1,__extends(PXf,OXf),PXf.prototype.GetAnchorA=function(){return this.m_target},PXf.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor)},PXf.prototype.GetReactionForce=function(t){return new b2Vec2$1(t*this.m_impulse.x,t*this.m_impulse.y)},PXf.prototype.GetReactionTorque=function(t){return 0},PXf.prototype.GetTarget=function(){return this.m_target},PXf.prototype.SetTarget=function(t){0==this.m_bodyB.IsAwake()&&this.m_bodyB.SetAwake(!0),this.m_target=t},PXf.prototype.GetMaxForce=function(){return this.m_maxForce},PXf.prototype.SetMaxForce=function(t){this.m_maxForce=t},PXf.prototype.GetFrequency=function(){return this.m_frequencyHz},PXf.prototype.SetFrequency=function(t){this.m_frequencyHz=t},PXf.prototype.GetDampingRatio=function(){return this.m_dampingRatio},PXf.prototype.SetDampingRatio=function(t){this.m_dampingRatio=t},PXf.prototype.InitVelocityConstraints=function(t){var e,i=this.m_bodyB,n=i.GetMass(),r=2*Math.PI*this.m_frequencyHz,o=2*n*this.m_dampingRatio*r,s=n*r*r;this.m_gamma=t.dt*(o+t.dt*s),this.m_gamma=0!=this.m_gamma?1/this.m_gamma:0,this.m_beta=t.dt*s*this.m_gamma,e=i.m_xf.R;var a=this.m_localAnchor.x-i.m_sweep.localCenter.x,l=this.m_localAnchor.y-i.m_sweep.localCenter.y,c=e.col1.x*a+e.col2.x*l,l=e.col1.y*a+e.col2.y*l,a=c,h=i.m_invMass,u=i.m_invI;this.K1.col1.x=h,this.K1.col2.x=0,this.K1.col1.y=0,this.K1.col2.y=h,this.K2.col1.x=u*l*l,this.K2.col2.x=-u*a*l,this.K2.col1.y=-u*a*l,this.K2.col2.y=u*a*a,this.K.SetM(this.K1),this.K.AddM(this.K2),this.K.col1.x+=this.m_gamma,this.K.col2.y+=this.m_gamma,this.K.GetInverse(this.m_mass),this.m_C.x=i.m_sweep.c.x+a-this.m_target.x,this.m_C.y=i.m_sweep.c.y+l-this.m_target.y,i.m_angularVelocity*=.98,this.m_impulse.x*=t.dtRatio,this.m_impulse.y*=t.dtRatio,i.m_linearVelocity.x+=h*this.m_impulse.x,i.m_linearVelocity.y+=h*this.m_impulse.y,i.m_angularVelocity+=u*(a*this.m_impulse.y-l*this.m_impulse.x)},PXf.prototype.SolveVelocityConstraints=function(t){var e,i=this.m_bodyB,n=i.m_xf.R,r=this.m_localAnchor.x-i.m_sweep.localCenter.x,o=this.m_localAnchor.y-i.m_sweep.localCenter.y,s=n.col1.x*r+n.col2.x*o,o=n.col1.y*r+n.col2.y*o,r=s,a=i.m_linearVelocity.x+-i.m_angularVelocity*o,l=i.m_linearVelocity.y+i.m_angularVelocity*r;n=this.m_mass,s=a+this.m_beta*this.m_C.x+this.m_gamma*this.m_impulse.x,e=l+this.m_beta*this.m_C.y+this.m_gamma*this.m_impulse.y;var c=-(n.col1.x*s+n.col2.x*e),h=-(n.col1.y*s+n.col2.y*e),u=this.m_impulse.x,p=this.m_impulse.y;this.m_impulse.x+=c,this.m_impulse.y+=h;var d=t.dt*this.m_maxForce;this.m_impulse.LengthSquared()>d*d&&this.m_impulse.Multiply(d/this.m_impulse.Length()),c=this.m_impulse.x-u,h=this.m_impulse.y-p,i.m_linearVelocity.x+=i.m_invMass*c,i.m_linearVelocity.y+=i.m_invMass*h,i.m_angularVelocity+=i.m_invI*(r*h-o*c)},PXf.prototype.SolvePositionConstraints=function(t){return!0},PXf),b2MouseJointDef$1=(AYf=b2JointDef$1,__extends(BYf,AYf),BYf),b2PrismaticJoint$1=(DYf=b2Joint$1,__extends(EYf,DYf),EYf.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)},EYf.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)},EYf.prototype.GetReactionForce=function(t){return new b2Vec2$1(t*(this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x),t*(this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y))},EYf.prototype.GetReactionTorque=function(t){return t*this.m_impulse.y},EYf.prototype.GetJointTranslation=function(){var t=this.m_bodyA,e=this.m_bodyB,i=t.GetWorldPoint(this.m_localAnchor1),n=e.GetWorldPoint(this.m_localAnchor2),r=n.x-i.x,o=n.y-i.y,s=t.GetWorldVector(this.m_localXAxis1);return s.x*r+s.y*o},EYf.prototype.GetJointSpeed=function(){var t=this.m_bodyA,e=this.m_bodyB,i=t.m_xf.R,n=this.m_localAnchor1.x-t.m_sweep.localCenter.x,r=this.m_localAnchor1.y-t.m_sweep.localCenter.y,o=i.col1.x*n+i.col2.x*r,r=i.col1.y*n+i.col2.y*r,n=o;i=e.m_xf.R;var s=this.m_localAnchor2.x-e.m_sweep.localCenter.x,a=this.m_localAnchor2.y-e.m_sweep.localCenter.y,o=i.col1.x*s+i.col2.x*a,a=i.col1.y*s+i.col2.y*a,s=o,l=t.m_sweep.c.x+n,c=t.m_sweep.c.y+r,h=e.m_sweep.c.x+s-l,u=e.m_sweep.c.y+a-c,p=t.GetWorldVector(this.m_localXAxis1),d=t.m_linearVelocity,_=e.m_linearVelocity,f=t.m_angularVelocity,m=e.m_angularVelocity;return h*(-f*p.y)+u*(f*p.x)+(p.x*(_.x+-m*a-d.x- -f*r)+p.y*(_.y+m*s-d.y-f*n))},EYf.prototype.IsLimitEnabled=function(){return this.m_enableLimit},EYf.prototype.EnableLimit=function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_enableLimit=t},EYf.prototype.GetLowerLimit=function(){return this.m_lowerTranslation},EYf.prototype.GetUpperLimit=function(){return this.m_upperTranslation},EYf.prototype.SetLimits=function(t,e){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_lowerTranslation=t,this.m_upperTranslation=e},EYf.prototype.IsMotorEnabled=function(){return this.m_enableMotor},EYf.prototype.EnableMotor=function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_enableMotor=t},EYf.prototype.SetMotorSpeed=function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_motorSpeed=t},EYf.prototype.GetMotorSpeed=function(){return this.m_motorSpeed},EYf.prototype.SetMaxMotorForce=function(t){this.m_bodyA.SetAwake(!0),this.m_bodyB.SetAwake(!0),this.m_maxMotorForce=t},EYf.prototype.GetMotorForce=function(){return this.m_motorImpulse},EYf.prototype.InitVelocityConstraints=function(t){var e=this.m_bodyA,i=this.m_bodyB;this.m_localCenterA.SetV(e.GetLocalCenter()),this.m_localCenterB.SetV(i.GetLocalCenter());var n=e.GetTransform();i.GetTransform(),a=e.m_xf.R;var r=this.m_localAnchor1.x-this.m_localCenterA.x,o=this.m_localAnchor1.y-this.m_localCenterA.y,s=a.col1.x*r+a.col2.x*o,o=a.col1.y*r+a.col2.y*o,r=s,a=i.m_xf.R,l=this.m_localAnchor2.x-this.m_localCenterB.x,c=this.m_localAnchor2.y-this.m_localCenterB.y;s=a.col1.x*l+a.col2.x*c,c=a.col1.y*l+a.col2.y*c,l=s;var h=i.m_sweep.c.x+l-e.m_sweep.c.x-r,u=i.m_sweep.c.y+c-e.m_sweep.c.y-o;this.m_invMassA=e.m_invMass,this.m_invMassB=i.m_invMass,this.m_invIA=e.m_invI,this.m_invIB=i.m_invI,this.m_axis.SetV(b2Math$1.MulMV(n.R,this.m_localXAxis1)),this.m_a1=(h+r)*this.m_axis.y-(u+o)*this.m_axis.x,this.m_a2=l*this.m_axis.y-c*this.m_axis.x,this.m_motorMass=this.m_invMassA+this.m_invMassB+this.m_invIA*this.m_a1*this.m_a1+this.m_invIB*this.m_a2*this.m_a2,this.m_motorMass>Number.MIN_VALUE&&(this.m_motorMass=1/this.m_motorMass),this.m_perp.SetV(b2Math$1.MulMV(n.R,this.m_localYAxis1)),this.m_s1=(h+r)*this.m_perp.y-(u+o)*this.m_perp.x,this.m_s2=l*this.m_perp.y-c*this.m_perp.x;var p,d,_,f,m,g=this.m_invMassA,y=this.m_invMassB,b=this.m_invIA,v=this.m_invIB;this.m_K.col1.x=g+y+b*this.m_s1*this.m_s1+v*this.m_s2*this.m_s2,this.m_K.col1.y=b*this.m_s1+v*this.m_s2,this.m_K.col1.z=b*this.m_s1*this.m_a1+v*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=b+v,this.m_K.col2.z=b*this.m_a1+v*this.m_a2,this.m_K.col3.x=this.m_K.col1.z,this.m_K.col3.y=this.m_K.col2.z,this.m_K.col3.z=g+y+b*this.m_a1*this.m_a1+v*this.m_a2*this.m_a2,this.m_enableLimit?(p=this.m_axis.x*h+this.m_axis.y*u,b2Math$1.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings$1.b2_linearSlop?this.m_limitState=b2Joint$1.e_equalLimits:p<=this.m_lowerTranslation?this.m_limitState!=b2Joint$1.e_atLowerLimit&&(this.m_limitState=b2Joint$1.e_atLowerLimit,this.m_impulse.z=0):p>=this.m_upperTranslation?this.m_limitState!=b2Joint$1.e_atUpperLimit&&(this.m_limitState=b2Joint$1.e_atUpperLimit,this.m_impulse.z=0):(this.m_limitState=b2Joint$1.e_inactiveLimit,this.m_impulse.z=0)):this.m_limitState=b2Joint$1.e_inactiveLimit,0==this.m_enableMotor&&(this.m_motorImpulse=0),t.warmStarting?(this.m_impulse.x*=t.dtRatio,this.m_impulse.y*=t.dtRatio,this.m_motorImpulse*=t.dtRatio,d=this.m_impulse.x*this.m_perp.x+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.x,_=this.m_impulse.x*this.m_perp.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_axis.y,f=this.m_impulse.x*this.m_s1+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a1,m=this.m_impulse.x*this.m_s2+this.m_impulse.y+(this.m_motorImpulse+this.m_impulse.z)*this.m_a2,e.m_linearVelocity.x-=this.m_invMassA*d,e.m_linearVelocity.y-=this.m_invMassA*_,e.m_angularVelocity-=this.m_invIA*f,i.m_linearVelocity.x+=this.m_invMassB*d,i.m_linearVelocity.y+=this.m_invMassB*_,i.m_angularVelocity+=this.m_invIB*m):(this.m_impulse.SetZero(),this.m_motorImpulse=0)},EYf.prototype.SolveVelocityConstraints=function(t){var e,i,n,r,o,s,a,l,c=this.m_bodyA,h=this.m_bodyB,u=c.m_linearVelocity,p=c.m_angularVelocity,d=h.m_linearVelocity,_=h.m_angularVelocity;this.m_enableMotor&&this.m_limitState!=b2Joint$1.e_equalLimits&&(o=this.m_axis.x*(d.x-u.x)+this.m_axis.y*(d.y-u.y)+this.m_a2*_-this.m_a1*p,s=this.m_motorMass*(this.m_motorSpeed-o),a=this.m_motorImpulse,l=t.dt*this.m_maxMotorForce,this.m_motorImpulse=b2Math$1.Clamp(this.m_motorImpulse+s,-l,l),e=(s=this.m_motorImpulse-a)*this.m_axis.x,i=s*this.m_axis.y,n=s*this.m_a1,r=s*this.m_a2,u.x-=this.m_invMassA*e,u.y-=this.m_invMassA*i,p-=this.m_invIA*n,d.x+=this.m_invMassB*e,d.y+=this.m_invMassB*i,_+=this.m_invIB*r);var f,m,g,y,b,v,x,A=this.m_perp.x*(d.x-u.x)+this.m_perp.y*(d.y-u.y)+this.m_s2*_-this.m_s1*p,S=_-p;r=this.m_enableLimit&&this.m_limitState!=b2Joint$1.e_inactiveLimit?(f=this.m_axis.x*(d.x-u.x)+this.m_axis.y*(d.y-u.y)+this.m_a2*_-this.m_a1*p,m=this.m_impulse.Copy(),g=this.m_K.Solve33(new b2Vec3,-A,-S,-f),this.m_impulse.Add(g),this.m_limitState==b2Joint$1.e_atLowerLimit?this.m_impulse.z=b2Math$1.Max(this.m_impulse.z,0):this.m_limitState==b2Joint$1.e_atUpperLimit&&(this.m_impulse.z=b2Math$1.Min(this.m_impulse.z,0)),y=-A-(this.m_impulse.z-m.z)*this.m_K.col3.x,b=-S-(this.m_impulse.z-m.z)*this.m_K.col3.y,(v=this.m_K.Solve22(new b2Vec2$1,y,b)).x+=m.x,v.y+=m.y,this.m_impulse.x=v.x,this.m_impulse.y=v.y,g.x=this.m_impulse.x-m.x,g.y=this.m_impulse.y-m.y,g.z=this.m_impulse.z-m.z,e=g.x*this.m_perp.x+g.z*this.m_axis.x,i=g.x*this.m_perp.y+g.z*this.m_axis.y,n=g.x*this.m_s1+g.y+g.z*this.m_a1,g.x*this.m_s2+g.y+g.z*this.m_a2):(x=this.m_K.Solve22(new b2Vec2$1,-A,-S),this.m_impulse.x+=x.x,this.m_impulse.y+=x.y,e=x.x*this.m_perp.x,i=x.x*this.m_perp.y,n=x.x*this.m_s1+x.y,x.x*this.m_s2+x.y),u.x-=this.m_invMassA*e,u.y-=this.m_invMassA*i,p-=this.m_invIA*n,d.x+=this.m_invMassB*e,d.y+=this.m_invMassB*i,_+=this.m_invIB*r,c.m_linearVelocity.SetV(u),c.m_angularVelocity=p,h.m_linearVelocity.SetV(d),h.m_angularVelocity=_},EYf.prototype.SolvePositionConstraints=function(t){var e,i,n,r,o=this.m_bodyA,s=this.m_bodyB,a=o.m_sweep.c,l=o.m_sweep.a,c=s.m_sweep.c,h=s.m_sweep.a,u=0,p=!1,d=0,_=b2Mat22$1.FromAngle(l),f=b2Mat22$1.FromAngle(h),m=_,g=this.m_localAnchor1.x-this.m_localCenterA.x,y=this.m_localAnchor1.y-this.m_localCenterA.y,b=m.col1.x*g+m.col2.x*y,y=m.col1.y*g+m.col2.y*y,g=b;m=f;var v=this.m_localAnchor2.x-this.m_localCenterB.x,x=this.m_localAnchor2.y-this.m_localCenterB.y;b=m.col1.x*v+m.col2.x*x,x=m.col1.y*v+m.col2.y*x,v=b;var A,S=c.x+v-a.x-g,w=c.y+x-a.y-y;this.m_enableLimit&&(this.m_axis=b2Math$1.MulMV(_,this.m_localXAxis1),this.m_a1=(S+g)*this.m_axis.y-(w+y)*this.m_axis.x,this.m_a2=v*this.m_axis.y-x*this.m_axis.x,A=this.m_axis.x*S+this.m_axis.y*w,b2Math$1.Abs(this.m_upperTranslation-this.m_lowerTranslation)<2*b2Settings$1.b2_linearSlop?(d=b2Math$1.Clamp(A,-b2Settings$1.b2_maxLinearCorrection,b2Settings$1.b2_maxLinearCorrection),u=b2Math$1.Abs(A),p=!0):A<=this.m_lowerTranslation?(d=b2Math$1.Clamp(A-this.m_lowerTranslation+b2Settings$1.b2_linearSlop,-b2Settings$1.b2_maxLinearCorrection,0),u=this.m_lowerTranslation-A,p=!0):A>=this.m_upperTranslation&&(d=b2Math$1.Clamp(A-this.m_upperTranslation+b2Settings$1.b2_linearSlop,0,b2Settings$1.b2_maxLinearCorrection),u=A-this.m_upperTranslation,p=!0)),this.m_perp=b2Math$1.MulMV(_,this.m_localYAxis1),this.m_s1=(S+g)*this.m_perp.y-(w+y)*this.m_perp.x,this.m_s2=v*this.m_perp.y-x*this.m_perp.x;var C,P,E,T,M=new b2Vec3,D=this.m_perp.x*S+this.m_perp.y*w,I=h-l-this.m_refAngle,u=b2Math$1.Max(u,b2Math$1.Abs(D)),O=b2Math$1.Abs(I);p?(e=this.m_invMassA,i=this.m_invMassB,n=this.m_invIA,r=this.m_invIB,this.m_K.col1.x=e+i+n*this.m_s1*this.m_s1+r*this.m_s2*this.m_s2,this.m_K.col1.y=n*this.m_s1+r*this.m_s2,this.m_K.col1.z=n*this.m_s1*this.m_a1+r*this.m_s2*this.m_a2,this.m_K.col2.x=this.m_K.col1.y,this.m_K.col2.y=n+r,this.m_K.col2.z=n*this.m_a1+r*this.m_a2,this.m_K.col3.x=this.m_K.col1.z,this.m_K.col3.y=this.m_K.col2.z,this.m_K.col3.z=e+i+n*this.m_a1*this.m_a1+r*this.m_a2*this.m_a2,this.m_K.Solve33(M,-D,-I,-d)):(e=this.m_invMassA,i=this.m_invMassB,n=this.m_invIA,r=this.m_invIB,C=e+i+n*this.m_s1*this.m_s1+r*this.m_s2*this.m_s2,P=n*this.m_s1+r*this.m_s2,E=n+r,this.m_K.col1.Set(C,P,0),this.m_K.col2.Set(P,E,0),T=this.m_K.Solve22(new b2Vec2$1,-D,-I),M.x=T.x,M.y=T.y,M.z=0);var L=M.x*this.m_perp.x+M.z*this.m_axis.x,F=M.x*this.m_perp.y+M.z*this.m_axis.y,B=M.x*this.m_s1+M.y+M.z*this.m_a1,N=M.x*this.m_s2+M.y+M.z*this.m_a2;return a.x-=this.m_invMassA*L,a.y-=this.m_invMassA*F,l-=this.m_invIA*B,c.x+=this.m_invMassB*L,c.y+=this.m_invMassB*F,h+=this.m_invIB*N,o.m_sweep.a=l,s.m_sweep.a=h,o.SynchronizeTransform(),s.SynchronizeTransform(),u<=b2Settings$1.b2_linearSlop&&O<=b2Settings$1.b2_angularSlop},EYf),b2PrismaticJointDef$1=(N$f=b2JointDef$1,__extends(O$f,N$f),O$f.prototype.Initialize=function(t,e,i,n){this.bodyA=t,this.bodyB=e,this.localAnchorA=this.bodyA.GetLocalPoint(i),this.localAnchorB=this.bodyB.GetLocalPoint(i),this.localAxisA=this.bodyA.GetLocalVector(n),this.referenceAngle=this.bodyB.GetAngle()-this.bodyA.GetAngle()},O$f),b2PulleyJoint$1=(U$f=b2Joint$1,__extends(V$f,U$f),V$f.prototype.GetAnchorA=function(){return this.m_bodyA.GetWorldPoint(this.m_localAnchor1)},V$f.prototype.GetAnchorB=function(){return this.m_bodyB.GetWorldPoint(this.m_localAnchor2)},V$f.prototype.GetReactionForce=function(t){return new b2Vec2$1(t*this.m_impulse*this.m_u2.x,t*this.m_impulse*this.m_u2.y)},V$f.prototype.GetReactionTorque=function(t){return 0},V$f.prototype.GetGroundAnchorA=function(){var t=this.m_ground.m_xf.position.Copy();return t.Add(this.m_groundAnchor1),t},V$f.prototype.GetGroundAnchorB=function(){var t=this.m_ground.m_xf.position.Copy();return t.Add(this.m_groundAnchor2),t},V$f.prototype.GetLength1=function(){var t=this.m_bodyA.GetWorldPoint(this.m_localAnchor1),e=this.m_ground.m_xf.position.x+this.m_groundAnchor1.x,i=this.m_ground.m_xf.position.y+this.m_groundAnchor1.y,n=t.x-e,r=t.y-i;return Math.sqrt(n*n+r*r)},V$f.prototype.GetLength2=function(){var t=this.m_bodyB.GetWorldPoint(this.m_localAnchor2),e=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,i=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y,n=t.x-e,r=t.y-i;return Math.sqrt(n*n+r*r)},V$f.prototype.GetRatio=function(){return this.m_ratio},V$f.prototype.InitVelocityConstraints=function(t){var e=this.m_bodyA,i=this.m_bodyB,n=e.m_xf.R,r=this.m_localAnchor1.x-e.m_sweep.localCenter.x,o=this.m_localAnchor1.y-e.m_sweep.localCenter.y,s=n.col1.x*r+n.col2.x*o,o=n.col1.y*r+n.col2.y*o,r=s;n=i.m_xf.R;var a=this.m_localAnchor2.x-i.m_sweep.localCenter.x,l=this.m_localAnchor2.y-i.m_sweep.localCenter.y,s=n.col1.x*a+n.col2.x*l,l=n.col1.y*a+n.col2.y*l,a=s,c=e.m_sweep.c.x+r,h=e.m_sweep.c.y+o,u=i.m_sweep.c.x+a,p=i.m_sweep.c.y+l,d=this.m_ground.m_xf.position.x+this.m_groundAnchor1.x,_=this.m_ground.m_xf.position.y+this.m_groundAnchor1.y,f=this.m_ground.m_xf.position.x+this.m_groundAnchor2.x,m=this.m_ground.m_xf.position.y+this.m_groundAnchor2.y;this.m_u1.Set(c-d,h-_),this.m_u2.Set(u-f,p-m);var g=this.m_u1.Length(),y=this.m_u2.Length();g>b2Settings$1.b2_linearSlop?this.m_u1.Multiply(1/g):this.m_u1.SetZero(),y>b2Settings$1.b2_linearSlop?this.m_u2.Multiply(1/y):this.m_u2.SetZero(),0b2Settings$1.b2_linearSlop?this.m_u1.Multiply(1/h):this.m_u1.SetZero(),u>b2Settings$1.b2_linearSlop?this.m_u2.Multiply(1/u):this.m_u2.SetZero(),p=this.m_constant-h-this.m_ratio*u,x=b2Math$1.Max(x,-p),p=b2Math$1.Clamp(p+b2Settings$1.b2_linearSlop,-b2Settings$1.b2_maxLinearCorrection,0),s=-(d=-this.m_pulleyMass*p)*this.m_u1.x,a=-d*this.m_u1.y,l=-this.m_ratio*d*this.m_u2.x,c=-this.m_ratio*d*this.m_u2.y,f.m_sweep.c.x+=f.m_invMass*s,f.m_sweep.c.y+=f.m_invMass*a,f.m_sweep.a+=f.m_invI*(i*a-n*s),m.m_sweep.c.x+=m.m_invMass*l,m.m_sweep.c.y+=m.m_invMass*c,m.m_sweep.a+=m.m_invI*(r*c-o*l),f.SynchronizeTransform(),m.SynchronizeTransform()),this.m_limitState1==b2Joint$1.e_atUpperLimit&&(e=f.m_xf.R,i=this.m_localAnchor1.x-f.m_sweep.localCenter.x,n=this.m_localAnchor1.y-f.m_sweep.localCenter.y,_=e.col1.x*i+e.col2.x*n,n=e.col1.y*i+e.col2.y*n,i=_,s=f.m_sweep.c.x+i,a=f.m_sweep.c.y+n,this.m_u1.Set(s-g,a-y),(h=this.m_u1.Length())>b2Settings$1.b2_linearSlop?(this.m_u1.x*=1/h,this.m_u1.y*=1/h):this.m_u1.SetZero(),p=this.m_maxLength1-h,x=b2Math$1.Max(x,-p),p=b2Math$1.Clamp(p+b2Settings$1.b2_linearSlop,-b2Settings$1.b2_maxLinearCorrection,0),s=-(d=-this.m_limitMass1*p)*this.m_u1.x,a=-d*this.m_u1.y,f.m_sweep.c.x+=f.m_invMass*s,f.m_sweep.c.y+=f.m_invMass*a,f.m_sweep.a+=f.m_invI*(i*a-n*s),f.SynchronizeTransform()),this.m_limitState2==b2Joint$1.e_atUpperLimit&&(e=m.m_xf.R,r=this.m_localAnchor2.x-m.m_sweep.localCenter.x,o=this.m_localAnchor2.y-m.m_sweep.localCenter.y,_=e.col1.x*r+e.col2.x*o,o=e.col1.y*r+e.col2.y*o,r=_,l=m.m_sweep.c.x+r,c=m.m_sweep.c.y+o,this.m_u2.Set(l-b,c-v),(u=this.m_u2.Length())>b2Settings$1.b2_linearSlop?(this.m_u2.x*=1/u,this.m_u2.y*=1/u):this.m_u2.SetZero(),p=this.m_maxLength2-u,x=b2Math$1.Max(x,-p),p=b2Math$1.Clamp(p+b2Settings$1.b2_linearSlop,-b2Settings$1.b2_maxLinearCorrection,0),l=-(d=-this.m_limitMass2*p)*this.m_u2.x,c=-d*this.m_u2.y,m.m_sweep.c.x+=m.m_invMass*l,m.m_sweep.c.y+=m.m_invMass*c,m.m_sweep.a+=m.m_invI*(r*c-o*l),m.SynchronizeTransform()),x=this.m_upperAngle?(this.m_limitState!=b2Joint$1.e_atUpperLimit&&(this.m_impulse.z=0),this.m_limitState=b2Joint$1.e_atUpperLimit):(this.m_limitState=b2Joint$1.e_inactiveLimit,this.m_impulse.z=0)):this.m_limitState=b2Joint$1.e_inactiveLimit,t.warmStarting?(this.m_impulse.x*=t.dtRatio,this.m_impulse.y*=t.dtRatio,this.m_motorImpulse*=t.dtRatio,h=this.m_impulse.x,u=this.m_impulse.y,e.m_linearVelocity.x-=p*h,e.m_linearVelocity.y-=p*u,e.m_angularVelocity-=_*(n*u-r*h+this.m_motorImpulse+this.m_impulse.z),i.m_linearVelocity.x+=d*h,i.m_linearVelocity.y+=d*u,i.m_angularVelocity+=f*(a*u-l*h+this.m_motorImpulse+this.m_impulse.z)):(this.m_impulse.SetZero(),this.m_motorImpulse=0)},N0f.prototype.SolveVelocityConstraints=function(t){var e,i,n,r,o,s,a,l,c,h,u,p,d,_,f,m=this.m_bodyA,g=this.m_bodyB,y=m.m_linearVelocity,b=m.m_angularVelocity,v=g.m_linearVelocity,x=g.m_angularVelocity,A=m.m_invMass,S=g.m_invMass,w=m.m_invI,C=g.m_invI;this.m_enableMotor&&this.m_limitState!=b2Joint$1.e_equalLimits&&(a=x-b-this.m_motorSpeed,l=this.m_motorMass*-a,c=this.m_motorImpulse,h=t.dt*this.m_maxMotorTorque,this.m_motorImpulse=b2Math$1.Clamp(this.m_motorImpulse+l,-h,h),b-=w*(l=this.m_motorImpulse-c),x+=C*l),this.m_enableLimit&&this.m_limitState!=b2Joint$1.e_inactiveLimit?(e=m.m_xf.R,n=this.m_localAnchor1.x-m.m_sweep.localCenter.x,r=this.m_localAnchor1.y-m.m_sweep.localCenter.y,i=e.col1.x*n+e.col2.x*r,r=e.col1.y*n+e.col2.y*r,n=i,e=g.m_xf.R,o=this.m_localAnchor2.x-g.m_sweep.localCenter.x,s=this.m_localAnchor2.y-g.m_sweep.localCenter.y,i=e.col1.x*o+e.col2.x*s,s=e.col1.y*o+e.col2.y*s,o=i,u=v.x+-x*s-y.x- -b*r,p=v.y+x*o-y.y-b*n,d=x-b,this.m_mass.Solve33(this.impulse3,-u,-p,-d),this.m_limitState==b2Joint$1.e_equalLimits?this.m_impulse.Add(this.impulse3):this.m_limitState==b2Joint$1.e_atLowerLimit?this.m_impulse.z+this.impulse3.z<0&&(this.m_mass.Solve22(this.reduced,-u,-p),this.impulse3.x=this.reduced.x,this.impulse3.y=this.reduced.y,this.impulse3.z=-this.m_impulse.z,this.m_impulse.x+=this.reduced.x,this.m_impulse.y+=this.reduced.y,this.m_impulse.z=0):this.m_limitState==b2Joint$1.e_atUpperLimit&&0>>0,this._g=255*b2Math$1.Clamp(e,0,1)>>>0,this._b=255*b2Math$1.Clamp(i,0,1)>>>0}function CPf(){this.m_normal=new b2Vec2$1,this.m_points=new Array(b2Settings$1.b2_maxManifoldPoints);for(var t=0;t>>0,this._g=255*b2Math.b2Clamp(e,0,1)>>>0,this._b=255*b2Math.b2Clamp(i,0,1)>>>0}function Tef(){}function Bef(){this.p1=new b2Vec2,this.p2=new b2Vec2}function vef(){}function qef(){this.__fast__=!0,this.pointCount=0,this.points=new Array(b2Settings.b2_maxManifoldPoints);for(var t=0;t-1.5*b2Settings$1.b2_linearSlop},Tag.s_worldManifold=new b2WorldManifold,Tag.s_psm=new b2PositionSolverManifold,Tag),b2EdgeAndCircleContact=(Gdg=b2Contact$1,__extends(Hdg,Gdg),Hdg.Create=function(t){return new Hdg},Hdg.Destroy=function(t,e){},Hdg.prototype.Reset=function(t,e){Gdg.prototype.Reset.call(this,t,e)},Hdg.prototype.Evaluate=function(){var t=this.m_fixtureA.GetBody(),e=this.m_fixtureB.GetBody();this.b2CollideEdgeAndCircle(this.m_manifold,this.m_fixtureA.GetShape(),t.m_xf,this.m_fixtureB.GetShape(),e.m_xf)},Hdg.prototype.b2CollideEdgeAndCircle=function(t,e,i,n,r){},Hdg),b2PolyAndCircleContact$1=(Udg=b2Contact$1,__extends(Vdg,Udg),Vdg.Create=function(t){return new Vdg},Vdg.Destroy=function(t,e){},Vdg.prototype.Reset=function(t,e){Udg.prototype.Reset.call(this,t,e),b2Settings$1.b2Assert(t.GetType()==b2Shape$1.e_polygonShape),b2Settings$1.b2Assert(e.GetType()==b2Shape$1.e_circleShape)},Vdg.prototype.Evaluate=function(){var t=this.m_fixtureA.m_body,e=this.m_fixtureB.m_body;b2Collision$1.CollidePolygonAndCircle(this.m_manifold,this.m_fixtureA.GetShape(),t.m_xf,this.m_fixtureB.GetShape(),e.m_xf)},Vdg),b2PolyAndEdgeContact=(beg=b2Contact$1,__extends(ceg,beg),ceg.Create=function(t){return new ceg},ceg.Destroy=function(t,e){},ceg.prototype.Reset=function(t,e){beg.prototype.Reset.call(this,t,e),b2Settings$1.b2Assert(t.GetType()==b2Shape$1.e_polygonShape),b2Settings$1.b2Assert(e.GetType()==b2Shape$1.e_edgeShape)},ceg.prototype.Evaluate=function(){var t=this.m_fixtureA.GetBody(),e=this.m_fixtureB.GetBody();this.b2CollidePolyAndEdge(this.m_manifold,this.m_fixtureA.GetShape(),t.m_xf,this.m_fixtureB.GetShape(),e.m_xf)},ceg.prototype.b2CollidePolyAndEdge=function(t,e,i,n,r){},ceg),b2PolygonContact$1=(peg=b2Contact$1,__extends(qeg,peg),qeg.Create=function(t){return new qeg},qeg.Destroy=function(t,e){},qeg.prototype.Reset=function(t,e){peg.prototype.Reset.call(this,t,e)},qeg.prototype.Evaluate=function(){var t=this.m_fixtureA.GetBody(),e=this.m_fixtureB.GetBody();b2Collision$1.CollidePolygons(this.m_manifold,this.m_fixtureA.GetShape(),t.m_xf,this.m_fixtureB.GetShape(),e.m_xf)},qeg),b2CircleContact$1=(yeg=b2Contact$1,__extends(zeg,yeg),zeg.Create=function(t){return new zeg},zeg.Destroy=function(t,e){},zeg.prototype.Reset=function(t,e){yeg.prototype.Reset.call(this,t,e)},zeg.prototype.Evaluate=function(){var t=this.m_fixtureA.GetBody(),e=this.m_fixtureB.GetBody();b2Collision$1.CollideCircles(this.m_manifold,this.m_fixtureA.GetShape(),t.m_xf,this.m_fixtureB.GetShape(),e.m_xf)},zeg),b2ControllerEdge=function(){},b2Controller=(Heg.prototype.Step=function(t){},Heg.prototype.Draw=function(t){},Heg.prototype.AddBody=function(t){var e=new b2ControllerEdge;e.controller=this,e.body=t,e.nextBody=this.m_bodyList,e.prevBody=null,(this.m_bodyList=e).nextBody&&(e.nextBody.prevBody=e),this.m_bodyCount++,e.nextController=t.m_controllerList,e.prevController=null,(t.m_controllerList=e).nextController&&(e.nextController.prevController=e),t.m_controllerCount++},Heg.prototype.RemoveBody=function(t){for(var e=t.m_controllerList;e&&e.controller!=this;)e=e.nextController;e.prevBody&&(e.prevBody.nextBody=e.nextBody),e.nextBody&&(e.nextBody.prevBody=e.prevBody),e.nextController&&(e.nextController.prevController=e.prevController),e.prevController&&(e.prevController.nextController=e.nextController),this.m_bodyList==e&&(this.m_bodyList=e.nextBody),t.m_controllerList==e&&(t.m_controllerList=e.nextController),t.m_controllerCount--,this.m_bodyCount--},Heg.prototype.Clear=function(){for(;this.m_bodyList;)this.RemoveBody(this.m_bodyList.body)},Heg.prototype.GetNext=function(){return this.m_next},Heg.prototype.GetWorld=function(){return this.m_world},Heg.prototype.GetBodyList=function(){return this.m_bodyList},Heg),B2D={b2CircleShape:b2CircleShape$1,b2EdgeShape:b2EdgeShape,b2MassData:b2MassData$1,b2PolygonShape:b2PolygonShape$1,b2Shape:b2Shape$1,b2AABB:b2AABB$1,b2Collision:b2Collision$1,b2ContactID:b2ContactID$1,b2ContactPoint:b2ContactPoint$1,b2Distance:b2Distance$1,b2DistanceInput:b2DistanceInput,b2DistanceOutput:b2DistanceOutput,b2DistanceProxy:b2DistanceProxy,b2DynamicTree:b2DynamicTree,b2DynamicTreeBroadPhase:b2DynamicTreeBroadPhase,b2DynamicTreeNode:b2DynamicTreeNode,b2DynamicTreePair:b2DynamicTreePair,b2Manifold:b2Manifold$1,b2ManifoldPoint:b2ManifoldPoint$1,b2OBB:b2OBB$1,b2RayCastInput:b2RayCastInput,b2RayCastOutput:b2RayCastOutput,b2SeparationFunction:b2SeparationFunction,b2Simplex:b2Simplex,b2SimplexCache:b2SimplexCache,b2SimplexVertex:b2SimplexVertex,b2TimeOfImpact:b2TimeOfImpact$1,b2TOIInput:b2TOIInput,b2WorldManifold:b2WorldManifold,ClipVertex:ClipVertex$1,Features:Features$1,b2Mat22:b2Mat22$1,b2Mat33:b2Mat33,b2Math:b2Math$1,b2Sweep:b2Sweep$1,b2Transform:b2Transform,b2Vec2:b2Vec2$1,b2Vec3:b2Vec3,b2Color:b2Color$1,b2Settings:b2Settings$1,b2CircleContact:b2CircleContact$1,b2Contact:b2Contact$1,b2ContactConstraint:b2ContactConstraint$1,b2ContactConstraintPoint:b2ContactConstraintPoint$1,b2ContactEdge:b2ContactEdge$1,b2ContactFactory:b2ContactFactory,b2ContactRegister:b2ContactRegister$1,b2ContactSolver:b2ContactSolver$1,b2EdgeAndCircleContact:b2EdgeAndCircleContact,b2PolyAndCircleContact:b2PolyAndCircleContact$1,b2PolyAndEdgeContact:b2PolyAndEdgeContact,b2PolygonContact:b2PolygonContact$1,b2PositionSolverManifold:b2PositionSolverManifold,b2Controller:b2Controller,b2ControllerEdge:b2ControllerEdge,b2DistanceJoint:b2DistanceJoint$1,b2DistanceJointDef:b2DistanceJointDef$1,b2FrictionJoint:b2FrictionJoint,b2FrictionJointDef:b2FrictionJointDef,b2GearJoint:b2GearJoint$1,b2GearJointDef:b2GearJointDef$1,b2Jacobian:b2Jacobian$1,b2Joint:b2Joint$1,b2JointDef:b2JointDef$1,b2JointEdge:b2JointEdge$1,b2LineJoint:b2LineJoint,b2LineJointDef:b2LineJointDef,b2MouseJoint:b2MouseJoint$1,b2MouseJointDef:b2MouseJointDef$1,b2PrismaticJoint:b2PrismaticJoint$1,b2PrismaticJointDef:b2PrismaticJointDef$1,b2PulleyJoint:b2PulleyJoint$1,b2PulleyJointDef:b2PulleyJointDef$1,b2RevoluteJoint:b2RevoluteJoint$1,b2RevoluteJointDef:b2RevoluteJointDef$1,b2WeldJoint:b2WeldJoint,b2WeldJointDef:b2WeldJointDef,b2Body:b2Body$1,b2BodyDef:b2BodyDef$1,b2ContactFilter:b2ContactFilter$1,b2ContactImpulse:b2ContactImpulse,b2ContactListener:b2ContactListener$1,b2ContactManager:b2ContactManager$1,b2DebugDraw:b2DebugDraw$1,b2DestructionListener:b2DestructionListener$1,b2FilterData:b2FilterData$1,b2Fixture:b2Fixture,b2FixtureDef:b2FixtureDef,b2Island:b2Island$1,b2TimeStep:b2TimeStep$1,b2World:b2World$1},_a$2,sayHello=!0,B2D_MAPPING=(_a$2={},_a$2.new=B2D,_a$2.legacy=B2D_LEGACY,_a$2.none=null,_a$2),BOX2D_PREFERENCE={version:"none",custom:void 0,get prefer(){if(sayHello&&(console.debug("B2D Version - ",this.version),sayHello=!1),"custom"!==this.version)return B2D_MAPPING[this.version]?B2D_MAPPING[this.version]:B2D_MAPPING.none;if(!this.custom)throw new Error("Custom Box2D should be assigned to `custom` field");return this.custom}},IS_EXTERNAL_CLASS=Symbol("External class marker"),LONG_NAMES=/nape./,extClassLib=void 0,yeg,peg,beg,Udg,Gdg;function Heg(){}function zeg(){return null!==yeg&&yeg.apply(this,arguments)||this}function qeg(){return null!==peg&&peg.apply(this,arguments)||this}function ceg(){return null!==beg&&beg.apply(this,arguments)||this}function Vdg(){return null!==Udg&&Udg.apply(this,arguments)||this}function Hdg(){return null!==Gdg&&Gdg.apply(this,arguments)||this}function Tag(){this.m_step=new b2TimeStep$1,this.m_constraints=new Array}function Aag(t){this.m_allocator=t,this.InitializeRegisters()}function X9f(){this.__fast__=!0,this.m_nodeA=new b2ContactEdge$1,this.m_nodeB=new b2ContactEdge$1,this.m_manifold=new b2Manifold$1,this.m_oldManifold=new b2Manifold$1}function b8f(t,e){this.__fast__=!0,this.m_xf=new b2Transform,this.m_sweep=new b2Sweep$1,this.m_linearVelocity=new b2Vec2$1,this.m_force=new b2Vec2$1,this.m_flags=0,t.bullet&&(this.m_flags|=b8f.e_bulletFlag),t.fixedRotation&&(this.m_flags|=b8f.e_fixedRotationFlag),t.allowSleep&&(this.m_flags|=b8f.e_allowSleepFlag),t.awake&&(this.m_flags|=b8f.e_awakeFlag),t.active&&(this.m_flags|=b8f.e_activeFlag),this.m_world=e,this.m_xf.position.SetV(t.position),this.m_xf.R.Set(t.angle),this.m_sweep.localCenter.SetZero(),this.m_sweep.t0=1,this.m_sweep.a0=this.m_sweep.a=t.angle;var i=this.m_xf.R,n=this.m_sweep.localCenter;this.m_sweep.c.x=i.col1.x*n.x+i.col2.x*n.y,this.m_sweep.c.y=i.col1.y*n.x+i.col2.y*n.y,this.m_sweep.c.x+=this.m_xf.position.x,this.m_sweep.c.y+=this.m_xf.position.y,this.m_sweep.c0.SetV(this.m_sweep.c),this.m_jointList=null,this.m_controllerList=null,this.m_contactList=null,this.m_controllerCount=0,this.m_prev=null,this.m_next=null,this.m_linearVelocity.SetV(t.linearVelocity),this.m_angularVelocity=t.angularVelocity,this.m_linearDamping=t.linearDamping,this.m_angularDamping=t.angularDamping,this.m_force.Set(0,0),this.m_torque=0,this.m_sleepTime=0,this.m_type=t.type,this.m_type==b8f.b2_dynamicBody?(this.m_mass=1,this.m_invMass=1):(this.m_mass=0,this.m_invMass=0),this.m_I=0,this.m_invI=0,this.m_inertiaScale=t.inertiaScale,this.m_userData=t.userData,this.m_fixtureList=null,this.m_fixtureCount=0}function _4f(t,e){this.__fast__=!0,this.s_stack=new Array,this.m_contactManager=new b2ContactManager$1,this.m_contactSolver=new b2ContactSolver$1,this.m_island=new b2Island$1,this.m_destructionListener=null,this.m_debugDraw=null,this.m_bodyList=null,this.m_contactList=null,this.m_jointList=null,this.m_controllerList=null,this.m_bodyCount=0,this.m_contactCount=0,this.m_jointCount=0,this.m_controllerCount=0,_4f.m_warmStarting=!0,_4f.m_continuousPhysics=!0,this.m_allowSleep=e,this.m_gravity=t,this.m_inv_dt0=0,this.m_contactManager.m_world=this;var i=new b2BodyDef$1;this.m_groundBody=this.CreateBody(i)}function getExtClassField(t,e){void 0===e&&(e=void 0);var i=extClassLib=extClassLib||BOX2D_PREFERENCE.prefer;if(!i||!t)return null;if(!e||void 0!==i[t])return i[t];if(!e)return null;for(var n=i,r=0,o=e.split(".");r=Bytecode.LI8&&S<=Bytecode.SF64}var U=t.parameters,j="[stack underrun]",G=0;if(L(1),1&o){for(var z=[],$=0;$ "+tt.returnTypeId);var it,nt=function(t){return 0<=tt.stack-1-t?"stack"+(tt.stack-1-t):"/*"+j+" "+(tt.stack-1-t)+"*/ stack0"},rt=nt(0),ot=nt(1),st=nt(2),at=nt(3),lt=nt(-1),ct=0 0;");break;case Bytecode.IN:D.push(I+" "+ot+" = ("+ot+" && "+ot+".axClass === sec.AXQName) ? obj.axHasProperty("+ot+".name) : "+rt+".axHasPublicProperty("+ot+");");break;case Bytecode.DUP:D.push(I+" "+lt+" = "+rt+";");break;case Bytecode.POP:break;case Bytecode.SWAP:D.push(I+" temp = "+rt+";"),D.push(I+" "+rt+" = "+ot+";"),D.push(I+" "+ot+" = temp;"),D.push(I+" temp = undefined;");break;case Bytecode.PUSHTRUE:D.push(I+" "+lt+" = true;");break;case Bytecode.PUSHFALSE:D.push(I+" "+lt+" = false;");break;case Bytecode.PUSHBYTE:case Bytecode.PUSHSHORT:D.push(I+" "+lt+" = "+pt(0)+";");break;case Bytecode.PUSHINT:D.push(I+" "+lt+" = "+w.ints[pt(0)]+";");break;case Bytecode.PUSHUINT:D.push(I+" "+lt+" = "+w.uints[pt(0)]+";");break;case Bytecode.PUSHDOUBLE:D.push(I+" "+lt+" = "+w.doubles[pt(0)]+";");break;case Bytecode.PUSHSTRING:D.push(I+" "+lt+" = "+JSON.stringify(w.getString(pt(0)))+";");break;case Bytecode.PUSHNAN:D.push(I+" "+lt+" = NaN;");break;case Bytecode.PUSHNULL:D.push(I+" "+lt+" = null;");break;case Bytecode.PUSHUNDEFINED:D.push(I+" "+lt+" = undefined;");break;case Bytecode.IFEQ:D.push(I+" if ("+rt+" == "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFNE:D.push(I+" if ("+rt+" != "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFSTRICTEQ:D.push(I+" if ("+rt+" === "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFSTRICTNE:D.push(I+" if ("+rt+" !== "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFGT:D.push(I+" if ("+rt+" < "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFGE:D.push(I+" if ("+rt+" <= "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFLT:D.push(I+" if ("+rt+" > "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFLE:D.push(I+" if ("+rt+" >= "+ot+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFFALSE:D.push(I+" if (!"+rt+") { p = "+pt(0)+"; continue; };");break;case Bytecode.IFTRUE:D.push(I+" if ("+rt+") { p = "+pt(0)+"; continue; };");break;case Bytecode.LOOKUPSWITCH:var _t=tt.params.concat(),ft=_t.shift();D.push(I+" if ("+rt+" >= 0 && "+rt+" < "+_t.length+") { p = ["+_t.join(", ")+"]["+rt+"]; continue; } else { p = "+ft+"; continue; };");break;case Bytecode.JUMP:D.push(I+" { p = "+pt(0)+"; continue; };");break;case Bytecode.INCREMENT:D.push(I+" "+rt+"++;");break;case Bytecode.DECREMENT:D.push(I+" "+rt+"--;");break;case Bytecode.INCLOCAL:D.push(I+" "+ut(pt(0))+"++;");break;case Bytecode.DECLOCAL:D.push(I+" "+ut(pt(0))+"--;");break;case Bytecode.INCREMENT_I:D.push(I+" "+rt+" |= 0;"),D.push(I+" "+rt+"++;");break;case Bytecode.DECREMENT_I:D.push(I+" "+rt+" |= 0;"),D.push(I+" "+rt+"--;");break;case Bytecode.INCLOCAL_I:D.push(I+" "+ut(pt(0))+" |= 0;"),D.push(I+" "+ut(pt(0))+"++;");break;case Bytecode.DECLOCAL_I:D.push(I+" "+ut(pt(0))+" |= 0;"),D.push(I+" "+ut(pt(0))+"--;");break;case Bytecode.NEGATE_I:D.push(I+" "+rt+" = -("+rt+" | 0);");break;case Bytecode.ADD_I:D.push(I+" "+ot+" = ("+ot+" | 0) + ("+rt+" | 0);");break;case Bytecode.SUBTRACT_I:D.push(I+" "+ot+" = ("+ot+" | 0) - ("+rt+" | 0);");break;case Bytecode.MULTIPLY_I:D.push(I+" "+ot+" = ("+ot+" | 0) * ("+rt+" | 0);");break;case Bytecode.ADD:D.push(I+" "+ot+" += "+rt+";");break;case Bytecode.SUBTRACT:D.push(I+" "+ot+" -= "+rt+";");break;case Bytecode.MULTIPLY:D.push(I+" "+ot+" *= "+rt+";");break;case Bytecode.DIVIDE:D.push(I+" "+ot+" /= "+rt+";");break;case Bytecode.MODULO:D.push(I+" "+ot+" %= "+rt+";");break;case Bytecode.LSHIFT:D.push(I+" "+ot+" <<= "+rt+";");break;case Bytecode.RSHIFT:D.push(I+" "+ot+" >>= "+rt+";");break;case Bytecode.URSHIFT:D.push(I+" "+ot+" >>>= "+rt+";");break;case Bytecode.BITAND:D.push(I+" "+ot+" &= "+rt+";");break;case Bytecode.BITOR:D.push(I+" "+ot+" |= "+rt+";");break;case Bytecode.BITXOR:D.push(I+" "+ot+" ^= "+rt+";");break;case Bytecode.EQUALS:D.push(I+" "+ot+" = "+ot+" == "+rt+";");break;case Bytecode.STRICTEQUALS:D.push(I+" "+ot+" = "+ot+" === "+rt+";");break;case Bytecode.GREATERTHAN:D.push(I+" "+ot+" = "+ot+" > "+rt+";");break;case Bytecode.GREATEREQUALS:D.push(I+" "+ot+" = "+ot+" >= "+rt+";");break;case Bytecode.LESSTHAN:D.push(I+" "+ot+" = "+ot+" < "+rt+";");break;case Bytecode.LESSEQUALS:D.push(I+" "+ot+" = "+ot+" <= "+rt+";");break;case Bytecode.NOT:D.push(I+" "+rt+" = !"+rt+";");break;case Bytecode.BITNOT:D.push(I+" "+rt+" = ~"+rt+";");break;case Bytecode.NEGATE:D.push(I+" "+rt+" = -"+rt+";");break;case Bytecode.TYPEOF:D.push(I+" "+rt+" = typeof "+rt+" === 'undefined' ? 'undefined' : context.typeof("+rt+");");break;case Bytecode.INSTANCEOF:D.push(I+" "+ot+" = "+rt+".axIsInstanceOf("+ot+");");break;case Bytecode.ISTYPE:D.push(I+" "+rt+" = "+ct+".getScopeProperty("+J(pt(0))+", true, false).axIsType("+rt+");");break;case Bytecode.ISTYPELATE:D.push(I+" "+ot+" = "+rt+".axIsType("+ot+");");break;case Bytecode.ASTYPE:D.push(I+" "+rt+" = "+ct+".getScopeProperty("+J(pt(0))+", true, false).axAsType("+rt+");");break;case Bytecode.ASTYPELATE:D.push(I+" "+ot+" = "+emitIsAXOrPrimitive(ot)+" ? "+rt+".axAsType("+ot+") : "+ot+";");break;case Bytecode.CALL:for(var mt=[],gt=nt(pt(0)+1),yt=1;yt<=pt(0);yt++)mt.push(nt(pt(0)-yt));s(blockSaver)&&blockSaver.safe(gt)&&D.push(I+" /* This call maybe a safe, "+blockSaver.constructor.name+" */"),D.push(I+" "+gt+" = context.call("+nt(pt(0)+1)+", "+nt(pt(0))+", ["+mt.join(", ")+"]);");break;case Bytecode.CONSTRUCT:for(var bt=[],yt=1;yt<=pt(0);yt++)bt.push(nt(pt(0)-yt));D.push(I+" "+nt(pt(0))+" = context.construct("+nt(pt(0))+", ["+bt.join(", ")+"]);");break;case Bytecode.CALLPROPERTY:var vt=w.getMultiname(pt(1)),xt=[];for(yt=0;yt<=pt(0);yt++)xt.push(nt(pt(0)-yt));var At=xt.shift();"getDefinitionByName"==w.getMultiname(pt(1)).name?D.push(I+" "+nt(pt(0))+" = context.getdefinitionbyname("+ct+", "+At+", ["+xt.join(", ")+"]);"):(needFastCheck()&&(D.push(I+" if (!"+emitIsAXOrPrimitive(At)+") {"),D.push(I+" "+nt(pt(0))+" = "+At+"['"+vt.name+"']("+xt.join(", ")+");"),D.push(I+" } else {"),L(1)),D.push(I+" // "+vt),D.push(I+" temp = "+At+"[AX_CLASS_SYMBOL] ? "+At+" : sec.box("+At+");"),D.push(I+" "+nt(pt(0))+" = (typeof temp['$Bg"+vt.name+"'] === 'function')? temp['$Bg"+vt.name+"']("+xt.join(", ")+") : temp.axCallProperty("+J(pt(1))+", ["+xt.join(", ")+"], false);"),needFastCheck()&&(L(-1),D.push(I+" }")));break;case Bytecode.CALLPROPLEX:vt=w.getMultiname(pt(1));var St=[];for(yt=0;yt<=pt(0);yt++)St.push(nt(pt(0)-yt));D.push(I+" temp = sec.box("+St.shift()+");"),D.push(I+" "+nt(pt(0))+" = (typeof temp['$Bg"+vt.name+"'] === 'function')? temp['$Bg"+vt.name+"']("+St.join(", ")+") : temp.axCallProperty("+J(pt(1))+", ["+St.join(", ")+"], true);");break;case Bytecode.CALLPROPVOID:vt=w.getMultiname(pt(1));var wt=[];for(yt=0;yt<=pt(0);yt++)wt.push(nt(pt(0)-yt));var Ct=wt.shift();0,needFastCheck()&&(D.push(I+" if (!"+emitIsAXOrPrimitive(Ct)+") {"),D.push(I+" "+Ct+"['"+vt.name+"']("+wt.join(", ")+");"),D.push(I+" } else {"),L(1)),D.push(I+" temp = "+Ct+"[AX_CLASS_SYMBOL] ? "+Ct+" : sec.box("+Ct+");"),D.push(I+" (typeof temp['$Bg"+vt.name+"'] === 'function')? temp['$Bg"+vt.name+"']("+wt.join(", ")+") : temp.axCallProperty("+J(pt(1))+", ["+wt.join(", ")+"], false);"),needFastCheck()&&(L(-1),D.push(I+" }"));break;case Bytecode.APPLYTYPE:var Pt=[];for(yt=1;yt<=pt(0);yt++)Pt.push(nt(pt(0)-yt));D.push(I+" "+nt(pt(0))+" = sec.applyType("+nt(pt(0))+", ["+Pt.join(", ")+"]);");break;case Bytecode.FINDPROPSTRICT:if(vt=w.getMultiname(pt(0)),D.push(I+" // "+vt),s(lexGen)&&lexGen.test(vt)){D.push(I+" /* GenerateLexImports */"),D.push(I+" "+lt+" = "+lexGen.getPropStrictAlias(vt,{nameAlias:J(pt(0))})+";");break}D.push(I+" "+lt+" = "+ct+".findScopeProperty("+J(pt(0))+", true, false);");break;case Bytecode.FINDPROPERTY:D.push(I+" // "+w.getMultiname(pt(0))),D.push(I+" "+lt+" = "+ct+".findScopeProperty("+J(pt(0))+", false, false);");break;case Bytecode.NEWFUNCTION:D.push(I+" // "+w.getMethodInfo(pt(0))),D.push(I+" "+lt+" = sec.createFunction(context.abc.getMethodInfo("+pt(0)+"), "+ct+", true);");break;case Bytecode.NEWCLASS:D.push(I+" // "+w.classes[pt(0)]),D.push(I+" "+rt+" = sec.createClass(context.abc.classes["+pt(0)+"], "+rt+", "+ct+");");break;case Bytecode.NEWARRAY:var Et=[];for(yt=1;yt<=pt(0);yt++)Et.push(nt(pt(0)-yt));D.push(I+" "+nt(pt(0)-1)+" = sec.AXArray.axBox(["+Et.join(", ")+"]);");break;case Bytecode.NEWOBJECT:for(D.push(I+" temp = Object.create(sec.AXObject.tPrototype);"),yt=1;yt<=pt(0);yt++)D.push(I+" temp.axSetPublicProperty("+nt(2*pt(0)-2*yt+1)+", "+nt(2*pt(0)-2*yt)+");");D.push(I+" "+nt(2*pt(0)-1)+" = temp;"),D.push(I+" temp = undefined;");break;case Bytecode.NEWACTIVATION:D.push(I+" "+lt+" = sec.createActivation(context.mi, "+ct+");");break;case Bytecode.NEWCATCH:D.push(I+" "+lt+" = sec.createCatch(context.mi.getBody().catchBlocks["+pt(0)+"], "+ct+");");break;case Bytecode.CONSTRUCTSUPER:var Tt=[];for(yt=1;yt<=pt(0);yt++)Tt.push(nt(pt(0)-yt));D.push(I+" context.savedScope.superConstructor.call("+nt(pt(0))+", "+Tt.join(", ")+");");break;case Bytecode.CALLSUPER:var Mt=[];for(yt=1;yt<=pt(0);yt++)Mt.push(nt(pt(0)-yt));D.push(I+" "+nt(pt(0))+" = sec.box("+nt(pt(0))+").axCallSuper("+J(pt(1))+", context.savedScope, ["+Mt.join(", ")+"]);");break;case Bytecode.CALLSUPER_DYN:var Dt=[];for(yt=1;yt<=pt(0);yt++)Dt.push(nt(pt(0)-yt));(vt=w.getMultiname(pt(1))).isRuntimeName()&&vt.isRuntimeNamespace()?D.push(I+" "+nt(pt(0)+2)+" = sec.box("+nt(pt(0)+2)+").axGetSuper(context.runtimename("+J(pt(1))+", "+nt(pt(0))+", "+nt(pt(0)+1)+"), context.savedScope, ["+Dt.join(", ")+"]);"):D.push(I+" "+nt(pt(0)+1)+" = sec.box("+nt(pt(0)+1)+").axGetSuper(context.runtimename("+J(pt(1))+", "+nt(pt(0))+"), context.savedScope, ["+Dt.join(", ")+"]);");break;case Bytecode.CALLSUPERVOID:var It=[];for(yt=1;yt<=pt(0);yt++)It.push(nt(pt(0)-yt));D.push(I+" sec.box("+nt(pt(0))+").axCallSuper("+J(pt(1))+", context.savedScope, ["+It.join(", ")+"]);");break;case Bytecode.CONSTRUCTPROP:var Ot=[];for(yt=1;yt<=pt(0);yt++)Ot.push(nt(pt(0)-yt));D.push(I+" "+nt(pt(0))+" = context.constructprop("+J(pt(1))+", "+nt(pt(0))+", ["+Ot.join(", ")+"]);");break;case Bytecode.GETPROPERTY:vt=w.getMultiname(pt(0));var Lt=!1;s(blockSaver)&&blockSaver.needSafe(rt)&&(Lt=!0,D.push(I+" "+blockSaver.beginSafeBlock(rt)),L(1)),0,D.push(I+" // "+vt),needFastCheck()&&(D.push(I+" if (!"+emitIsAX(rt)+") {"),D.push(I+" "+rt+" = "+rt+"['"+vt.name+"'];"),D.push(I+" } else {"),L(1)),D.push(I+" temp = "+rt+"[AX_CLASS_SYMBOL] ? "+rt+" : sec.box("+rt+");"),D.push(I+" "+rt+" = temp['$Bg"+vt.name+"'];"),D.push(I+" if ("+rt+" === undefined || typeof "+rt+" === 'function') {"),D.push(I+" "+rt+" = temp.axGetProperty("+J(pt(0))+");"),D.push(I+" }"),needFastCheck()&&(L(-1),D.push(I+" }")),Lt&&(L(-1),D.push(I+" "+blockSaver.endSafeBlock("undefined")));break;case Bytecode.GETPROPERTY_DYN:vt=w.getMultiname(pt(0)),s(blockSaver)&&blockSaver.markToSafe(vt)&&D.push(I+" /* Mark lookup to safe call, "+blockSaver.constructor.name+" */"),D.push(I+" // "+vt),vt.isRuntimeName()&&vt.isRuntimeNamespace()?D.push(I+" "+st+" = context.getpropertydyn(context.runtimename("+J(pt(0))+", "+rt+", "+ot+"), "+st+");"):D.push(I+" "+ot+" = context.getpropertydyn(context.runtimename("+J(pt(0))+", "+rt+"), "+ot+");");break;case Bytecode.SETPROPERTY:vt=w.getMultiname(pt(0)),D.push(I+" // "+vt),needFastCheck()&&(D.push(I+" if (!"+emitIsAX(ot)+"){"),D.push(I+" "+ot+"['"+vt.name+"'] = "+rt+";"),D.push(I+" } else {"),L(1)),D.push(I+" context.setproperty("+J(pt(0))+", "+rt+", "+ot+");"),needFastCheck()&&(L(-1),D.push(I+" }"));break;case Bytecode.SETPROPERTY_DYN:(vt=w.getMultiname(pt(0))).isRuntimeName()&&vt.isRuntimeNamespace()?D.push(I+" context.setproperty(context.runtimename("+J(pt(0))+", "+ot+", "+st+"), "+rt+", "+at+");"):D.push(I+" context.setproperty(context.runtimename("+J(pt(0))+", "+ot+"), "+rt+", "+st+");");break;case Bytecode.DELETEPROPERTY:D.push(I+" // "+w.getMultiname(pt(0))),D.push(I+" "+rt+" = context.deleteproperty("+J(pt(0))+", "+rt+");");break;case Bytecode.DELETEPROPERTY_DYN:(vt=w.getMultiname(pt(0))).isRuntimeName()&&vt.isRuntimeNamespace()?D.push(I+" "+st+" = context.deleteproperty(context.runtimename("+J(pt(0))+", "+rt+", "+ot+"), "+st+");"):D.push(I+" "+ot+" = context.deleteproperty(context.runtimename("+J(pt(0))+", "+rt+"), "+ot+");");break;case Bytecode.GETSUPER:D.push(I+" "+rt+" = sec.box("+rt+").axGetSuper("+J(pt(0))+", context.savedScope);");break;case Bytecode.GETSUPER_DYN:(vt=w.getMultiname(pt(0))).isRuntimeName()&&vt.isRuntimeNamespace()?D.push(I+" "+st+" = sec.box("+st+").axGetSuper(context.runtimename("+J(pt(0))+", "+rt+", "+ot+"), context.savedScope);"):D.push(I+" "+ot+" = sec.box("+ot+").axGetSuper(context.runtimename("+J(pt(0))+", "+rt+"), context.savedScope);");break;case Bytecode.SETSUPER:D.push(I+" sec.box("+ot+").axSetSuper("+J(pt(0))+", context.savedScope, "+rt+");");break;case Bytecode.SETSUPER_DYN:(vt=w.getMultiname(pt(0))).isRuntimeName()&&vt.isRuntimeNamespace()?D.push(I+" sec.box("+at+").axSetSuper(context.runtimename("+J(pt(0))+", "+ot+", "+st+"), context.savedScope, "+rt+");"):D.push(I+" sec.box("+st+").axSetSuper(context.runtimename("+J(pt(0))+", "+ot+"), context.savedScope, "+rt+");");break;case Bytecode.GETLEX:vt=w.getMultiname(pt(0)),s(lexGen)&&lexGen.test(vt)?(D.push(I+" // "+vt),D.push(I+" /* GenerateLexImports */"),D.push(I+" "+lt+" = "+lexGen.getLexAlias(vt,{nameAlias:J(pt(0))})+";")):(D.push(I+" // "+vt),D.push(I+" temp = "+ct+".findScopeProperty("+J(pt(0))+", true, false);"),D.push(I+" "+lt+" = temp['$Bg"+vt.name+"'];"),D.push(I+" if ("+lt+" === undefined || typeof "+lt+" === 'function') {"),D.push(I+" "+lt+" = temp.axGetProperty("+J(pt(0))+");"),D.push(I+" }"));break;case Bytecode.RETURNVALUE:METHOD_HOOKS&&METHOD_HOOKS[f+"__return"]&&(D.push(I+" /* ATTACH METHOD HOOK */"),D.push(I+" context.executeHook(local0, '"+f+"__return')")),D.push(I+" return "+rt+";");break;case Bytecode.RETURNVOID:METHOD_HOOKS&&METHOD_HOOKS[f+"__return"]&&(D.push(I+" /* ATTACH METHOD HOOK */"),D.push(I+" context.executeHook(local0, '"+f+"__return')")),D.push(I+" return;");break;case Bytecode.COERCE:if(4&o&&(Z.name===Bytecode.PUSHNULL||Z.name===Bytecode.PUSHUNDEFINED)){D.push(I+" // SKIP_NULL_COERCE");break}D.push(I+" "+rt+" = "+emitIsAX(rt)+" ? "+ct+".getScopeProperty("+J(pt(0))+", true, false).axCoerce("+rt+"): "+rt+";");break;case Bytecode.COERCE_A:D.push(I+" ;");break;case Bytecode.COERCE_S:if(4&o&&(Z.name===Bytecode.PUSHNULL||Z.name===Bytecode.PUSHUNDEFINED)){D.push(I+" // SKIP_NULL_COERCE");break}D.push(I+" "+rt+" = context.axCoerceString("+rt+");");break;case Bytecode.CONVERT_I:D.push(I+" "+rt+" |= 0;");break;case Bytecode.CONVERT_D:D.push(I+" "+rt+" = +"+rt+";");break;case Bytecode.CONVERT_B:D.push(I+" "+rt+" = !!"+rt+";");break;case Bytecode.CONVERT_U:D.push(I+" "+rt+" >>>= 0;");break;case Bytecode.CONVERT_S:D.push(I+" if (typeof "+rt+" !== 'string') "+rt+" = "+rt+" + '';");break;case Bytecode.CONVERT_O:D.push(I+" ;");break;case Bytecode.CHECKFILTER:D.push(I+" "+rt+" = context.axCheckFilter(sec, "+rt+");");break;case Bytecode.KILL:D.push(I+" "+ut(pt(0))+" = undefined;");break;default:if(!(8&o))switch(tt.name){case Bytecode.SI8:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" domainMemory.setInt8("+rt+", "+ot+")");break;case Bytecode.SI16:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" domainMemory.setInt16("+rt+", "+ot+", true);");break;case Bytecode.SI32:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" domainMemory.setInt32("+rt+", "+ot+", true);");break;case Bytecode.SF32:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" domainMemory.setFloat32("+rt+", "+ot+", true);");break;case Bytecode.SF64:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" domainMemory.setFloat64("+rt+", "+ot+", true);");break;case Bytecode.LI8:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" "+rt+" = domainMemory.getInt8("+rt+")");break;case Bytecode.LI16:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" "+rt+" = getInt16("+rt+", true);");break;case Bytecode.LI32:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" "+rt+" = domainMemory.getInt32("+rt+", true);");break;case Bytecode.LF32:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" "+rt+" = domainMemory.getFloat32("+rt+", true);");break;case Bytecode.LF64:D.push(I+" domainMemory = domainMemory || context.domainMemory;"),D.push(I+" "+rt+" = domainMemory.getFloat64("+rt+", true);")}if(tt.name<=Bytecode.LI8&&tt.name>=Bytecode.SF64)return D.push(I+" //unknown instruction "+BytecodeName$1[A[$].name]),{error:"unhandled instruction "+tt}}}(Y=x?x[tt.position]:null)&&(it=F.pop())&&(L(-1),D.push(I+"}"),B(it))}0this.stack.length&&this.scopes.length--},zjg.prototype.topScope=function(){if(!this.scopes){if(0===this.stack.length)return this.parent;this.scopes=[]}for(var t=this.parent,e=0;e>>0},Tjg.prototype.s24=function(){var t=this.code,e=this.pc,i=t[e]|t[e+1]<<8|t[e+2]<<16;return this.pc=e+3,i<<8>>8},Tjg.prototype.getHasNext2Info=function(){var t=this.pc,e=this.hasNext2Infos;return(e=e||(this.hasNext2Infos=[]))[t]||(e[t]=new HasNext2Info(null,0)),e[t]},Tjg);function Tjg(t,e,i,n,r){this.pc=0,this.stack=[],this.hasNext2Infos=null;var o=this.body=e.getBody();this.code=o.code,this.scopes=new ScopeStack(i);for(var s,a,l=this.locals=[t],c=this.app=e.abc.applicationDomain,h=this.sec=c.sec,u=n.length,p=0,d=e.parameters.length;p=l.pop()&&(a.pc+=b);continue;case 15:case 21:b=a.s24(),l.pop()>l.pop()&&(a.pc+=b);continue;case 16:a.pc=a.s24()+a.pc;continue;case 17:b=a.s24(),l.pop()&&(a.pc+=b);continue;case 18:b=a.s24(),l.pop()||(a.pc+=b);continue;case 19:b=a.s24(),axEquals(l.pop(),l.pop(),u)&&(a.pc+=b);continue;case 20:b=a.s24(),axEquals(l.pop(),l.pop(),u)||(a.pc+=b);continue;case 25:b=a.s24(),l.pop()==l.pop()&&(a.pc+=b);continue;case 26:b=a.s24(),l.pop()!=l.pop()&&(a.pc+=b);continue;case 27:var y=a.pc-1,b=a.s24(),v=a.u30();(o=l.pop())<=v&&(a.pc+=3*o,b=a.s24()),a.pc=y+b;continue;case 29:h.pop();break;case 30:l[l.length-2]=u.box(l[l.length-2]).axNextName(l.pop());break;case 35:l[l.length-2]=u.box(l[l.length-2]).axNextValue(l.pop());break;case 50:var x=a.getHasNext2Info(),A=a.u30(),S=a.u30();x.next(u.box(c[A]),c[S]),c[A]=x.object,c[S]=x.index,l.push(!!x.index);break;case 32:l.push(null);break;case 33:l.push(void 0);break;case 36:l.push(a.code[a.pc++]<<24>>24);break;case 37:l.push(a.u30()<<16>>16);break;case 44:l.push(p.getString(a.u30()));break;case 45:l.push(p.ints[a.u30()]);break;case 46:l.push(p.uints[a.u30()]);break;case 47:l.push(p.doubles[a.u30()]);break;case 38:l.push(!0);break;case 39:l.push(!1);break;case 40:l.push(NaN);break;case 41:l.pop();break;case 42:l.push(l[l.length-1]);break;case 43:e=l[l.length-1],l[l.length-1]=l[l.length-2],l[l.length-2]=e;break;case 48:h.push(u.box(l.pop()),!1);break;case 28:h.push(u.box(l.pop()),!0);break;case 49:l.push(u.AXNamespace.FromNamespace(p.getNamespace(a.u30())));break;case 64:l.push(u.createFunction(p.getMethodInfo(a.u30()),h.topScope(),!0));break;case 65:popManyInto(l,a.u30(),_),t=l.pop(),validateCall(u,e=l[l.length-1],_.length),l[l.length-1]=e.axApply(t,_);break;case 66:popManyInto(l,a.u30(),_),i=u.box(l[l.length-1]),validateConstruct(u,i,_.length),l[l.length-1]=i.axConstruct(_);break;case 71:return release||assert(scopeStacks.length===m+1),void scopeStacks.length--;case 72:return e=l.pop(),M.returnTypeNameIndex&&(i=M.getType())&&(e=i.axCoerce(e)),release||assert(scopeStacks.length===m+1),scopeStacks.length--,e;case 73:popManyInto(l,a.u30(),_),D.object.superClass.tPrototype.axInitializer.apply(l.pop(),_);break;case 74:o=a.u30(),popManyInto(l,a.u30(),_),popNameInto(l,p.getMultiname(o),d),l[l.length-1]=u.box(l[l.length-1]).axConstructProperty(d,_);break;case 76:case 70:case 79:o=a.u30(),popManyInto(l,a.u30(),_),popNameInto(l,p.getMultiname(o),d),s=u.box(l[l.length-1]).axCallProperty(d,_,76===g),79===g?l.length--:l[l.length-1]=s;break;case 69:case 78:o=a.u30(),popManyInto(l,a.u30(),_),popNameInto(l,p.getMultiname(o),d),s=u.box(l[l.length-1]).axCallSuper(d,D,_),78===g?l.length--:l[l.length-1]=s;break;case 83:popManyInto(l,a.u30(),_),l[l.length-1]=u.applyType(l[l.length-1],_);break;case 85:t=Object.create(u.AXObject.tPrototype),f=a.u30();for(var w=l.length-2*f;w>>=0;break;case 132:case 117:l[l.length-1]=+l[l.length-1];break;case 129:case 118:l[l.length-1]=!!l[l.length-1];break;case 133:l[l.length-1]=axCoerceString$2(l[l.length-1]);break;case 112:l[l.length-1]=axConvertString(l[l.length-1]);break;case 120:l[l.length-1]=axCheckFilter(u,l[l.length-1]);break;case 128:popNameInto(l,p.getMultiname(a.u30()),d),l[l.length-1]=h.topScope().getScopeProperty(d,!0,!1).axCoerce(l[l.length-1]);break;case 130:break;case 134:popNameInto(l,p.getMultiname(a.u30()),d),l[l.length-1]=h.topScope().getScopeProperty(d,!0,!1).axAsType(l[l.length-1]);break;case 135:l[l.length-2]=l.pop().axAsType(l[l.length-1]);break;case 137:t=l[l.length-1],l[l.length-1]=null==t?null:t;break;case 144:l[l.length-1]=-l[l.length-1];break;case 145:++l[l.length-1];break;case 146:++c[a.u30()];break;case 147:--l[l.length-1];break;case 148:--c[a.u30()];break;case 149:l[l.length-1]=axTypeOf(l[l.length-1],u);break;case 150:l[l.length-1]=!l[l.length-1];break;case 151:l[l.length-1]=~l[l.length-1];break;case 160:r=l.pop(),n=l[l.length-1],l[l.length-1]="number"==typeof n&&"number"==typeof r?n+r:axAdd(n,r,u);break;case 161:l[l.length-2]-=l.pop();break;case 162:l[l.length-2]*=l.pop();break;case 163:l[l.length-2]/=l.pop();break;case 164:l[l.length-2]%=l.pop();break;case 165:l[l.length-2]<<=l.pop();break;case 166:l[l.length-2]>>=l.pop();break;case 167:l[l.length-2]>>>=l.pop();break;case 168:l[l.length-2]&=l.pop();break;case 169:l[l.length-2]|=l.pop();break;case 170:l[l.length-2]^=l.pop();break;case 171:l[l.length-2]=axEquals(l[l.length-2],l.pop(),u);break;case 172:l[l.length-2]=l[l.length-2]===l.pop();break;case 173:l[l.length-2]=l[l.length-2]l.pop();break;case 176:l[l.length-2]=l[l.length-2]>=l.pop();break;case 177:l[l.length-2]=l.pop().axIsInstanceOf(l[l.length-1]);break;case 178:popNameInto(l,p.getMultiname(a.u30()),d),l[l.length-1]=h.topScope().findScopeProperty(d,!0,!1).axIsType(l[l.length-1]);break;case 179:l[l.length-2]=l.pop().axIsType(l[l.length-1]);break;case 180:i=u.box(l.pop());var C=l[l.length-1];l[l.length-1]=C&&C.axClass===u.AXQName?i.axHasProperty(C.name):i.axHasPublicProperty(C);break;case 192:l[l.length-1]=1+(0|l[l.length-1]);break;case 193:l[l.length-1]=(0|l[l.length-1])-1;break;case 194:c[o=a.u30()]=1+(0|c[o]);break;case 195:c[o=a.u30()]=(0|c[o])-1;break;case 196:l[l.length-1]=-(0|l[l.length-1]);break;case 197:l[l.length-2]=(0|l[l.length-2])+(0|l.pop())|0;break;case 198:l[l.length-2]=(0|l[l.length-2])-(0|l.pop())|0;break;case 199:l[l.length-2]=(0|l[l.length-2])*(0|l.pop())|0;break;case 208:l.push(c[0]);break;case 209:l.push(c[1]);break;case 210:l.push(c[2]);break;case 211:l.push(c[3]);break;case 212:c[0]=l.pop();break;case 213:c[1]=l.pop();break;case 214:c[2]=l.pop();break;case 215:c[3]=l.pop();break;case 6:h.topScope().defaultNamespace=internNamespace(0,p.getString(a.u30()));break;case 7:h.topScope().defaultNamespace=internNamespace(0,l.pop());break;case 239:a.pc++,a.u30(),a.pc++,a.u30();break;case 240:case 241:a.u30();break;case 2:case 1:break;default:notImplemented(getBytecodeName(g))}}catch(t){isValidASValue(t)||(t=createValidException(u,t,g,e,i,n,r,d,m+1));var P=a.body.catchBlocks;for(w=0;w=E.start&&a.pc<=E.end){var T=E.getType();if(!T||a.app.getClass(T).axIsType(t)){l.length=0,l.push(t),h.clear(),a.pc=E.target;continue t}}}throw scopeStacks.length--,t}}}function createValidException(t,e,i,n,r,o,s,a,l){var c,h=e instanceof Error&&"string"==typeof e.name&&"string"==typeof e.message;if(h)if(e instanceof RangeError||"InternalError"===e.name){var u=Object.create(t.AXError.tPrototype);if(u._errorID=1023,"allocation size overflow"===e.message)return u.$Bgmessage="allocation size overflow",u;if(-1>>0}function axIsTypeUint(t){return"number"==typeof t&&t>>>0===t}function axBoxIdentity(t){return t[0]}function axIsTypeObject(t){return this.dPrototype.isPrototypeOf(this.sec.box(t))||t===this.dPrototype}function axAsType(t){return t&&t.__fast__||this.axIsType(t)?t:null}function axBoxPrimitive(t){var e=Object.create(this.tPrototype);return e.value=t,e}function axApplyObject(t,e){var i=e[0];return null==i?Object.create(this.tPrototype):i}function axConstructObject(t){var e=t[0];return null==e?Object.create(this.tPrototype):e}function axCoerceObject(t){return null==t?null:t}var AXSecurityDomain=(Object.defineProperty(fog.prototype,"xmlParser",{get:function(){return this._xmlParser||(this._xmlParser=new XMLParser(this))},enumerable:!0,configurable:!0}),Object.defineProperty(fog.prototype,"AXFunctionUndefinedPrototype",{get:function(){return this._AXFunctionUndefinedPrototype||(this._AXFunctionUndefinedPrototype=this.createObject())},enumerable:!0,configurable:!0}),fog.prototype.addCatalog=function(t){this._catalogs.push(t)},fog.prototype.findDefiningABC=function(t){for(var e=null,i=0;i");tmpAttr.name="name",o.setProperty(tmpAttr,r.$Bgname);var s=r.$Bgtraits.$Bgbases.value;s.length&&(tmpAttr.name="base",o.setProperty(tmpAttr,s[0])),tmpAttr.name="isDynamic",o.setProperty(tmpAttr,r.$BgisDynamic.toString()),tmpAttr.name="isFinal",o.setProperty(tmpAttr,r.$BgisFinal.toString()),tmpAttr.name="isStatic",o.setProperty(tmpAttr,r.$BgisStatic.toString()),describeTraits(o,r.$Bgtraits);var a,l=describeTypeJSON(t,e,512|i);return l&&(a=n.Create(""),tmpAttr.name="type",a.setProperty(tmpAttr,l.$Bgname),describeTraits(a,l.$Bgtraits)&&o.appendChild(a)),o}function describeTraits(t,e){for(var i=0,n=e.$Bgbases&&e.$Bgbases.value,r=0;n&&r');t.appendChild(s),i++}for(var a=e.$Bginterfaces&&e.$Bginterfaces.value,r=0;a&&r');t.appendChild(s),i++}null!==e.$Bgconstructor&&(describeParams(s=t.sec.AXXML.Create(""),e.$Bgconstructor),t.appendChild(s),i++);var l=e.$Bgvariables&&e.$Bgvariables.value;for(r=0;l&&r'),t),i++}var u=e.$Bgaccessors&&e.$Bgaccessors.value;for(r=0;u&&r'),t),i++}var d=e.$Bgmethods&&e.$Bgmethods.value;for(r=0;d&&r'),_.$Bgparameters.value),finishTraitDescription(_,s,t),i++}return describeMetadataXML(t,e.$Bgmetadata),0');t.appendChild(r)}}function describeMetadataXML(t,e){if(e)for(var i=e.value,n=0;n'),s=r.$Bgvalue.value,a=0;a');o.appendChild(c)}t.appendChild(o)}}function describeMetadataList(t,e){if(!e)return null;for(var i=t.createArray([]),n=0;n>24},Bvg.prototype.readU32=function(){return this.readS32()>>>0},Bvg.prototype.readU30=function(){return this.readU32()},Bvg.prototype.readU30Unsafe=function(){return this.readU32()},Bvg.prototype.readS16=function(){return this.readU30Unsafe()<<16>>16},Bvg.prototype.readS32=function(){var t=this.readU8();return 128&t&&16384&(t=127&t|this.readU8()<<7)&&2097152&(t=16383&t|this.readU8()<<14)&&268435456&(t=2097151&t|this.readU8()<<21)&&(t=268435455&t|this.readU8()<<28,t&=4294967295),t},Bvg.prototype.readWord=function(){var t=this._view.getUint32(this._position,!0);return this._position+=4,t},Bvg.prototype.readS24=function(){return(this.readU8()|this.readU8()<<8|this.readU8()<<16)<<8>>8},Bvg.prototype.readDouble=function(){var t=this._view.getFloat64(this._position,!0);return this._position+=8,t},Bvg.prototype.readUTFString=function(t){if(textDecoder){var e=this._position;return this._position+=t,textDecoder.decode(this._bytes.subarray(e,e+t))}for(var i=this._position,n=i+t,r=this._bytes,o=0,s=Bvg._getResultBuffer(2*t);i>>10),56320+(1023&a)),s[o++]=a)}return this._position=i,StringUtilities.fromCharCodeArray(s.subarray(0,o))},Bvg._resultBuffer=new Uint32Array(256),Bvg),ABCFile=(Object.defineProperty(Xvg.prototype,"applicationDomain",{get:function(){return this.env.app},enumerable:!0,configurable:!0}),Xvg.prototype._parseConstantPool=function(){this._parseNumericConstants(),this._parseStringConstants()},Xvg.prototype._parseNumericConstants=function(){var t=0,e=this._stream,t=e.readU30(),i=new Int32Array(t);i[0]=0;for(var n=1;n>16,65535&t)},Xvg.prototype._checkForDuplicateStrings=function(){for(var t=[],e=0;e=this._multinameOffsets.length)&&this.applicationDomain.sec.throwError("VerifierError",Errors$1.CpoolIndexRangeError,t,this._multinameOffsets.length),0===t)return null;var e=this._multinames[t];return void 0===e&&(this._stream.seek(this._multinameOffsets[t]),e=this._multinames[t]=this._parseMultiname(t)),e},Xvg.prototype.getNamespace=function(t){if((t<0||t>=this._namespaceOffsets.length)&&this.applicationDomain.sec.throwError("VerifierError",Errors$1.CpoolIndexRangeError,t,this._namespaceOffsets.length),0===t)return Namespace.PUBLIC;var e=this._namespaces[t];if(void 0!==e)return e;var i=this._stream;i.seek(this._namespaceOffsets[t]);var n,r=i.readU8(),o=i.readU30(),s=o?this.getString(o):void 0;switch(r){case 8:case 22:n=0;break;case 23:n=2;break;case 24:n=1;break;case 25:n=4;break;case 26:n=5;break;case 5:n=3;break;default:this.applicationDomain.sec.throwError("VerifierError",Errors$1.CpoolEntryWrongTypeError,t)}return s&&3!==n||void 0===s&&(s=""),this._namespaces[t]=internNamespace(n,s)},Xvg.prototype.getNamespaceSet=function(t){if((t<0||t>=this._namespaceSets.length)&&this.applicationDomain.sec.throwError("VerifierError",Errors$1.CpoolIndexRangeError,t,this._namespaceSets.length),0===t)return null;if(void 0===(r=this._namespaceSets[t])){var e=this._stream,i=this._namespaceSetOffsets[t];e.seek(i);var n=e.readU30(),r=this._namespaceSets[t]=new Array(n);i=e.position;for(var o=0;o>4&15;switch(n){case 0:case 6:var o=t.readU30(),s=t.readU30(),a=t.readU30(),l=-1;0!==a&&(l=t.readU8()),p=new SlotTraitInfo(this,n,e,o,s,l,a);break;case 1:case 2:case 3:t.readU30();var c=t.readU30(),h=t.position,u=this.getMethodInfo(c),p=u.trait=new MethodTraitInfo(this,n,e,u);t.seek(h);break;case 4:o=t.readU30();var d=this.classes[t.readU30()];p=d.trait=new ClassTraitInfo(this,n,e,o,d);break;default:this.applicationDomain.sec.throwError("VerifierError",Errors$1.UnsupportedTraitsKindError,n)}if(4&r){for(var _=t.readU30(),f=new Uint32Array(_),m=0;m<_;m++)f[m]=t.readU30();p.metadata=f}return p},Xvg.prototype._parseClassInfos=function(t){this._stream;for(var e=this.classes=new Array(t),i=0;ie.length>>1){for(var o=[],n=0;n=this._adaptee.numChildren&&(e=this._adaptee.numChildren-1),this._adaptee.removeChildren(t,e+1)},UDg.prototype.setChildIndex=function(t,e){for(var i=[],n=0;nthis._dragBounds.right&&(this.adaptee.x=this._dragBounds.right),this.adaptee.ythis._dragBounds.bottom&&(this.adaptee.y=this._dragBounds.bottom)},dFg.prototype.dragListener=function(t){var e;this.adaptee.parent&&(e=this.adaptee.parent.transform.globalToLocal(new Point(this.stage.mouseX,this.stage.mouseY)),this.adaptee.x=this.startDragMCPosition.x+(e.x-this.startDragPoint.x),this.adaptee.y=this.startDragMCPosition.y+(e.y-this.startDragPoint.y),this._dragBounds&&this.checkBounds())},dFg.prototype.startTouchDrag=function(t,e,i){console.log("startTouchDrag not implemented yet in flash/Sprite")},dFg.prototype.stopDrag=function(t){dFg.currentDraggedMC&&dFg.currentDraggedMC!=this&&dFg.currentDraggedMC.stopDrag(),this.isDragging=!1,dFg.currentDraggedMC=null,this.stage.adaptee.scene.mousePicker.dragEntity=null,MouseManager.getInstance(this.stage.adaptee.scene.renderer.renderGroup.pickGroup).stopDragObject(),this.stage.adaptee.removeEventListener("mouseMove3d",this.dragListenerDelegate)},dFg.prototype.stopTouchDrag=function(t){console.log("startTouchDrag not implemented yet in flash/Sprite")},dFg._sprites=new Array,dFg.currentDraggedMC=null,dFg),Bitmap=(EFg=DisplayObject$1,__extends(FFg,EFg),FFg.getNewBitmap=function(t,e,i){if(void 0===t&&(t=null),void 0===e&&(e="auto"),void 0===i&&(i=!1),FFg._bitmaps.length){var n=new MethodMaterial(t?t.adaptee:0);n.alphaBlending=!0,n.useColorTransform=!0;var r=FFg._bitmaps.pop();return r.adaptee=Billboard.getNewBillboard(n,e,i),r}return new FFg(t,e,i)},FFg.prototype.mapAdaptee=function(t){var e,i=t;return(t instanceof BitmapImage2D||t instanceof SceneImage2D)&&(this._adaptee=i=Billboard.getNewBillboard(new MethodMaterial(t),"auto",!1),e=new this.sec.flash.display.BitmapData(t),this.bitmapData=e,this._bitmapMappedFromAsset=!0),EFg.prototype.mapAdaptee.call(this,i)},FFg.prototype.createAdaptee=function(){var t=Billboard.getNewBillboard(FFg.argBitmapMaterial,FFg.argPixelSnapping,FFg.argSmoothing);return FFg.argBitmapMaterial=null,FFg.argPixelSnapping=null,FFg.argSmoothing=null,t},FFg.prototype.clone=function(){var t=FFg.getNewBitmap(this._bitmapData);return this._adaptee.copyTo(t.adaptee),t},FFg.prototype.dispose=function(){this.disposeValues(),FFg._bitmaps.push(this)},FFg.prototype.disposeValues=function(){this.bitmapData=null,EFg.prototype.disposeValues.call(this)},Object.defineProperty(FFg.prototype,"bitmapData",{get:function(){return this._bitmapData},set:function(t){var e;this._bitmapData!=t&&(this._bitmapData&&this._bitmapData._removeOwner(this),this._bitmapData=t,this._bitmapData&&this._bitmapData._addOwner(this),e=this._adaptee.material,this._bitmapData?(e.ambientMethod.texture||(e.ambientMethod.texture=new ImageTexture2D),e.style.image=this._bitmapData.adaptee):(e.ambientMethod.texture&&(e.ambientMethod.texture=null),e.style.image=null,e.style.color=0),e.invalidateTextures())},enumerable:!0,configurable:!0}),Object.defineProperty(FFg.prototype,"pixelSnapping",{get:function(){return""},set:function(t){console.log("pixelSnapping not implemented yet in flash/Bitmap")},enumerable:!0,configurable:!0}),Object.defineProperty(FFg.prototype,"smoothing",{get:function(){return console.log("smoothing not implemented yet in flash/Bitmap"),!1},set:function(t){console.log("smoothing not implemented yet in flash/Bitmap")},enumerable:!0,configurable:!0}),FFg._bitmaps=new Array,FFg),BitmapData=(ZFg=ASObject,__extends($Fg,ZFg),$Fg.prototype.compare=function(t){return!0},Object.defineProperty($Fg.prototype,"adaptee",{get:function(){return this._adaptee},set:function(t){this._adaptee=t},enumerable:!0,configurable:!0}),$Fg.loadBitmap=function(t){return console.log("loadBitmap not implemented yet in flash/BitmapData"),null},$Fg.prototype.setPixels=function(t,e){console.log("todo: BitmapData.setPixels")},$Fg.prototype.getPixels=function(t){return console.log("getPixels not implemented yet in flash/BitmapData"),null},$Fg.prototype.copyPixelsToByteArray=function(t,e){console.log("copyPixelsToByteArray not implemented yet in flash/BitmapData")},$Fg.prototype.getVector=function(t){return null},$Fg.prototype.setVector=function(t,e){},$Fg.prototype.histogram=function(t){},$Fg.prototype.encode=function(t,e,i){},$Fg.prototype.drawWithQuality=function(t,e,i,n,r,o,s){},Object.defineProperty($Fg.prototype,"transparent",{get:function(){return this._adaptee.transparent},set:function(t){this._adaptee.transparent=t},enumerable:!0,configurable:!0}),Object.defineProperty($Fg.prototype,"width",{get:function(){return this._adaptee.width},set:function(t){this._adaptee.width=t},enumerable:!0,configurable:!0}),Object.defineProperty($Fg.prototype,"height",{get:function(){return this._adaptee.height},set:function(t){this._adaptee.height=t},enumerable:!0,configurable:!0}),$Fg.prototype.clone=function(){var t=new this.sec.flash.display.BitmapData(this._adaptee.width,this._adaptee.height,this._adaptee.transparent,0);return t.copyPixels(this,this.rect,new this.sec.flash.geom.Point),t},Object.defineProperty($Fg.prototype,"rect",{get:function(){return new this.sec.flash.geom.Rectangle(this._adaptee.rect.clone())},enumerable:!0,configurable:!0}),$Fg.prototype.getPixel=function(t,e){return this._adaptee.getPixel(t,e)},$Fg.prototype.getPixel32=function(t,e){return this._adaptee.getPixel32(t,e)},$Fg.prototype.setPixel=function(t,e,i){this._adaptee.setPixel(t,e,i)},$Fg.prototype.setPixel32=function(t,e,i){this._adaptee.setPixel32(t,e,i)},$Fg.prototype.applyFilter=function(t,e,i,n){return console.log("applyFilter not implemented yet in flash/BitmapData"),0},$Fg.prototype.colorTransform=function(t,e){this._adaptee.colorTransform(t.adaptee,e.adaptee)},$Fg.prototype.copyChannel=function(t,e,i,n,r){this._adaptee.copyChannel(t.adaptee,e.adaptee,i.adaptee,n,r)},$Fg.prototype.copyPixels=function(t,e,i,n,r,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=!1),this._adaptee.copyPixels(t.adaptee,e.adaptee,i.adaptee,n?n.adaptee:null,r?r.adaptee:null,o)},$Fg.prototype.dispose=function(){this._adaptee&&(this._adaptee.dispose(),this._adaptee=null)},$Fg.prototype.draw=function(t,e,i,n,r,o){void 0===i&&(i=null),void 0===n&&(n=""),void 0===r&&(r=null),void 0===o&&(o=!1),this._adaptee.draw(t.adaptee,e?e.adaptee:null,i?i.adaptee:null,n,r?r.adaptee:null,o)},$Fg.prototype.fillRect=function(t,e){this._adaptee.fillRect(t.adaptee,e)},$Fg.prototype.floodFill=function(t,e,i){console.warn("Unsage implementation `floodFill`"),this._adaptee.floodFill(t,e,i)},$Fg.prototype.generateFilterRect=function(t,e){return console.log("generateFilterRect not implemented yet in flash/BitmapData"),null},$Fg.prototype.getColorBoundsRect=function(t,e,i){return console.warn("Unsage implementation `getColorBoundsRect`!"),new this.sec.flash.geom.Rectangle(this._adaptee.getColorBoundsRect(t,e,i))},$Fg.prototype.hitTest=function(t,e,i,n,r){return void 0===n&&(n=new this.sec.flash.geom.Point(0,0)),console.log("hitTest not implemented yet in flash/BitmapData"),!1},$Fg.prototype.lock=function(){this._adaptee.lock()},$Fg.prototype.merge=function(t,e,i,n,r,o,s){this._adaptee.merge(t.adaptee,t.rect.adaptee,i.adaptee,n,r,o,s)},$Fg.prototype.noise=function(t,e,i,n,r){console.log("noise not implemented yet in flash/BitmapData")},$Fg.prototype.paletteMap=function(t,e,i,n,r,o,s){console.log("paletteMap not implemented yet in flash/BitmapData")},$Fg.prototype.perlinNoise=function(t,e,i,n,r,o,s,a,l){console.log("perlinNoise not implemented yet in flash/BitmapData")},$Fg.prototype.pixelDissolve=function(t,e,i,n,r,o){return console.log("pixelDissolve not implemented yet in flash/BitmapData"),0},$Fg.prototype.scroll=function(t,e){console.log("scroll not implemented yet in flash/BitmapData")},$Fg.prototype.threshold=function(t,e,i,n,r,o,s,a){return this._adaptee.threshold(t.adaptee,e.adaptee,i.adaptee,n,r,o,s,a),0},$Fg.prototype.unlock=function(){this._adaptee.unlock()},$Fg.prototype._addOwner=function(t){-1==this._owners.indexOf(t)&&this._owners.push(t)},$Fg.prototype._removeOwner=function(t){var e=this._owners.indexOf(t);-1!=e&&this._owners.splice(e,1),!this._owners.length&&this._adaptee&&this._adaptee.clear()},$Fg),FlashSceneGraphFactory=(rIg=DefaultSceneGraphFactory,__extends(sIg,rIg),sIg.prototype.executeABCBytes=function(t){for(var e=0;e>>=0,i=!!i;var n=this._adaptee._rawData;if(i)for(var r=0,o=0|e;r<16;r++,o++)t.axSetNumericProperty(o,n[transposeTransform[r]]);else for(o=(r=0)|e;r<16;r++,o++)t.axSetNumericProperty(o,n[r])},eQg.prototype.copyRawDataFrom=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=!1),e>>>=0,i=!!i;var n=this._adaptee._rawData;if(i)for(var r=0,o=0|e;r<16;r++,o++)n[transposeTransform[r]]=t.axGetNumericProperty(o)||0;else for(o=(r=0)|e;r<16;r++,o++)n[r]=t.axGetNumericProperty(o)||0},eQg.prototype.copyRowTo=function(t,e){this._adaptee.copyRowTo(t>>>0,e.adaptee)},eQg.prototype.copyColumnTo=function(t,e){this._adaptee.copyColumnTo(t>>>0,e.adaptee)},eQg.prototype.copyRowFrom=function(t,e){this._adaptee.copyRowFrom(t>>>0,e.adaptee)},eQg.prototype.copyColumnFrom=function(t,e){this._adaptee.copyColumnFrom(t>>>0,e.adaptee)},eQg.classInitializer=null,eQg),Point$1=(ERg=ASObject,__extends(FRg,ERg),Object.defineProperty(FRg.prototype,"adaptee",{get:function(){return this._adaptee},enumerable:!0,configurable:!0}),Object.defineProperty(FRg.prototype,"x",{get:function(){return this._adaptee._rawData[0]},set:function(t){this._adaptee._rawData[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty(FRg.prototype,"y",{get:function(){return this._adaptee._rawData[1]},set:function(t){this._adaptee._rawData[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty(FRg.prototype,"length",{get:function(){return this._adaptee.length},enumerable:!0,configurable:!0}),FRg.interpolate=function(t,e,i){return new this.sec.flash.geom.Point(Point.interpolate(t.adaptee,e.adaptee,i))},FRg.distance=function(t,e){return Point.distance(t.adaptee,e.adaptee)},FRg.polar=function(t,e){return new this.sec.flash.geom.Point(Point.polar(+t,+e))},FRg.prototype.clone=function(){return new this.sec.flash.geom.Point(this._adaptee.clone())},FRg.prototype.offset=function(t,e){this._adaptee.offset(t,e)},FRg.prototype.equals=function(t){return this._adaptee.equals(t.adaptee)},FRg.prototype.subtract=function(t){return new this.sec.flash.geom.Point(this._adaptee.subtract(t.adaptee))},FRg.prototype.add=function(t){return new this.sec.flash.geom.Point(this._adaptee.add(t.adaptee))},FRg.prototype.normalize=function(t){void 0===t&&(t=1),this._adaptee.normalize(+t)},FRg.prototype.copyFrom=function(t){this._adaptee.copyFrom(t.adaptee)},FRg.prototype.setTo=function(t,e){this._adaptee.setTo(t,e)},FRg.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")"},FRg.classInitializer=null,FRg.classSymbols=null,FRg.instanceSymbols=null,FRg),Rectangle$1=(_Rg=ASObject,__extends(aSg,_Rg),Object.defineProperty(aSg.prototype,"adaptee",{get:function(){return this._adaptee},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"height",{get:function(){return this._adaptee._rawData[3]},set:function(t){this._adaptee._rawData[3]=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"width",{get:function(){return this._adaptee._rawData[2]},set:function(t){this._adaptee._rawData[2]=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"x",{get:function(){return this._adaptee._rawData[0]},set:function(t){this._adaptee._rawData[0]=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"y",{get:function(){return this._adaptee._rawData[1]},set:function(t){this._adaptee._rawData[1]=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"bottom",{get:function(){return this._adaptee.bottom},set:function(t){this._adaptee.bottom=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"bottomRight",{get:function(){return new this.sec.flash.geom.Point(this._adaptee.bottomRight)},set:function(t){this.bottom=t.y,this.right=t.x},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"left",{get:function(){return this._adaptee.left},set:function(t){this._adaptee.left=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"right",{get:function(){return this._adaptee.right},set:function(t){this._adaptee.right=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"size",{get:function(){return new this.sec.flash.geom.Point(this._adaptee.size)},set:function(t){this.width=t.x,this.height=t.y},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"top",{get:function(){return this._adaptee.top},set:function(t){this._adaptee.top=+t},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"topLeft",{get:function(){return new this.sec.flash.geom.Point(this._adaptee.topLeft)},set:function(t){this.top=t.y,this.left=t.x},enumerable:!0,configurable:!0}),Object.defineProperty(aSg.prototype,"area",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),aSg.FromBounds=function(t){var e=t.xMin,i=t.yMin;return new this.sec.flash.geom.Rectangle(e/20,i/20,(t.xMax-e)/20,(t.yMax-i)/20)},aSg.prototype.clone=function(){return new this.sec.flash.geom.Rectangle(this._adaptee.clone())},aSg.prototype.isEmpty=function(){return this._adaptee.isEmpty()},aSg.prototype.setEmpty=function(){return this._adaptee.setEmpty()},aSg.prototype.inflate=function(t,e){this._adaptee.inflate(+t,+e)},aSg.prototype.inflatePoint=function(t){this._adaptee.inflatePoint(t.adaptee)},aSg.prototype.offset=function(t,e){this._adaptee.offset(+t,+e)},aSg.prototype.offsetPoint=function(t){this._adaptee.offsetPoint(t.adaptee)},aSg.prototype.contains=function(t,e){return this._adaptee.contains(+t,+e)},aSg.prototype.containsPoint=function(t){return this._adaptee.containsPoint(t.adaptee)},aSg.prototype.containsRect=function(t){return this._adaptee.containsRect(t.adaptee)},aSg.prototype.intersection=function(t){return new this.sec.flash.geom.Rectangle(this._adaptee.intersection(t.adaptee))},aSg.prototype.intersects=function(t){return this._adaptee.intersects(t.adaptee)},aSg.prototype.union=function(t){return new this.sec.flash.geom.Rectangle(this._adaptee.union(t.adaptee))},aSg.prototype.equals=function(t){return this._adaptee.equals(t.adaptee)},aSg.prototype.copyFrom=function(t){this._adaptee.copyFrom(t.adaptee)},aSg.prototype.setTo=function(t,e,i,n){this._adaptee.setTo(+t,+e,+i,+n)},aSg.prototype.toString=function(){return"(x="+this.x+", y="+this.y+", w="+this.width+", h="+this.height+")"},aSg.prototype.hashCode=function(){var t=0;return t+=20*this.x|0,t*=37,t+=20*this.y|0,t*=37,t+=20*this.width|0,(t*=37)+(20*this.height|0)},aSg.prototype.writeExternal=function(t){t.writeFloat(this.x),t.writeFloat(this.y),t.writeFloat(this.width),t.writeFloat(this.height)},aSg.prototype.readExternal=function(t){this.x=t.readFloat(),this.y=t.readFloat(),this.width=t.readFloat(),this.height=t.readFloat()},aSg.classInitializer=null,aSg.classSymbols=null,aSg.instanceSymbols=null,aSg),Transform$1=(QSg=ASObject,__extends(RSg,QSg),Object.defineProperty(RSg.prototype,"adaptee",{get:function(){return this._adaptee},enumerable:!0,configurable:!0}),Object.defineProperty(RSg.prototype,"matrix",{get:function(){return new this.sec.flash.geom.Matrix(this._adaptee.matrix)},set:function(t){this._adaptee.matrix=t.adaptee},enumerable:!0,configurable:!0}),Object.defineProperty(RSg.prototype,"colorTransform",{get:function(){return new this.sec.flash.geom.ColorTransform(this._adaptee.colorTransform)},set:function(t){this._adaptee.colorTransform=t.adaptee},enumerable:!0,configurable:!0}),Object.defineProperty(RSg.prototype,"concatenatedMatrix",{get:function(){return new this.sec.flash.geom.Matrix(this._adaptee.matrix)},enumerable:!0,configurable:!0}),Object.defineProperty(RSg.prototype,"concatenatedColorTransform",{get:function(){return new this.sec.flash.geom.ColorTransform(this._adaptee.colorTransform)},enumerable:!0,configurable:!0}),Object.defineProperty(RSg.prototype,"pixelBounds",{get:function(){return new this.sec.flash.geom.Rectangle(this._adaptee.pixelBounds)},enumerable:!0,configurable:!0}),Object.defineProperty(RSg.prototype,"matrix3D",{get:function(){return new this.sec.flash.geom.Matrix3D(this._adaptee.matrix3D)},set:function(t){},enumerable:!0,configurable:!0}),RSg.prototype.getRelativeMatrix3D=function(t){return checkNullParameter(t,"relativeTo",this.sec),new this.sec.flash.geom.Matrix3D(this._adaptee.matrix3D)},Object.defineProperty(RSg.prototype,"perspectiveProjection",{get:function(){return new PerspectiveProjection},set:function(t){},enumerable:!0,configurable:!0}),RSg.classInitializer=null,RSg),Vector3D$1=(ZSg=ASObject,__extends($Sg,ZSg),$Sg.classInitializer=function(){this.X_AXIS=Object.freeze(this.Create(1,0,0,0)),this.Y_AXIS=Object.freeze(this.Create(1,0,0,0)),this.Z_AXIS=Object.freeze(this.Create(1,0,0,0))},$Sg.Create=function(t,e,i,n){var r=Object.create(this.tPrototype);return r._adaptee=new Vector3D(t,e,i,n),r},Object.defineProperty($Sg.prototype,"adaptee",{get:function(){return this._adaptee},enumerable:!0,configurable:!0}),Object.defineProperty($Sg.prototype,"x",{get:function(){return this._adaptee._rawData[0]},set:function(t){this._adaptee._rawData[0]=t},enumerable:!0,configurable:!0}),Object.defineProperty($Sg.prototype,"y",{get:function(){return this._adaptee._rawData[1]},set:function(t){this._adaptee._rawData[1]=t},enumerable:!0,configurable:!0}),Object.defineProperty($Sg.prototype,"z",{get:function(){return this._adaptee._rawData[2]},set:function(t){this._adaptee._rawData[2]=t},enumerable:!0,configurable:!0}),Object.defineProperty($Sg.prototype,"w",{get:function(){return this._adaptee._rawData[3]},set:function(t){this._adaptee._rawData[3]=t},enumerable:!0,configurable:!0}),Object.defineProperty($Sg.prototype,"length",{get:function(){return this._adaptee.length},enumerable:!0,configurable:!0}),Object.defineProperty($Sg.prototype,"lengthSquared",{get:function(){return this._adaptee.lengthSquared},enumerable:!0,configurable:!0}),$Sg.angleBetween=function(t,e){return Vector3D.angleBetween(t.adaptee,e.adaptee)},$Sg.distance=function(t,e){return Vector3D.distance(t.adaptee,e.adaptee)},$Sg.prototype.dotProduct=function(t){return this._adaptee.dotProduct(t.adaptee)},$Sg.prototype.crossProduct=function(t){return new this.sec.flash.geom.Vector3D(this._adaptee.crossProduct(t.adaptee))},$Sg.prototype.normalize=function(){return this._adaptee.normalize()},$Sg.prototype.scaleBy=function(t){this._adaptee.scaleBy(+t)},$Sg.prototype.incrementBy=function(t){this._adaptee.incrementBy(t.adaptee)},$Sg.prototype.decrementBy=function(t){this._adaptee.decrementBy(t.adaptee)},$Sg.prototype.add=function(t){return new this.sec.flash.geom.Vector3D(this._adaptee.add(t.adaptee))},$Sg.prototype.subtract=function(t){return new this.sec.flash.geom.Vector3D(this._adaptee.subtract(t.adaptee))},$Sg.prototype.negate=function(){this._adaptee.negate()},$Sg.prototype.equals=function(t,e){return this._adaptee.equals(t.adaptee,e)},$Sg.prototype.nearEquals=function(t,e,i){return this._adaptee.nearEquals(t.adaptee,e,i)},$Sg.prototype.project=function(){this._adaptee.project()},$Sg.prototype.copyFrom=function(t){this._adaptee.copyFrom(t.adaptee)},$Sg.prototype.setTo=function(t,e,i){this._adaptee.setTo(t,e,i)},$Sg.prototype.clone=function(){return new this.sec.flash.geom.Vector3D(this._adaptee.clone())},$Sg.prototype.toString=function(){return"Vector3D("+this.x+", "+this.y+", "+this.z+")"},$Sg),System$1=(HTg=ASObject,__extends(ITg,HTg),Object.defineProperty(ITg,"freeMemory",{get:function(){return console.log("freeMemory not implemented yet in flash/System"),0},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"ime",{get:function(){return console.log("ime not implemented yet in flash/System"),null},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"privateMemory",{get:function(){return console.log("privateMemory not implemented yet in flash/System"),0},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"processCPUUsage",{get:function(){return console.log("processCPUUsage not implemented yet in flash/System"),0},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"totalMemory",{get:function(){return console.log("totalMemory not implemented yet in flash/System"),0},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"totalMemoryNumber",{get:function(){return console.log("totalMemoryNumber not implemented yet in flash/System"),0},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"useCodePage",{get:function(){return console.log("useCodePage not implemented yet in flash/System"),!1},set:function(t){console.log("useCodePage not implemented yet in flash/System")},enumerable:!0,configurable:!0}),Object.defineProperty(ITg,"vmVersion",{get:function(){return console.log("vmVersion not implemented yet in flash/System"),""},enumerable:!0,configurable:!0}),ITg.disposeXML=function(t){console.log("disposeXML not implemented yet in flash/System")},ITg.exit=function(t){console.log("exit not implemented yet in flash/System")},ITg.gc=function(){console.log("gc not implemented yet in flash/System")},ITg.pause=function(){console.log("pause not implemented yet in flash/System")},ITg.pauseForGCIfCollectionImminent=function(t){console.log("pauseForGCIfCollectionImminent not implemented yet in flash/System")},ITg.resume=function(){console.log("resume not implemented yet in flash/System")},ITg.setClipboard=function(t){console.log("setClipboard not implemented yet in flash/System")},ITg),Graphics$1=(OTg=ASObject,__extends(PTg,OTg),PTg.prototype.dispose=function(){},Object.defineProperty(PTg.prototype,"adaptee",{get:function(){return this._adaptee},enumerable:!0,configurable:!0}),PTg.FromData=function(t,e){return new this.sec.flash.display.Graphics},PTg.prototype.clear=function(){this.adaptee.clear()},PTg.prototype.beginFill=function(t,e){void 0===e&&(e=1),this.adaptee.beginFill(t,e)},PTg.prototype.beginGradientFill=function(t,e,i,n,r,o,s,a){void 0===r&&(r=null),void 0===o&&(o="pad"),void 0===s&&(s="rgb"),void 0===a&&(a=0),this.adaptee.beginGradientFill(t,e.value,i.value,n.value,null==r?void 0:r.adaptee,o,s,a)},PTg.prototype.beginBitmapFill=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=!0),void 0===n&&(n=!1),this.adaptee.beginBitmapFill(t.adaptee,null==e?void 0:e.adaptee,i,n)},PTg.prototype.endFill=function(){this.adaptee.endFill()},PTg.prototype.lineStyle=function(t,e,i,n,r,o,s,a){void 0===e&&(e=0),void 0===i&&(i=1),void 0===n&&(n=!1),void 0===r&&(r="normal"),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=3),this.adaptee.lineStyle(t,e,i,n,r,o,s,a)},PTg.prototype.lineGradientStyle=function(t,e,i,n,r,o,s,a){void 0===r&&(r=null),void 0===o&&(o="pad"),void 0===s&&(s="rgb"),void 0===a&&(a=0),this.adaptee.lineGradientStyle(t,e.value,i.value,n.value,null==r?void 0:r.adaptee,o,s,a)},PTg.prototype.lineBitmapStyle=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=!0),void 0===n&&(n=!1),this.adaptee.lineBitmapStyle(t.adaptee,null==e?void 0:e.adaptee,i,n)},PTg.prototype.drawRect=function(t,e,i,n){this.adaptee.drawRect(t,e,i,n)},PTg.prototype.drawRoundRect=function(t,e,i,n,r,o){this.adaptee.drawRoundRect(t,e,i,n,r,o)},PTg.prototype.drawRoundRectComplex=function(t,e,i,n,r,o,s,a){this.adaptee.drawRoundRectComplex(t,e,i,n,r,o,s,a)},PTg.prototype.drawCircle=function(t,e,i){this.adaptee.drawCircle(t,e,i)},PTg.prototype.drawEllipse=function(t,e,i,n){this.adaptee.drawEllipse(t,e,i,n)},PTg.prototype.moveTo=function(t,e){this.adaptee.moveTo(t,e)},PTg.prototype.lineTo=function(t,e){this.adaptee.lineTo(t,e)},PTg.prototype.curveTo=function(t,e,i,n){this.adaptee.curveTo(t,e,i,n)},PTg.prototype.cubicCurveTo=function(t,e,i,n,r,o){this.adaptee.cubicCurveTo(t,e,i,n,r,o)},PTg.prototype.copyFrom=function(t){this.adaptee.copyFrom(t.adaptee)},PTg.prototype.drawPath=function(t,e,i){},PTg.prototype.drawTriangles=function(t,e,i,n){},PTg.prototype.drawGraphicsData=function(t){},PTg.classInitializer=null,PTg),URLLoader$1=(uVg=EventDispatcher$1,__extends(vVg,uVg),vVg.prototype.close=function(){console.log("not mimplemented: URLoader.close")},Object.defineProperty(vVg.prototype,"data",{get:function(){return this._adaptee.data},enumerable:!0,configurable:!0}),vVg.prototype.initListener=function(t,e){this._adaptee.addEventListener(t,e)},vVg.prototype.removeListener=function(t,e){this._adaptee.removeEventListener(t,e)},vVg.prototype.addEventListener=function(t,e){uVg.prototype.addEventListener.call(this,t,e)},vVg.prototype.loadErrorDelegate=function(t){var e=new this.sec.flash.events.IOErrorEvent(IOErrorEvent.IO_ERROR);(e.currentTarget=this).dispatchEvent(e)},vVg.prototype.progressCallback=function(t){void 0===t&&(t=null);var e=new this.sec.flash.events.ProgressEvent(ProgressEvent$1.PROGRESS,null,null,t.urlLoader.bytesLoaded,t.urlLoader.bytesTotal);(e.currentTarget=this).dispatchEvent(e)},vVg.prototype.completeCallback=function(t){var e=new this.sec.flash.events.Event(Event$1.COMPLETE);e.currentTarget=this,(e.target=this).dispatchEvent(e)},vVg.prototype.load=function(t){var e=t.url||"",i=matchRedirect(e,vVg.redirectRules);i?(console.log("[URL LOADER] Override loading url:",i.url),t.adaptee.url=i.url):console.log("[URL LOADER] start loading the url:",e),this._adaptee.load(t.adaptee)},vVg.redirectRules=[],vVg),TextField$1=(PVg=InteractiveObject,__extends(QVg,PVg),QVg.getNewTextField=function(t){if(void 0===t&&(t=null),QVg._textFields.length){var e=QVg._textFields.pop();return e.adaptee=t||TextField.getNewTextField(),e}return new QVg},QVg.prototype.createAdaptee=function(){var t=TextField.getNewTextField();return t.reset(),t},QVg.prototype.initAdapter=function(){},QVg.prototype.dispatchKeyEvent=function(t,e,i,n){},QVg.prototype.selectTextField=function(){},QVg.prototype.clone=function(){var t=constructClassFromSymbol(this._symbol,this._symbol.symbolClass),e=new TextField;return this.adaptee.copyTo(e),t.adaptee=e,t._stage=this.activeStage,t.executeConstructor=function(){t.axInitializer()},t},QVg.prototype.dispose=function(){this.disposeValues(),QVg._textFields.push(this)},Object.defineProperty(QVg.prototype,"alwaysShowSelection",{get:function(){return this._adaptee.alwaysShowSelection},set:function(t){this._adaptee.alwaysShowSelection=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"antiAliasType",{get:function(){return""},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"autoSize",{get:function(){return this._adaptee.autoSize},set:function(t){this._adaptee.autoSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"background",{get:function(){return this._adaptee.background},set:function(t){this._adaptee.background=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"backgroundColor",{get:function(){return this._adaptee.backgroundColor},set:function(t){this._adaptee.backgroundColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"border",{get:function(){return this._adaptee.border},set:function(t){this._adaptee.border=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"borderColor",{get:function(){return this._adaptee.borderColor},set:function(t){this._adaptee.borderColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"bottomScrollV",{get:function(){throw"bottomScrollV not implemented yet in flash/TextField"},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"caretIndex",{get:function(){throw"caretIndex not implemented yet in flash/TextField"},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"condenseWhite",{get:function(){throw"condenseWhite not implemented yet in flash/TextField"},set:function(t){throw"condenseWhite not implemented yet in flash/TextField"},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"defaultTextFormat",{get:function(){var t=this._adaptee.textFormat;return!t.adapter&&t.adapter!==t.adaptee||(t.adapter=new this.sec.flash.text.TextFormat,t.adapter.adaptee=t),t.adapter},set:function(t){this._adaptee.textFormat=t.adaptee},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"displayAsPassword",{get:function(){return this._adaptee.displayAsPassword},set:function(t){this._adaptee.displayAsPassword=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"embedFonts",{get:function(){return!1},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"gridFitType",{get:function(){return""},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"htmlText",{get:function(){return this.adaptee.htmlText},set:function(t){this.adaptee.htmlText=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"length",{get:function(){return this._adaptee.length},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"maxChars",{get:function(){return this.adaptee.maxChars},set:function(t){this.adaptee.maxChars=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"maxScrollH",{get:function(){return this.adaptee.maxScrollH},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"maxScrollV",{get:function(){return this.adaptee.maxScrollV},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"mouseWheelEnabled",{get:function(){return this.adaptee.mouseWheelEnabled},set:function(t){this.adaptee.mouseWheelEnabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"multiline",{get:function(){return this._adaptee.multiline},set:function(t){this._adaptee.multiline=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"numLines",{get:function(){return this._adaptee.numLines},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"restrict",{get:function(){return this.adaptee.restrict},set:function(t){this.adaptee.restrict=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"scrollH",{get:function(){return this.adaptee.scrollH},set:function(t){this.adaptee.scrollH=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"scrollV",{get:function(){return this.adaptee.scrollV},set:function(t){this.adaptee.scrollV=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"selectable",{get:function(){return this.adaptee.selectable},set:function(t){this._adaptee.selectable=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"selectedText",{get:function(){return console.log("selectedText not implemented yet in flash/TextField"),""},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"selectionBeginIndex",{get:function(){return this.adaptee.selectionBeginIndex},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"selectionEndIndex",{get:function(){return this.adaptee.selectionEndIndex},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"sharpness",{get:function(){return console.log("sharpness not implemented yet in flash/TextField"),0},set:function(t){console.log("sharpness not implemented yet in flash/TextField")},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"styleSheet",{get:function(){return console.log("styleSheet not implemented yet in flash/TextField"),null},set:function(t){console.log("styleSheet not implemented yet in flash/TextField")},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"text",{get:function(){return this._adaptee.text},set:function(t){this._adaptee.text=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"textColor",{get:function(){return this._adaptee.textColor},set:function(t){this._adaptee.textColor=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"textHeight",{get:function(){return this._adaptee.textHeight},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"textInteractionMode",{get:function(){return console.log("textInteractionMode not implemented yet in flash/TextField"),""},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"textWidth",{get:function(){return this._adaptee.textWidth},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"thickness",{get:function(){return console.log("thickness not implemented yet in flash/TextField"),0},set:function(t){console.log("thickness not implemented yet in flash/TextField")},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"type",{get:function(){return this._adaptee.type},set:function(t){this._adaptee.type=t},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"useRichTextClipboard",{get:function(){return console.log("useRichTextClipboard not implemented yet in flash/TextField"),!1},set:function(t){console.log("useRichTextClipboard not implemented yet in flash/TextField")},enumerable:!0,configurable:!0}),Object.defineProperty(QVg.prototype,"wordWrap",{get:function(){return this._adaptee.wordWrap},set:function(t){this._adaptee.wordWrap=t},enumerable:!0,configurable:!0}),QVg.prototype.appendText=function(t){this._adaptee.appendText(t)},QVg.prototype.copyRichText=function(){return console.log("copyRichText not implemented yet in flash/TextField"),""},QVg.prototype.getCharBoundaries=function(t){return console.log("getCharBoundaries not implemented yet in flash/TextField"),null},QVg.prototype.getCharIndexAtPoint=function(t,e){return this._adaptee.getCharIndexAtPoint(t,e)},QVg.prototype.getFirstCharInParagraph=function(t){return this._adaptee.getFirstCharInParagraph(t)},QVg.prototype.getImageReference=function(t){return console.log("getImageReference not implemented yet in flash/TextField"),null},QVg.prototype.getLineIndexAtPoint=function(t,e){return this._adaptee.getLineIndexAtPoint(t,e)},QVg.prototype.getLineIndexOfChar=function(t){return this._adaptee.getLineIndexOfChar(t)},QVg.prototype.getLineLength=function(t){return this._adaptee.getLineLength(t)},QVg.prototype.getLineMetrics=function(t){var e=this._adaptee.getLineMetrics(t),i=e.x,n=e.width,r=e.height,o=e.ascent,s=e.descent,a=e.leading;return new this.sec.flash.text.TextLineMetrics(i,n,r,o,s,a)},QVg.prototype.getLineOffset=function(t){return this._adaptee.getLineOffset(t)},QVg.prototype.getLineText=function(t){return this._adaptee.getLineText(t)},QVg.prototype.getParagraphLength=function(t){return this._adaptee.getParagraphLength(t)},QVg.prototype.getRawText=function(){return console.log("getRawText not implemented yet in flash/TextField"),""},QVg.prototype.getTextFormat=function(t,e){return void 0===t&&(t=-1),void 0===e&&(e=-1),console.log("todo: textformats"),this._adaptee.getTextFormat(t,e).adapter},QVg.prototype.getTextRuns=function(t,e){return console.log("getTextRuns not implemented yet in flash/TextField"),[]},QVg.prototype.getXMLText=function(t,e){return console.log("getXMLText not implemented yet in flash/TextField"),""},QVg.prototype.insertXMLText=function(t,e,i,n){console.log("insertXMLText not implemented yet in flash/TextField")},QVg.isFontCompatible=function(t,e){return console.log("isFontCompatible not implemented yet in flash/TextField"),!1},QVg.prototype.pasteRichText=function(t){return console.log("pasteRichText not implemented yet in flash/TextField"),!1},QVg.prototype.replaceSelectedText=function(t){return this._adaptee.replaceSelectedText(t)},QVg.prototype.replaceText=function(t,e,i){return this._adaptee.replaceText(t,e,i)},QVg.prototype.setSelection=function(t,e){return this._adaptee.setSelection(t,e)},QVg.prototype.setTextFormat=function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=-1),this._adaptee.setTextFormat(t.adaptee,e,i)},QVg._textFields=new Array,QVg),TextFormat$1=(rXg=ASObject,__extends(sXg,rXg),Object.defineProperty(sXg.prototype,"target",{get:function(){return console.log("not implemented: TextFormat target"),null},set:function(t){console.log("not implemented: TextFormat target")},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"tabStops",{get:function(){return console.log("not implemented: TextFormat tabStops"),null},set:function(t){console.log("not implemented: TextFormat tabStops")},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"display",{get:function(){return console.log("not implemented: TextFormat display"),null},set:function(t){console.log("not implemented: TextFormat display")},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"bullet",{get:function(){return console.log("not implemented: TextFormat bullet"),null},set:function(t){console.log("not implemented: TextFormat bullet")},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"url",{get:function(){return console.log("not implemented: TextFormat url"),null},set:function(t){console.log("not implemented: TextFormat url")},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"link_target",{get:function(){return console.log("not implemented: TextFormat link_target"),null},set:function(t){console.log("not implemented: TextFormat link_target")},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"align",{get:function(){return this.adaptee.align},set:function(t){this.adaptee.align=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"blockIndent",{get:function(){return this.adaptee.blockIndent},set:function(t){this.adaptee.blockIndent=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"leftMargin",{get:function(){return this.adaptee.leftMargin},set:function(t){this.adaptee.leftMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"rightMargin",{get:function(){return this.adaptee.rightMargin},set:function(t){this.adaptee.rightMargin=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"indent",{get:function(){return this.adaptee.indent},set:function(t){this.adaptee.indent=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"color",{get:function(){return this.adaptee.color},set:function(t){this.adaptee.color=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"kerning",{get:function(){return this.adaptee.kerning},set:function(t){this.adaptee.kerning=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"leading",{get:function(){return this.adaptee.leading},set:function(t){this.adaptee.leading=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"letterSpacing",{get:function(){return this.adaptee.letterSpacing},set:function(t){this.adaptee.letterSpacing=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"size",{get:function(){return this.adaptee.size},set:function(t){this.adaptee.size=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"bold",{get:function(){return this.adaptee.bold},set:function(t){this.adaptee.bold=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"italic",{get:function(){return this.adaptee.italic},set:function(t){this.adaptee.italic=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"underline",{get:function(){return this.adaptee.underline},set:function(t){this.adaptee.underline=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"font_name",{get:function(){return this.adaptee.font_name},set:function(t){this.adaptee.font_name=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"style_name",{get:function(){return this.adaptee.style_name},set:function(t){this.adaptee.style_name=t},enumerable:!0,configurable:!0}),Object.defineProperty(sXg.prototype,"font",{get:function(){return this.adaptee.font},set:function(t){this.adaptee.font=t},enumerable:!0,configurable:!0}),sXg.prototype.clone=function(){var t=new this.sec.flash.text.TextFormat;return t.adaptee=this.adaptee.clone(),t},sXg),SoundChannel$1=(cYg=EventDispatcher$1,__extends(dYg,cYg),dYg.prototype.axCallPublicProperty=function(t,e){return null},dYg.prototype.axGetPublicProperty=function(t){return null},dYg.prototype.axSetPublicProperty=function(t,e){return null},dYg.prototype.axHasPublicProperty=function(t){return null},dYg.prototype.axDeletePublicProperty=function(t){return null},dYg.prototype.axGetEnumerableKeys=function(){return[]},Object.defineProperty(dYg.prototype,"leftPeak",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(dYg.prototype,"position",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(dYg.prototype,"rightPeak",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(dYg.prototype,"soundTransform",{get:function(){return this._soundTransform||(this._soundTransform=new this.sec.flash.media.SoundTransform),this._soundTransform},set:function(t){this._sound&&(this._sound.adaptee.volume=t.volume,this._sound.adaptee.pan=t.pan),this._soundTransform=t},enumerable:!0,configurable:!0}),dYg.prototype.stop=function(){this._sound&&this._sound.stop()},dYg),SoundTransform$1=(mYg=ASObject,__extends(nYg,mYg),nYg.prototype.axCallPublicProperty=function(t,e){return console.log("axCallPublicProperty not implemented yet in flash/SoundTransform"),null},nYg.prototype.axGetPublicProperty=function(t){return console.log("axGetPublicProperty not implemented yet in flash/SoundTransform"),null},nYg.prototype.axSetPublicProperty=function(t,e){return console.log("axSetPublicProperty not implemented yet in flash/SoundTransform"),null},nYg.prototype.axHasPublicProperty=function(t){return console.log("axHasPublicProperty not implemented yet in flash/SoundTransform"),null},nYg.prototype.axDeletePublicProperty=function(t){return console.log("axDeletePublicProperty not implemented yet in flash/SoundTransform"),null},nYg.prototype.axGetEnumerableKeys=function(){return console.log("axGetEnumerableKeys not implemented yet in flash/SoundTransform"),[]},Object.defineProperty(nYg.prototype,"leftToLeft",{get:function(){return console.log("leftToLeft not implemented yet in flash/SoundTransform"),0},set:function(t){console.log("leftToLeft not implemented yet in flash/SoundTransform")},enumerable:!0,configurable:!0}),Object.defineProperty(nYg.prototype,"leftToRight",{get:function(){return console.log("leftToRight not implemented yet in flash/SoundTransform"),0},set:function(t){console.log("leftToRight not implemented yet in flash/SoundTransform")},enumerable:!0,configurable:!0}),Object.defineProperty(nYg.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t},enumerable:!0,configurable:!0}),Object.defineProperty(nYg.prototype,"rightToLeft",{get:function(){return console.log("rightToLeft not implemented yet in flash/SoundTransform"),0},set:function(t){console.log("rightToLeft not implemented yet in flash/SoundTransform")},enumerable:!0,configurable:!0}),Object.defineProperty(nYg.prototype,"rightToRight",{get:function(){return console.log("rightToRight not implemented yet in flash/SoundTransform"),0},set:function(t){console.log("rightToRight not implemented yet in flash/SoundTransform")},enumerable:!0,configurable:!0}),Object.defineProperty(nYg.prototype,"volume",{get:function(){return this._vol},set:function(t){this._vol=t},enumerable:!0,configurable:!0}),nYg),_sharedObjectStorage,VirtualStorage=(EYg.prototype.getItem=function(t){return this._values[t]},EYg.prototype.setItem=function(t,e){this._values[t]=e},EYg.prototype.removeItem=function(t){delete this._values[t]},EYg),mYg,cYg,rXg,PVg,uVg,OTg,HTg,ZSg,QSg,_Rg,ERg,dQg,ePg,AOg,jOg,gNg,XMg,yLg,dLg,VKg,OKg,FKg,wKg,WJg,yJg,bJg,XIg,VIg,rIg,ZFg,EFg,cFg,TDg,mDg,cCg,oBg,YAg,xAg,cAg,Gzg;function EYg(){this._values={}}function nYg(t,e){var i=mYg.call(this)||this;return i._vol=1,i._pan=.5,i}function dYg(){return cYg.call(this)||this}function sXg(t,e,i,n,r,o,s,a,l,c,h,u,p){void 0===t&&(t=null),void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=null),void 0===s&&(s=null),void 0===a&&(a=null),void 0===l&&(l=null),void 0===c&&(c=null),void 0===h&&(h=null),void 0===u&&(u=null),void 0===p&&(p=null);var d=rXg.call(this)||this;return d.adaptee=new TextFormat(t,e,i,n,r,o,s,a,l,c,h,u,p),d}function QVg(){var t=PVg.call(this)||this;return t.adaptee.autoSize=TextFieldAutoSize.NONE,t.eventMappingDummys[TextEvent.TEXT_INPUT]="TextField:TextEvent.TEXT_INPUT",t.eventMappingDummys[TextEvent.LINK]="TextField:TextEvent.LINK",t.eventMappingDummys[Event$1.SCROLL]="TextField:Event.SCROLL",t.eventMappingDummys[Event$1.CHANGE]="TextField:Event.CHANGE",t.eventMappingDummys[Event$1.TEXT_INTERACTION_MODE_CHANGE]="TextField:Event.TEXT_INTERACTION_MODE_CHANGE",t}function vVg(){var e=uVg.call(this)||this;return e._adaptee=new URLLoader,e._completeCallbackDelegate=function(t){return e.completeCallback(t)},e._progressCallbackDelegate=function(t){return e.progressCallback(t)},e._loadErrorDelegate=function(t){return e.loadErrorDelegate(t)},e.eventMapping[Event$1.COMPLETE]={adaptedType:URLLoaderEvent.LOAD_COMPLETE,addListener:e.initListener,removeListener:e.removeListener,callback:e._completeCallbackDelegate},e.eventMapping[ProgressEvent$1.PROGRESS]={adaptedType:URLLoaderEvent.LOAD_PROGRESS,addListener:e.initListener,removeListener:e.removeListener,callback:e._progressCallbackDelegate},e.eventMapping[IOErrorEvent.IO_ERROR]={adaptedType:URLLoaderEvent.LOAD_ERROR,addListener:e.initListener,removeListener:e.removeListener,callback:e._loadErrorDelegate},e}function PTg(t){void 0===t&&(t=null);var e=OTg.call(this)||this;return e._adaptee=t||new Graphics,e._adaptee.adapter=e}function ITg(){return HTg.call(this)||this}function $Sg(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0);var r=ZSg.call(this)||this;return r._adaptee=t instanceof Vector3D?t:new Vector3D(+t,+e,+i,+n),r}function RSg(t){var e=QSg.call(this)||this;return t||e.sec.throwError("ArgumentError",Errors$1.NullPointerError,"displayObject"),e._adaptee=t instanceof Transform?t:new Transform,e}function aSg(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0);var r=_Rg.call(this)||this;return r._adaptee=t instanceof Rectangle?t:new Rectangle(+t,+e,+i,+n),r}function FRg(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var i=ERg.call(this)||this;return i._adaptee=t instanceof Point?t:new Point(+t,+e),i}function eQg(t){void 0===t&&(t=null);var e=dQg.call(this)||this;return t instanceof Matrix3D?e._adaptee=t:(e._adaptee=new Matrix3D,t&&16<=t.length?e.copyRawDataFrom(t,0,!1):e.identity()),e}function fPg(t,e,i,n,r,o){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0);var s=ePg.call(this)||this;return s._adaptee=t instanceof Matrix?t:new Matrix(+t,+e,+i,+n,+r,+o),s}function BOg(t,e,i,n,r,o,s,a){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0);var l=AOg.call(this)||this;return l._adaptee=t instanceof ColorTransform?t:new ColorTransform(+t,+e,+i,+n,+r,+o,+s,+a),l}function kOg(t,e,i,n){var r=jOg.call(this)||this;return r._adaptee.addButtonListeners(),r}function hNg(){var t=gNg.call(this)||this;return t.queuedNavigationAction=null,t}function YMg(t){void 0===t&&(t=null);var e=XMg.call(this)||this;return e._adaptee=new URLRequest(t),e}function zLg(){var e=yLg.call(this)||this;return e._stage3Ds=[],e._resizeCallbackDelegate=function(t){return e.resizeCallback(t)},window.addEventListener("resize",e._resizeCallbackDelegate),e.eventMapping[Event$1.RESIZE]={adaptedType:"",addListener:e.initResizeListener,removeListener:e.removeResizeListener,callback:e._resizeCallbackDelegate},e._mouseLeaveCallbackDelegate=function(t){return e.mouseLeaveCallback(t)},e.eventMapping[Event$1.MOUSE_LEAVE]={adaptedType:"",addListener:e.initMouseLeaveListener,removeListener:e.removeMouseLeaveListener,callback:e._mouseLeaveCallbackDelegate},((e.sec.flash.display.DisplayObject.axClass._activeStage=e)._stage=e)._resizeCallbackDelegate(null),e}function eLg(t,e){var i=dLg.call(this)||this;return i._bytesLoaded=0,i._bytesTotal=0,i.eventMappingExtern[Event$1.COMPLETE]="LoaderInfo:Event.COMPLETE",i.eventMappingExtern[ProgressEvent$1.PROGRESS]="LoaderInfo:ProgressEvent.PROGRESS",i.eventMappingDummys[Event$1.UNLOAD]="LoaderInfo:Event.UNLOAD",i.eventMappingDummys[IOErrorEvent.IO_ERROR]="LoaderInfo:IOErrorEvent.IO_ERROR",i.eventMappingDummys[Event$1.OPEN]="LoaderInfo:Event.OPEN",i.eventMappingDummys[Event$1.INIT]="LoaderInfo:Event.INIT",i._onLoaderStartDelegate=function(t){return i._onLoaderStart(t)},i._onLoadProgressDelegate=function(t){return i._onLoadProgress(t)},i._onLoaderCompleteDelegate=function(t){return i._onLoaderComplete(t)},i._loader=t,i._container=e,i._container.addEventListener(LoaderEvent.LOADER_START,i._onLoaderStartDelegate),i._container.addEventListener(URLLoaderEvent.LOAD_PROGRESS,i._onLoadProgressDelegate),i._container.addEventListener(LoaderEvent.LOADER_COMPLETE,i._onLoaderCompleteDelegate),i}function WKg(t,e,i,n,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=0),void 0===r&&(r=0);var o=VKg.call(this,t,e,i)||this;return o._bytesLoaded=n,o._bytesTotal=r,o}function PKg(t,e,i,n,r){return void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=""),void 0===r&&(r=0),OKg.call(this,t,e,i,n,r)||this}function GKg(t,e,i,n,r){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=""),void 0===r&&(r=0);var o=FKg.call(this,t,e,i,n)||this;return o.setID(r),o}function xKg(t,e,i,n){var r=wKg.call(this,t,e,i)||this;return r._text=n,r}function XJg(){var t=WJg.call(this)||this;return t._contentLoaderInfo=new t.sec.flash.display.LoaderInfo(t,t.adaptee),t._factory=new FlashSceneGraphFactory(t.sec),t}function zJg(t,e){void 0===t&&(t=null),void 0===e&&(e=!1);var i=yJg.call(this)||this;return e||null!=t||null==zJg._currentDomain||(t=zJg.getSystemDomain()),(zJg._currentDomain=i)._parentDomain=t,i._definitions={},i._font_definitions={},i._audio_definitions={},i}function cJg(t,e){var i=bJg.call(this)||this;return i.loopsToPlay=0,i}function YIg(t,e,i){void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=null);var n=XIg.call(this)||this;return n.checkPolicyFile=t,n.applicationDomain=e,n.securityDomain=i,n}function WIg(){return VIg.call(this)||this}function sIg(t){var e=rIg.call(this)||this;return e.imageStore={},e._sec=t,e}function $Fg(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=4294967295);var r=ZFg.call(this)||this;return r._owners=new Array,r._adaptee="number"==typeof t?r._adaptee||new SceneImage2D(t,e,i,n,!1,StageManager.getInstance().getStageAt(0)):t,r._adaptee.adapter=r}function FFg(t,e,i){void 0===t&&(t=null),void 0===e&&(e="auto"),void 0===i&&(i=!1);var n=this,r=new MethodMaterial(t?t.adaptee:0);return r.alphaBlending=!0,r.useColorTransform=!0,FFg.argBitmapMaterial=r,FFg.argPixelSnapping=e,FFg.argSmoothing=i,n=EFg.call(this)||this,t&&!n._bitmapMappedFromAsset&&(n._bitmapData=t,n._bitmapData&&n._bitmapData._addOwner(n)),n}function dFg(){var e=cFg.call(this)||this;return e.isDragging=!1,e.startDragPoint=new Point,e.startDragMCPosition=new Point,e.dragListenerDelegate=function(t){return e.dragListener(t)},e.stopDragDelegate=function(t){return e.stopDrag(t)},e._graphics=new e.sec.flash.display.Graphics(e._adaptee.graphics),e}function UDg(){return TDg.call(this)||this}function nDg(){var e=mDg.call(this)||this;return e._keyDownListenersCnt=0,e._keyUpListenersCnt=0,e.eventMappingDummys[MouseEvent$2.RIGHT_MOUSE_UP]="InteractiveObject:MouseEvent.RIGHT_MOUSE_UP",e.eventMappingDummys[MouseEvent$2.RIGHT_MOUSE_DOWN]="InteractiveObject:MouseEvent.RIGHT_MOUSE_DOWN",e.eventMappingDummys[MouseEvent$2.RIGHT_MOUSE_DOWN]="InteractiveObject:MouseEvent.RIGHT_MOUSE_DOWN",e.eventMappingDummys[MouseEvent$2.RIGHT_CLICK]="InteractiveObject:MouseEvent.RIGHT_CLICK",e.eventMappingDummys[MouseEvent$2.MIDDLE_MOUSE_UP]="InteractiveObject:MouseEvent.MIDDLE_MOUSE_UP",e.eventMappingDummys[MouseEvent$2.MIDDLE_MOUSE_DOWN]="InteractiveObject:MouseEvent.MIDDLE_MOUSE_DOWN",e.eventMappingDummys[MouseEvent$2.MIDDLE_CLICK]="InteractiveObject:MouseEvent.MIDDLE_CLICK",e._keyDownListenersCnt=0,e._keyUpListenersCnt=0,e._keyUpCallbackDelegate=function(t){return e.keyUpCallback(t)},e.eventMapping[KeyboardEvent$2.KEY_UP]={adaptedType:"",addListener:e.initKeyUpListener,removeListener:e.removeKeyUpListener,callback:e._keyUpCallbackDelegate},e._keyDownCallbackDelegate=function(t){return e.keyDownCallback(t)},e.eventMapping[KeyboardEvent$2.KEY_DOWN]={adaptedType:"",addListener:e.initKeyDownListener,removeListener:e.removeKeyDownListener,callback:e._keyDownCallbackDelegate},e._mouseCallbackDelegate=function(t){return e.mouseCallback(t)},e.eventMappingInvert[MouseEvent$1.MOUSE_WHEEL]=MouseEvent$2.MOUSE_WHEEL,e.eventMapping[MouseEvent$2.MOUSE_WHEEL]={adaptedType:MouseEvent$1.MOUSE_WHEEL,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.MOUSE_UP]=MouseEvent$2.MOUSE_UP,e.eventMapping[MouseEvent$2.MOUSE_UP]={adaptedType:MouseEvent$1.MOUSE_UP,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.MOUSE_OVER]=MouseEvent$2.MOUSE_OVER,e.eventMapping[MouseEvent$2.MOUSE_OVER]={adaptedType:MouseEvent$1.MOUSE_OVER,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.MOUSE_OUT]=MouseEvent$2.MOUSE_OUT,e.eventMapping[MouseEvent$2.MOUSE_OUT]={adaptedType:MouseEvent$1.MOUSE_OUT,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.MOUSE_MOVE]=MouseEvent$2.MOUSE_MOVE,e.eventMapping[MouseEvent$2.MOUSE_MOVE]={adaptedType:MouseEvent$1.MOUSE_MOVE,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.MOUSE_DOWN]=MouseEvent$2.MOUSE_DOWN,e.eventMapping[MouseEvent$2.MOUSE_DOWN]={adaptedType:MouseEvent$1.MOUSE_DOWN,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.DOUBLE_CLICK]=MouseEvent$2.DOUBLE_CLICK,e.eventMapping[MouseEvent$2.DOUBLE_CLICK]={adaptedType:MouseEvent$1.DOUBLE_CLICK,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.CLICK]=MouseEvent$2.CLICK,e.eventMapping[MouseEvent$2.CLICK]={adaptedType:MouseEvent$1.CLICK,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.ROLL_OUT]=MouseEvent$2.ROLL_OUT,e.eventMapping[MouseEvent$2.ROLL_OUT]={adaptedType:MouseEvent$1.ROLL_OUT,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e.eventMappingInvert[MouseEvent$1.ROLL_OVER]=MouseEvent$2.ROLL_OVER,e.eventMapping[MouseEvent$2.ROLL_OVER]={adaptedType:MouseEvent$1.ROLL_OVER,addListener:e.initMouseListener,removeListener:e.removeMouseListener,callback:e._mouseCallbackDelegate},e}function dCg(){var t=cCg.call(this)||this;return t._filters=t._filters||[],t._blockedByScript=!1,t._ctBlockedByScript=!1,t._visibilityByScript=!1,t.adaptee=t.adaptee||t.createAdaptee(),t.adaptee.mouseEnabled=!0,t._stage=t.activeStage,t.eventMappingExtern[Event$1.ENTER_FRAME]="",t.eventMappingExtern[Event$1.FRAME_CONSTRUCTED]="",t.eventMappingExtern[Event$1.EXIT_FRAME]="",t.eventMappingExtern[Event$1.RENDER]="",t.eventMappingExtern[Event$1.REMOVED_FROM_STAGE]="",t.eventMappingExtern[Event$1.REMOVED]="",t.eventMappingExtern[Event$1.ADDED_TO_STAGE]="",t.eventMappingExtern[Event$1.ADDED]="",t._transform=new t.sec.flash.geom.Transform(t.adaptee.transform),t}function bCg(){}function OBg(){this.reset()}function pBg(t){void 0===t&&(t=null);var e=oBg.call(this,t)||this;return e.eventMapping={},e.eventMappingDummys={},e.eventMappingExtern={},e.eventMappingInvert={},e._activateCallbackDelegate=function(t){return e.activateCallback(t)},e.eventMapping[Event$1.ACTIVATE]={adaptedType:"",addListener:e.initActivateListener,removeListener:e.removeActivateListener,callback:e._activateCallbackDelegate},e._deactivateCallbackDelegate=function(t){return e.deactivateCallback(t)},e.eventMapping[Event$1.DEACTIVATE]={adaptedType:"",addListener:e.initDeactivateListener,removeListener:e.removeDeactivateListener,callback:e._deactivateCallbackDelegate},e}function ZAg(t,e,i,n,r,o,s,a,l){void 0===e&&(e=!0),void 0===i&&(i=!1),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===l&&(l=!1);var c=YAg.call(this,t,e,i)||this;return c._charCode=n>>>0,c._keyCode=r>>>0,c._keyLocation=o>>>0,c._ctrlKey=!!s,c._altKey=!!a,c._shiftKey=!!l,c}function yAg(t,e,i,n,r,o,s,a,l,c,h){void 0===e&&(e=!0),void 0===i&&(i=!1),void 0===n&&(n=void 0),void 0===r&&(r=void 0),void 0===o&&(o=null),void 0===s&&(s=!1),void 0===a&&(a=!1),void 0===l&&(l=!1),void 0===c&&(c=!1),void 0===h&&(h=0);var u=xAg.call(this,t,e,i)||this;return u._localX=n,u._localY=r,u._relatedObject=o,u._ctrlKey=s,u._altKey=a,u._shiftKey=l,u._buttonDown=c,u._delta=h,u}function qAg(){this._index=0,this._listeners=new Array,this.numListeners=0}function dAg(t){void 0===t&&(t=null);var e=cAg.call(this)||this;return e._listenerObjects=new Array,e._t=t||e,e}function Hzg(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0);var n=Gzg.call(this)||this;return n._iAllowedToPropagate=!0,n._iAllowedToImmediatlyPropagate=!0,n._type=axCoerceString(t),n._bubbles=!!e,n._cancelable=!!i,n._target=null,n._currentTarget=null,n._eventPhase=null,n._stopPropagation=!1,n._stopImmediatePropagation=!1,n._isDefaultPrevented=!1,n}function getSharedObjectStorage(){if("undefined"!=typeof Storage&&!_sharedObjectStorage)try{_sharedObjectStorage=window.localStorage}catch(t){console.warn("[Shared Storage] ",t),_sharedObjectStorage=new VirtualStorage}return _sharedObjectStorage}var SharedObject=(KYg=ASObject,__extends(LYg,KYg),Object.defineProperty(LYg,"defaultObjectEncoding",{get:function(){},set:function(t){},enumerable:!0,configurable:!0}),LYg.deleteAll=function(t){},LYg.getDiskUsage=function(t){return 0},LYg.getLocal=function(t,e,i){t=axCoerceString$2(t);var n,r=((e=axCoerceString$2(e))||"")+"/"+t,o=getSharedObjectStorage().getItem(r),s=this._defaultObjectEncoding;if(o){try{var a=StringUtilities.decodeRestrictedBase64ToBytes(o),l=new ByteArray(a.length);l.sec=this.sec,l.setArrayBuffer(a.buffer),n=AMF3.read(l)}catch(t){}n&&"object"==typeof n||(n=this.sec.createObject())}else n=this.sec.createObject();var c=new this.sec.flash.net.SharedObject;return c._path=r,c._objectEncoding=s,c._data=n,c},LYg.getRemote=function(t,e,i,n){return new this.sec.flash.net.SharedObject},LYg.prototype.flush=function(t){var e,i,n,r=!0;for(var o in this._data)if(this._data.hasOwnProperty(o)){r=!1;break}r&&!getSharedObjectStorage().getItem(this._path)||((e=new ByteArray).sec=this.sec,AMF3.write(e,this._data),i=new Uint8Array(e.arraybytes),n=StringUtilities.base64EncodeBytes(i),getSharedObjectStorage().setItem(this._path,n))},Object.defineProperty(LYg.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t},enumerable:!0,configurable:!0}),Object.defineProperty(LYg.prototype,"objectEncoding",{get:function(){},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(LYg.prototype,"client",{get:function(){},set:function(t){},enumerable:!0,configurable:!0}),LYg.prototype.setDirty=function(t){},LYg.prototype.connect=function(t,e){},LYg.prototype.send=function(){},LYg.prototype.close=function(){},LYg.prototype.clear=function(){},Object.defineProperty(LYg.prototype,"size",{get:function(){},enumerable:!0,configurable:!0}),Object.defineProperty(LYg.prototype,"fps",{set:function(t){},enumerable:!0,configurable:!0}),LYg.prototype.setProperty=function(t,e){},LYg._defaultObjectEncoding=ObjectEncoding.DEFAULT,LYg),SecurityDomain$1=(qZg=ASObject,__extends(rZg,qZg),Object.defineProperty(rZg,"currentDomain",{get:function(){return null},enumerable:!0,configurable:!0}),rZg),qZg,KYg;function rZg(){return null!==qZg&&qZg.apply(this,arguments)||this}function LYg(){return KYg.call(this)||this}function fscommand$1(t,e,i){e=axCoerceString$2(e),i=axCoerceString$2(i),console.log("FSCommand: "+e+"; "+i),"debugger"!==(e=e.toLowerCase())&&t.player.executeFSCommand(e,i)}var Security$1=(vZg=ASObject,__extends(wZg,vZg),Object.defineProperty(wZg,"exactSettings",{get:function(){return wZg._exactSettings},set:function(t){wZg._exactSettings=t=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(wZg,"disableAVM1Loading",{get:function(){},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(wZg,"sandboxType",{get:function(){return wZg._sandboxType},enumerable:!0,configurable:!0}),Object.defineProperty(wZg,"pageDomain",{get:function(){var t=FileLoadingService.resolveUrl("/").split("/");return t.pop(),t.pop()},enumerable:!0,configurable:!0}),wZg.allowDomain=function(){},wZg.allowInsecureDomain=function(){},wZg.loadPolicyFile=function(t){},wZg.showSettings=function(t){},wZg.duplicateSandboxBridgeInputArguments=function(t,e){},wZg.duplicateSandboxBridgeOutputArgument=function(t,e){},wZg.classInitializer=null,wZg.classSymbols=null,wZg.instanceSymbols=null,wZg.REMOTE="remote",wZg.LOCAL_WITH_FILE="localWithFile",wZg.LOCAL_WITH_NETWORK="localWithNetwork",wZg.LOCAL_TRUSTED="localTrusted",wZg.APPLICATION="application",wZg._exactSettings=!1,wZg._sandboxType="remote",wZg),Scene$1=(GZg=ASObject,__extends(HZg,GZg),Object.defineProperty(HZg.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(HZg.prototype,"labels",{get:function(){return this._labels},enumerable:!0,configurable:!0}),Object.defineProperty(HZg.prototype,"numFrames",{get:function(){return this._numFrames},enumerable:!0,configurable:!0}),HZg.prototype.clone=function(){var t=this._labels.value.map(function(t){return t.clone()});return new HZg(this._name,this.sec.createArrayUnsafe(t),this.offset,this._numFrames)},HZg.prototype.getLabelByName=function(t,e){e&&(t=t.toLowerCase());for(var i=this._labels.value,n=0;n>>0&16777215;return i},l$g.sanitizeAlphas=function(t,e,i,n){void 0===e&&(e=16),void 0===i&&(i=0),void 0===n&&(n=0);for(var r=[],o=0,s=Math.min(t.length,e);o>>8,i=(255&t.colors[0])/255,n=t.colors[1]>>>8,r=(255&t.colors[1])/255,o=BitmapFilterType.OUTER;t.onTop?o=BitmapFilterType.FULL:t.inner&&(o=BitmapFilterType.INNER);var s=180*t.angle/Math.PI;return new Q$g(t.distance,s,e,i,n,r,t.blurX,t.blurY,t.strength,t.quality,o,t.knockout)},Q$g.prototype._updateFilterBounds=function(t){var e;this.type!==BitmapFilterType.INNER&&(BitmapFilter._updateBlurBounds(t,this._blurX,this._blurY,this._quality),0!==this._distance)&&(e=this._angle*Math.PI/180,t.x+=Math.floor(Math.cos(e)*this._distance),t.y+=Math.floor(Math.sin(e)*this._distance),0>>0&16777215},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"highlightAlpha",{get:function(){return this._highlightAlpha},set:function(t){this._highlightAlpha=NumberUtilities.clamp(+t,0,1)},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"shadowColor",{get:function(){return this._shadowColor},set:function(t){this._shadowColor=t>>>0&16777215},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"shadowAlpha",{get:function(){return this._shadowAlpha},set:function(t){this._shadowAlpha=NumberUtilities.clamp(+t,0,1)},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"blurX",{get:function(){return this._blurX},set:function(t){this._blurX=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"blurY",{get:function(){return this._blurY},set:function(t){this._blurY=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"knockout",{get:function(){return this._knockout},set:function(t){this._knockout=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=NumberUtilities.clamp(0|t,0,15)},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"strength",{get:function(){return this._strength},set:function(t){this._strength=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(Q$g.prototype,"type",{get:function(){return this._type},set:function(t){null===(t=axCoerceString$2(t))?this.sec.throwError("TypeError",Errors$1.NullPointerError,"type"):t===BitmapFilterType.INNER||t===BitmapFilterType.OUTER?this._type=t:this._type=BitmapFilterType.FULL},enumerable:!0,configurable:!0}),Q$g.prototype.clone=function(){return new Q$g(this._distance,this._angle,this._highlightColor,this._highlightAlpha,this._shadowColor,this._shadowAlpha,this._blurX,this._blurY,this._strength,this._quality,this._type,this._knockout)},Q$g.classInitializer=null,Q$g.classSymbols=null,Q$g.instanceSymbols=null,Q$g),BlurFilter=(x_g=BitmapFilter,__extends(y_g,x_g),y_g.FromUntyped=function(t){return new y_g(t.blurX,t.blurY,t.quality)},y_g.prototype._updateFilterBounds=function(t){BitmapFilter._updateBlurBounds(t,this._blurX,this._blurY,this._quality,!0)},y_g.prototype._serialize=function(t){t.ensureAdditionalCapacity(16),t.writeIntUnsafe(1),t.writeFloatUnsafe(this._blurX),t.writeFloatUnsafe(this._blurY),t.writeIntUnsafe(this._quality)},Object.defineProperty(y_g.prototype,"blurX",{get:function(){return this._blurX},set:function(t){this._blurX=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(y_g.prototype,"blurY",{get:function(){return this._blurY},set:function(t){this._blurY=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(y_g.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=NumberUtilities.clamp(0|t,0,15)},enumerable:!0,configurable:!0}),y_g.prototype.clone=function(){return new y_g(this._blurX,this._blurY,this._quality)},y_g.classInitializer=null,y_g.classSymbols=null,y_g.instanceSymbols=null,y_g),ColorMatrixFilter=(J_g=BitmapFilter,__extends(K_g,J_g),K_g.FromUntyped=function(t){var e=Object.create(K_g.axClass.tPrototype);return e._matrix=t.matrix,e},K_g.prototype._serialize=function(t){var e=this._matrix;t.ensureAdditionalCapacity(4*(e.length+1)),t.writeIntUnsafe(6);for(var i=0;i>>8,(255&t.color)/255)},Y_g.prototype._expandArray=function(t,e,i){if(t)for(var n=t.length;n>>0},enumerable:!0,configurable:!0}),Object.defineProperty(Y_g.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha=NumberUtilities.clamp(+t,0,1)},enumerable:!0,configurable:!0}),Y_g.prototype.clone=function(){return new Y_g(this._matrixX,this._matrixY,this.matrix,this._divisor,this._bias,this._preserveAlpha,this._clamp,this._color,this._alpha)},Y_g.classInitializer=null,Y_g),DisplacementMapFilter=(C0g=BitmapFilter,__extends(D0g,C0g),D0g.FromUntyped=function(t){return new D0g(t.mapBitmap,t.mapPoint,t.componentX,t.componentY,t.scaleX,t.scaleY,t.mode,t.color,t.alpha)},Object.defineProperty(D0g.prototype,"mapBitmap",{get:function(){return this._mapBitmap},set:function(t){this._mapBitmap=t},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"mapPoint",{get:function(){return this._mapPoint},set:function(t){this._mapPoint=t},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"componentX",{get:function(){return this._componentX},set:function(t){this._componentX=t>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"componentY",{get:function(){return this._componentY},set:function(t){this._componentY=t>>>0},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"scaleX",{get:function(){return this._scaleX},set:function(t){this._scaleX=+t},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"scaleY",{get:function(){return this._scaleY},set:function(t){this._scaleY=+t},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=axCoerceString$2(t)},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t>>>0&16777215},enumerable:!0,configurable:!0}),Object.defineProperty(D0g.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha=+t},enumerable:!0,configurable:!0}),D0g.prototype.clone=function(){return new D0g(this._mapBitmap,this._mapPoint,this._componentX,this._componentY,this._scaleX,this._scaleY,this._mode,this._color,this._alpha)},D0g.classInitializer=null,D0g.classSymbols=null,D0g.instanceSymbols=null,D0g),DropShadowFilter=(Y0g=BitmapFilter,__extends(Z0g,Y0g),Z0g.FromUntyped=function(t){var e=t.colors[0]>>>8,i=(255&t.colors[0])/255,n=180*t.angle/Math.PI,r=!t.compositeSource;return new Z0g(t.distance,n,e,i,t.blurX,t.blurY,t.strength,t.quality,t.inner,t.knockout,r)},Z0g.prototype._updateFilterBounds=function(t){var e;this.inner||(BitmapFilter._updateBlurBounds(t,this._blurX,this._blurY,this._quality),0===this._distance)||(e=this._angle*Math.PI/180,t.x+=Math.floor(Math.cos(e)*this._distance),t.y+=Math.floor(Math.sin(e)*this._distance),0>>0&16777215},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha=NumberUtilities.clamp(+t,0,1)},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"blurX",{get:function(){return this._blurX},set:function(t){this._blurX=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"blurY",{get:function(){return this._blurY},set:function(t){this._blurY=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"hideObject",{get:function(){return this._hideObject},set:function(t){this._hideObject=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"inner",{get:function(){return this._inner},set:function(t){this._inner=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"knockout",{get:function(){return this._knockout},set:function(t){this._knockout=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=NumberUtilities.clamp(0|t,0,15)},enumerable:!0,configurable:!0}),Object.defineProperty(Z0g.prototype,"strength",{get:function(){return this._strength},set:function(t){this._strength=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Z0g.prototype.clone=function(){return new Z0g(this._distance,this._angle,this._color,this._alpha,this._blurX,this._blurY,this._strength,this._quality,this._inner,this._knockout,this._hideObject)},Z0g.classInitializer=null,Z0g.classSymbols=null,Z0g.instanceSymbols=null,Z0g),GlowFilter=(C1g=BitmapFilter,__extends(D1g,C1g),D1g.FromUntyped=function(t){return new D1g(t.colors[0]>>>8,(255&t.colors[0])/255,t.blurX,t.blurY,t.strength,t.quality,t.inner,t.knockout)},D1g.prototype._updateFilterBounds=function(t){BitmapFilter._updateBlurBounds(t,this._blurX,this._blurY,this._quality)},Object.defineProperty(D1g.prototype,"color",{get:function(){return this._color},set:function(t){this._color=t>>>0&16777215},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha=NumberUtilities.clamp(+t,0,1)},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"blurX",{get:function(){return this._blurX},set:function(t){this._blurX=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"blurY",{get:function(){return this._blurY},set:function(t){this._blurY=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"inner",{get:function(){return this._inner},set:function(t){this._inner=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"knockout",{get:function(){return this._knockout},set:function(t){this._knockout=!!t},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"quality",{get:function(){return this._quality},set:function(t){this._quality=NumberUtilities.clamp(0|t,0,15)},enumerable:!0,configurable:!0}),Object.defineProperty(D1g.prototype,"strength",{get:function(){return this._strength},set:function(t){this._strength=NumberUtilities.clamp(+t,0,255)},enumerable:!0,configurable:!0}),D1g.prototype.clone=function(){return new D1g(this._color,this._alpha,this._blurX,this._blurY,this._strength,this._quality,this._inner,this._knockout)},D1g.classInitializer=null,D1g.classSymbols=null,D1g.instanceSymbols=null,D1g),GradientBevelFilter=(X1g=BitmapFilter,__extends(Y1g,X1g),Y1g.FromUntyped=function(t){for(var e=[],i=[],n=0;n>>8),i.push(255&r)}var o=BitmapFilterType.OUTER;t.onTop?o=BitmapFilterType.FULL:t.inner&&(o=BitmapFilterType.INNER);var s=180*t.angle/Math.PI;return new Y1g(t.distance,s,this.sec.createArrayUnsafe(e),this.sec.createArrayUnsafe(i),this.sec.createArrayUnsafe(t.ratios),t.blurX,t.blurY,t.strength,t.quality,o,t.knockout)},Y1g.prototype._updateFilterBounds=function(t){var e;this.type!==BitmapFilterType.INNER&&(BitmapFilter._updateBlurBounds(t,this._blurX,this._blurY,this._quality),0!==this._distance)&&(e=this._angle*Math.PI/180,t.x+=Math.floor(Math.cos(e)*this._distance),t.y+=Math.floor(Math.sin(e)*this._distance),0>>8),i.push(255&r)}var o=BitmapFilterType.OUTER;t.onTop?o=BitmapFilterType.FULL:t.inner&&(o=BitmapFilterType.INNER);var s=180*t.angle/Math.PI;return new F2g(t.distance,s,this.sec.createArrayUnsafe(e),this.sec.createArrayUnsafe(i),this.sec.createArrayUnsafe(t.ratios),t.blurX,t.blurY,t.strength,t.quality,o,t.knockout)},F2g.prototype._updateFilterBounds=function(t){var e;this.type!==BitmapFilterType.INNER&&(BitmapFilter._updateBlurBounds(t,this._blurX,this._blurY,this._quality),0!==this._distance)&&(e=this._angle*Math.PI/180,t.x+=Math.floor(Math.cos(e)*this._distance),t.y+=Math.floor(Math.sin(e)*this._distance),0" + e + "";':'"";')+"}",o=this._evalJS(r);return null==o?null:this.convertFromXML(this.convertToXML(o))},v3g.addCallback=function(t,h){var u,p=this;this.ensureInitialized(),h?(u=this)._addCallback(t,function(t,e){var i,n=!0;if(void 0!==e)if(Array.isArray(e)){for(var r=[],o=0;o":"";case"number":return""+t+"";case"string":return""+t.split("&").join("&").split("<").join("<").split(">").join(">")+"";case"object":if(null===t)return"";if(this.sec.AXDate.axIsInstanceOf(t))return""+t.time+"";if(this.sec.AXError.axIsInstanceOf(t))return this.$BgmarshallExceptions?""+t+"":"";var e=[];if(t.hasOwnProperty("$Bglength")){for(var i=t.$Bglength,n=0;n'+r+"")}return""+e.join("")+""}for(var o=t.axGetEnumerableKeys(),n=0;n'+r+"")}return""+e.join("")+"";default:return""}},v3g.convertFromXML=function(t){switch(t._name.name){case"true":return!0;case"false":return!1;case"number":return Number(String(t.children()));case"string":return String(t.children());case"null":return null;case"date":return this.sec.AXDate.axConstruct([Number(String(t.children()))]);case"exception":if(this.$BgmarshallExceptions)throw this.sec.AXError.axConstruct([String(t.children())]);return;case"array":case"object":for(var e="object"===t._name.name?this.sec.createObject():this.sec.createArrayUnsafe([]),i=0;i=this._repeatCount&&this.stop()},enumerable:!0,configurable:!0}),Object.defineProperty(C4g.prototype,"currentCount",{get:function(){return this._iteration},enumerable:!0,configurable:!0}),C4g.prototype.reset=function(){this._running&&this.stop(),this._iteration=0},C4g.prototype.stop=function(){this._running=!1,window.clearInterval(this._interval)},C4g.prototype.start=function(){this._running||(this._running=!0,this._interval=window.setInterval(this._tick.bind(this),this._delay))},C4g.prototype._tick=function(){if(this._iteration++,this._running){if(C4g.dispatchingEnabled)try{this.dispatchEvent(new this.sec.flash.events.TimerEvent("timer",!0,!1))}catch(t){}if(0!==this._repeatCount&&this._iteration>=this._repeatCount){this.stop();try{this.dispatchEvent(new this.sec.flash.events.TimerEvent(TimerEvent$1.TIMER_COMPLETE,!1,!1))}catch(t){}}}},C4g.classInitializer=null,C4g.classSymbols=null,C4g.instanceSymbols=null,C4g.dispatchingEnabled=!0,C4g),SoundMixer$1=(K4g=ASObject,__extends(L4g,K4g),Object.defineProperty(L4g,"bufferTime",{get:function(){return L4g._bufferTime},set:function(t){L4g._bufferTime=0|t},enumerable:!0,configurable:!0}),Object.defineProperty(L4g,"soundTransform",{get:function(){return isNullOrUndefined$1(L4g._soundTransform)?new SoundTransform$1:new SoundTransform$1(L4g._soundTransform.volume,L4g._soundTransform.pan)},set:function(t){L4g._soundTransform=isNullOrUndefined$1(t)?new SoundTransform$1:t,L4g._updateAllSoundSources()},enumerable:!0,configurable:!0}),Object.defineProperty(L4g,"audioPlaybackMode",{get:function(){},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(L4g,"useSpeakerphoneForVoice",{get:function(){},set:function(t){},enumerable:!0,configurable:!0}),L4g.stopAll=function(){L4g._registeredSoundSources.forEach(function(t){t.stopSound()}),L4g._registeredSoundSources=[]},L4g.computeSpectrum=function(t,e,i){for(var n=new Float32Array(1024),r=0;r<1024;r++)n[r]=Math.random();t.writeRawBytes(n),t.position=0},L4g.areSoundsInaccessible=function(){},L4g._getMasterVolume=function(){return L4g._masterVolume},L4g._setMasterVolume=function(t){L4g._masterVolume=t=+t,L4g._updateAllSoundSources()},L4g._registerSoundSource=function(t){L4g._registeredSoundSources.push(t)},L4g._unregisterSoundSource=function(t){var e=L4g._registeredSoundSources.indexOf(t);0<=e&&L4g._registeredSoundSources.splice(e,1)},L4g._updateSoundSource=function(t){var e=t.soundTransform.volume;L4g._soundTransform&&(e*=L4g._soundTransform.volume),e*=L4g._getMasterVolume(),t.updateSoundLevels(e)},L4g._updateAllSoundSources=function(){L4g._registeredSoundSources.forEach(L4g._updateSoundSource)},L4g.classInitializer=null,L4g.classSymbols=null,L4g.instanceSymbols=null,L4g._masterVolume=1,L4g._registeredSoundSources=[],L4g._bufferTime=0,L4g),TextSnapshot=(a5g=ASObject,__extends(b5g,a5g),Object.defineProperty(b5g.prototype,"charCount",{get:function(){},enumerable:!0,configurable:!0}),b5g.prototype.findText=function(t,e,i){},b5g.prototype.getSelected=function(t,e){},b5g.prototype.getSelectedText=function(t){},b5g.prototype.getText=function(t,e,i){},b5g.prototype.getTextRunInfo=function(t,e){},b5g.prototype.hitTestTextNearPos=function(t,e,i){},b5g.prototype.setSelectColor=function(t){},b5g.prototype.setSelected=function(t,e,i){},b5g.classInitializer=null,b5g),URLVariables$1=(u5g=ASObject,__extends(v5g,u5g),v5g.prototype.decode=function(t){for(var e=(t=axCoerceString$2(t)).split("&"),i=0;i":"";case"number":return""+e+"";case"object":if(null===e)return"";if("hasOwnProperty"in e&&e.hasOwnProperty("length")){for(var i="",n=0;n'+t(e[n])+"";return i+""}for(var r in i="",e)i+=''+t(e[r])+"";return i+"";case"string":return""+e.replace(/&/g,"&").replace(//g,">")+"";case"undefined":return""}}}var Mouse$2=function(){},SecurityDomain$2=(U8g=AXSecurityDomain,__extends(V8g,U8g),V8g),PlayerGlobal=(Object.defineProperty(X8g.prototype,"stage",{get:function(){return this._stage},enumerable:!0,configurable:!0}),Object.defineProperty(X8g.prototype,"content",{get:function(){return this._content},enumerable:!0,configurable:!0}),X8g.prototype.createSecurityDomain=function(a,r,o){var s=this;this._avmStage=a,this._avmStage.avmTestHandler&&(Natives.print=function(t,e,i,n,r,o){var s=2==arguments.length?e:Array.prototype.slice.call(arguments,1).join(" ");console.log("%c Test-Trace from SWF:","color: DodgerBlue",s),a.avmTestHandler.addMessage(s)}),initLink();var l=new PromiseWrapper;return BrowserSystemResourcesLoadingService.getInstance().load("./assets/builtins/builtin.abc","arraybuffer").then(function(t){var n=new SecurityDomain$2,e={url:"builtin.abc",app:n.system},i=new ABCFile(e,new Uint8Array(t));if(n.swfVersion=r.swfVersion,n.system.loadABC(i),n.initialize(),n.system.executeABC(i),n.player=a,o&AVM2LoadLibrariesFlags.Playerglobal)return Promise.all([BrowserSystemResourcesLoadingService.getInstance().load("./assets/builtins/playerglobal.abcs","arraybuffer"),BrowserSystemResourcesLoadingService.getInstance().load("./assets/builtins/playerglobal.json","json")]).then(function(t){var e=new ABCCatalog(n.system,new Uint8Array(t[0]),t[1]);n.addCatalog(e),BrowserSystemResourcesLoadingService.getInstance().load("./assets/builtins/avmplus.abc","arraybuffer").then(function(t){var e={url:"avmplus.File",app:n.system},i=new ABCFile(e,new Uint8Array(t));n.system.loadABC(i),n.system.executeABC(i)},l.reject).then(function(){s._contentLoaderInfo=new n.flash.display.LoaderInfo(s,s._avmStage),s._contentLoaderInfo.url=r.url,s._applicationDomain=new n.flash.system.ApplicationDomain;var t=new n.flash.system.LoaderContext(!1,s._applicationDomain);ActiveLoaderContext.loaderContext=t,s._stage=new n.flash.display.Stage,n.flash.display.DisplayObject.axClass._activeStage=s._stage,s._avmStage.adapter=s._stage,s._stage.adaptee=s._avmStage,l.resolve(new FlashSceneGraphFactory(n))},l.reject)},l.reject);l.resolve(null)},l.reject),l.promise},X8g.prototype.enterFrame=function(){this._stage&&this._stage.enterFrame()},X8g.prototype.resizeStage=function(){this._stage&&this._stage.resizeCallback()},X8g.prototype.addAsset=function(t,e){t.isAsset(TextField)||t.isAsset(SceneImage2D)||t.isAsset(BitmapImage2D)?this._applicationDomain.addDefinition(t.name,t):t.isAsset(WaveAudio)?this._applicationDomain.addAudioDefinition(t.name,t):t.isAsset(Font)?this._applicationDomain.addFontDefinition(t.name,t):t.isAsset(Sprite)?this._applicationDomain.addDefinition(t.name,t):t.isAsset(MovieClip)?(this._applicationDomain.addDefinition(t.name,t),e&&t.isAVMScene&&(this._content=t.adapter.clone(),this._content.loaderInfo=this._contentLoaderInfo,this._content.adaptee.reset(),this._content.adaptee.firstFrameOnSWFStart=!0,this._stage.adaptee.addChild(this._content.adaptee),FrameScriptManager.execute_as3_constructors(),this._content.dispatchStaticEvent("added",this._content),this._content.dispatch_ADDED_TO_STAGE(!0))):t.isAsset(Graphics)||t.isAsset(MorphSprite)||console.log("loaded unhandled asset-type")},X8g),BrowserSystemResourcesLoadingService=(u9g.getInstance=function(){return u9g._instance?u9g._instance:u9g._instance=new u9g},u9g.prototype.load=function(t,e){return this._promiseFile(t,e)},u9g.prototype._promiseFile=function(r,o){return new Promise(function(e,i){var n=new XMLHttpRequest;n.open("GET",r),n.responseType=o,n.onload=function(){var t=n.response;t?("json"===o&&"json"!==n.responseType&&(t=JSON.parse(t)),e(t)):i("Unable to load "+r+": "+n.statusText)},n.onerror=function(){i("Unable to load: xhr error")},n.send()})},u9g),U8g;function u9g(){}function X8g(){}function V8g(){var t=null!==U8g&&U8g.apply(this,arguments)||this;return t.flash={display:{EventDispatcher:EventDispatcher$1,DisplayObject:DisplayObject$1,DisplayObjectContainer:DisplayObjectContainer$1,Stage:Stage$1,Loader:Loader$1,LoaderInfo:LoaderInfo,MovieClip:MovieClip$1,Graphics:Graphics$1,Bitmap:Bitmap,BitmapData:BitmapData,SimpleButton:SimpleButton$1,Sprite:Sprite$1,Shape:Sprite$1,FrameLabel:FrameLabel},events:{EventDispatcher:EventDispatcher$1,Event:Event$1,KeyboardEvent:KeyboardEvent$2,MouseEvent:MouseEvent$2,ProgressEvent:ProgressEvent$1,IOErrorEvent:IOErrorEvent,TimerEvent:TimerEvent$1},external:{ExternalInterface:ExternalInterface$1},filters:{BevelFiler:BevelFilter,BitmapFilter:BitmapFilter,BlurFilter:BlurFilter,ColorMatrixFilter:ColorMatrixFilter,ConvolutionFilter:ConvolutionFilter,DisplacementMapFilter:DisplacementMapFilter,DropShadowFilter:DropShadowFilter,GlowFilter:GlowFilter,GradientBevelFilter:GradientBevelFilter,GradientGlowFilter:GradientGlowFilter},text:{TextField:TextField$1,TextFormat:TextFormat$1,TextSnapshot:TextSnapshot,TextLineMetrics:TextLineMetrics$1},geom:{Point:Point$1,Rectangle:Rectangle$1,Matrix:Matrix$1,ColorTransform:ColorTransform$1,Transform:Transform$1,Vector3D:Vector3D$1,Matrix3D:Matrix3D$1},net:{URLRequest:URLRequest$1,URLLoader:URLLoader$1,URLVariables:URLVariables$1,SharedObject:SharedObject},system:{ApplicationDomain:ApplicationDomain,Capabilities:Capabilities$1,LoaderContext:LoaderContext$1,Security:Security$1,fscommand:fscommand$1},ui:{ContextMenu:ContextMenu$1,ContextMenuItem:ContextMenuItem$1,ContextMenuBuiltInItems:ContextMenuBuiltInItems,Mouse:Mouse$2},utils:{ByteArray:ByteArray$1},media:{Sound:Sound,SoundChannel:SoundChannel$1,SoundTransform:SoundTransform$1,SoundMixer:SoundMixer$1},xml:{XMLDocument:XMLDocument,XMLNode:XMLNode$1}},t}console.debug("AwayFL - PlayerGlobal - 0.2.96");var AVMPlayer=(D9g=AVMStage,__extends(E9g,D9g),E9g.prototype.onAVMAvailable=function(t){"AVM1"==t.avmVersion?console.log("AVM1 has init"):"AVM2"==t.avmVersion&&console.log("AVM2 has init")},E9g),AVM1Player=(J9g=AVMStage,__extends(K9g,J9g),K9g),AVM2Player=(N9g=AVMStage,__extends(O9g,N9g),O9g),N9g,J9g,D9g;function O9g(t){var e=N9g.call(this,t)||this;return e.registerAVMStageHandler(new AVM2Handler(new PlayerGlobal)),e}function K9g(t){var e=J9g.call(this,t)||this;return e.registerAVMStageHandler(new AVM1Handler),e}function E9g(t){var e=D9g.call(this,t)||this;return e.registerAVMStageHandler(new AVM1Handler),e.registerAVMStageHandler(new AVM2Handler(new PlayerGlobal)),e.addEventListener(AVMEvent.AVM_COMPLETE,function(t){return e.onAVMAvailable(t)}),new AVMDebug(e),e}console.debug("AwayFL - AwayFL-Player - 0.2.13");var AVM1ButtonCustom=(R9g=AVM1Button,__extends(S9g,R9g),S9g.createAVM1Class=function(t){return wrapAVM1NativeClass(t,!0,S9g,[],["$version#","_alpha#","getAwayJSID","attachAudio","attachBitmap","attachMovie","beginFill","beginBitmapFill","beginGradientFill","blendMode#","cacheAsBitmap#","_callFrame","clear","createEmptyMovieClip","createTextField","_currentframe#","curveTo","_droptarget#","duplicateMovieClip","enabled#","endFill","filters#","_framesloaded#","_focusrect#","forceSmoothing#","getBounds","getBytesLoaded","getBytesTotal","getDepth","getInstanceAtDepth","getNextHighestDepth","getRect","getSWFVersion","getTextSnapshot","getURL","globalToLocal","gotoAndPlay","gotoAndStop","_height#","_highquality#","hitArea#","hitTest","lineGradientStyle","lineStyle","lineTo","loadMovie","loadVariables","localToGlobal","_lockroot#","menu#","moveTo","_name#","nextFrame","opaqueBackground#","_parent#","play","prevFrame","_quality#","removeMovieClip","_root#","_rotation#","scale9Grid#","scrollRect#","setMask","_soundbuftime#","startDrag","stop","stopDrag","swapDepths","tabChildren#","tabEnabled#","tabIndex#","_target#","_totalframes#","trackAsMenu#","toString","unloadMovie","_url#","useHandCursor#","_visible#","_width#","_x#","_xmouse#","_xscale#","_y#","_ymouse#","_yscale#"])},S9g.prototype._mouseEventHandler=function(t){for(var e=this,i=this._actions,n=i.length,r=0;r