var Laya=window.Laya=function(l){var c={__internals:[],__packages:{},__classmap:{Object:Object,Function:Function,Array:Array,String:String},__sysClass:{object:"Object",array:"Array",string:"String",dictionary:"Dictionary"},__propun:{writable:!0,enumerable:!1,configurable:!0},__presubstr:String.prototype.substr,__substr:function(t,e){return 1==arguments.length?c.__presubstr.call(this,t):c.__presubstr.call(this,t,0=this.mouseMoveAccuracy&&(this._prePoint.x=r.clientX,this._prePoint.y=r.clientY,e.initEvent(r),e.check(e._stage,e.mouseX,e.mouseY,e.onMouseMove));break;case"touchstart":c._isTouchRespond=!0,e._isLeftMouse=!0;for(var o=r.changedTouches,n=0,s=o.length;nMath.PI&&(t-=2*Math.PI),t<-Math.PI&&(t+=2*Math.PI),t},E.isPOT=function(t,e){return 0=this.x&&t=this.y&&ethis.x+this.width||t.x+t.widththis.y+this.height||t.y+t.heightt&&(this.width+=this.x-t,this.x=t),this.y>e&&(this.height+=this.y-e,this.y=e),this.widthr.x?a:r.x,n=n>r.y?n:r.y;return e.setTo(o,i,a-o,n-i)},l.EMPTY=new l,l.TEMP=new l,l._temB=[],l._temA=[],l}(),N=(m(B,"laya.media.SoundManager"),f(1,B,"useAudioMusic",function(){return B._useAudioMusic},function(t){B._useAudioMusic=t,B._musicClass=t?Mt:null}),f(1,B,"autoStopMusic",function(){return B._autoStopMusic},function(t){x.stage.off("blur",null,B._stageOnBlur),x.stage.off("focus",null,B._stageOnFocus),x.stage.off("visibilitychange",null,B._visibilityChange),(B._autoStopMusic=t)&&(x.stage.on("blur",null,B._stageOnBlur),x.stage.on("focus",null,B._stageOnFocus),x.stage.on("visibilitychange",null,B._visibilityChange))}),f(1,B,"muted",function(){return B._muted},function(t){t!=B._muted&&(t&&B.stopAllSound(),B.musicMuted=t,B._muted=t)}),f(1,B,"musicMuted",function(){return B._musicMuted},function(t){t!=B._musicMuted&&(t?(B._tMusic&&B._musicChannel&&!B._musicChannel.isStopped?V.isConchApp?B._musicChannel._audio&&(B._musicChannel._audio.muted=!0):B._musicChannel.pause():B._musicChannel=null,B._musicMuted=t):(B._musicMuted=t,B._tMusic&&B._musicChannel&&(V.isConchApp?B._musicChannel._audio&&(B._musicChannel._audio.muted=!1):B._musicChannel.resume())))}),f(1,B,"soundMuted",function(){return B._soundMuted},function(t){B._soundMuted=t}),B.addChannel=function(t){0<=B._channels.indexOf(t)||B._channels.push(t)},B.removeChannel=function(t){for(var e=0,e=B._channels.length-1;0<=e;e--)B._channels[e]==t&&B._channels.splice(e,1)},B.disposeSoundIfNotUsed=function(t){for(var e=0,e=B._channels.length-1;0<=e;e--)if(B._channels[e].url==t)return;B.destroySound(t)},B._visibilityChange=function(){x.stage.isVisibility?B._stageOnFocus():B._stageOnBlur()},B._stageOnBlur=function(){B._isActive=!1,B._musicChannel&&(B._musicChannel.isStopped||(B._blurPaused=!0,B._musicChannel.pause())),B.stopAllSound(),x.stage.once("mousedown",null,B._stageOnFocus)},B._recoverWebAudio=function(){Et.ctx&&"running"!=Et.ctx.state&&Et.ctx.resume&&Et.ctx.resume()},B._stageOnFocus=function(){B._isActive=!0,B._recoverWebAudio(),x.stage.off("mousedown",null,B._stageOnFocus),B._blurPaused&&B._musicChannel&&B._musicChannel.isStopped&&(B._blurPaused=!1,B._musicChannel.resume())},B.playSound=function(t,e,i,n,s){if(void 0===e&&(e=1),void 0===s&&(s=0),!B._isActive||!t)return null;if(B._muted)return null;if(B._recoverWebAudio(),(t=Y.formatURL(t))==B._tMusic){if(B._musicMuted)return null}else{if(V.isConchApp){var r=vt.getFileExtension(t);if("wav"!=r&&"ogg"!=r)return alert("The sound only supports wav or ogg format,for optimal performance reason,please refer to the official website document."),null}if(B._soundMuted)return null}var o;return Q.onMiniGame||Q.onAlipayMiniGame||Q.onBDMiniGame||Q.onVVMiniGame||Q.onKGMiniGame||Q.onQGMiniGame||Q.onTTMiniGame||Q.onHWMiniGame||Q.onTBMiniGame||(o=x.loader.getRes(t)),n=n||B._soundClass,o||((o=new n).load(t),Q.onMiniGame||Q.onAlipayMiniGame||Q.onBDMiniGame||Q.onVVMiniGame||Q.onKGMiniGame||Q.onQGMiniGame||Q.onTTMiniGame||Q.onHWMiniGame||Q.onTBMiniGame||It.cacheRes(t,o)),(e=o.play(s,e))?(e.url=t,e.volume=t==B._tMusic?B.musicVolume:B.soundVolume,e.completeHandler=i,e):null},B.destroySound=function(t){var e=x.loader.getRes(t);e&&(It.clearRes(t),e.dispose())},B.playMusic=function(t,e,i,n){return void 0===e&&(e=0),void 0===n&&(n=0),t=Y.formatURL(t),B._tMusic=t,B._musicChannel&&B._musicChannel.stop(),B._musicChannel=B.playSound(t,e,i,B._musicClass,n)},B.stopSound=function(t){t=Y.formatURL(t);for(var e,i=0,i=B._channels.length-1;0<=i;i--)(e=B._channels[i]).url==t&&e.stop()},B.stopAll=function(){B._tMusic=null;for(var t=0,t=B._channels.length-1;0<=t;t--)B._channels[t].stop()},B.stopAllSound=function(){for(var t,e=0,e=B._channels.length-1;0<=e;e--)(t=B._channels[e]).url!=B._tMusic&&t.stop()},B.stopMusic=function(){B._musicChannel&&B._musicChannel.stop(),B._tMusic=null},B.setSoundVolume=function(t,e){if(e)e=Y.formatURL(e),B._setVolume(e,t);else{B.soundVolume=t;for(var i,n=0,n=B._channels.length-1;0<=n;n--)(i=B._channels[n]).url!=B._tMusic&&(i.volume=t)}},B.setMusicVolume=function(t){B.musicVolume=t,B._setVolume(B._tMusic,t)},B._setVolume=function(t,e){t=Y.formatURL(t);for(var i,n=0,n=B._channels.length-1;0<=n;n--)(i=B._channels[n]).url==t&&(i.volume=e)},B.musicVolume=1,B.soundVolume=1,B.playbackRate=1,B._useAudioMusic=!0,B._muted=!1,B._soundMuted=!1,B._musicMuted=!1,B._tMusic=null,B._musicChannel=null,B._channels=[],B._autoStopMusic=!1,B._blurPaused=!1,B._isActive=!0,B._soundClass=null,B._musicClass=null,B.autoReleaseSound=!0,B);function B(){}var G,W=(m(U,"laya.net.LocalStorage"),U.__init__=function(){U._baseClass||(U._baseClass=G).init(),U.items=U._baseClass.items,U.support=U._baseClass.support},U.setItem=function(t,e){U._baseClass.setItem(t,e)},U.getItem=function(t){return U._baseClass.getItem(t)},U.setJSON=function(t,e){U._baseClass.setJSON(t,e)},U.getJSON=function(t){return U._baseClass.getJSON(t)},U.removeItem=function(t){U._baseClass.removeItem(t)},U.clear=function(){U._baseClass.clear()},U._baseClass=null,U.items=null,U.support=!1,U.__init$=function(){function i(){}m(i,""),i.init=function(){try{i.support=!0,i.items=r.localStorage,i.setItem("laya","1"),i.removeItem("laya")}catch(t){i.support=!1}i.support||console.log("LocalStorage is not supprot or browser is private mode.")},i.setItem=function(t,e){try{i.support&&i.items.setItem(t,e)}catch(t){console.warn("set localStorage failed",t)}},i.getItem=function(t){return i.support?i.items.getItem(t):null},i.setJSON=function(t,e){try{i.support&&i.items.setItem(t,JSON.stringify(e))}catch(t){console.warn("set localStorage failed",t)}},i.getJSON=function(t){return JSON.parse(i.support?i.items.getItem(t):null)},i.removeItem=function(t){i.support&&i.items.removeItem(t)},i.clear=function(){i.support&&i.items.clear()},i.items=null,i.support=!1,G=i},U);function U(){}m(z,"laya.net.ResourceVersion"),z.enable=function(t,e,i){void 0===i&&(i=2),laya.net.ResourceVersion.type=i,x.loader.load(t,w.create(null,z.onManifestLoaded,[e]),null,"json")},z.onManifestLoaded=function(t,e){Y.customFormat=z.addVersionPrefix,z.manifest=e,t.run(),e||console.warn("资源版本清单文件不存在,不使用资源版本管理。忽略ERR_FILE_NOT_FOUND错误。")},z.addVersionPrefix=function(t){return z.manifest&&z.manifest[t]?2==z.type?z.manifest[t]:z.manifest[t]+"/"+t:t},z.FOLDER_VERSION=1,z.FILENAME_VERSION=2,z.manifest=null,z.type=1;function z(){}var H=function(){function t(){this.fontName=null,this.complete=null,this.err=null,this._fontTxt=null,this._url=null,this._div=null,this._txtWidth=NaN,this._http=null}m(t,"laya.net.TTFLoader");var e=t.prototype;return e.load=function(t){t=(this._url=t).split(".ttf")[0].split("/");this.fontName=t[t.length-1],Q.window.conch?this._loadConch():Q.window.FontFace?this._loadWithFontFace():this._loadWithCSS()},e._loadConch=function(){this._http=new At,this._http.on("error",this,this._onErr),this._http.on("complete",this,this._onHttpLoaded),this._http.send(this._url,null,"get","arraybuffer")},e._onHttpLoaded=function(t){Q.window.conch.setFontFaceFromBuffer(this.fontName,t),this._clearHttp(),this._complete()},e._clearHttp=function(){this._http&&(this._http.off("error",this,this._onErr),this._http.off("complete",this,this._onHttpLoaded),this._http=null)},e._onErr=function(){this._clearHttp(),this.err&&(this.err.runWith("fail:"+this._url),this.err=null)},e._complete=function(){x.timer.clear(this,this._complete),x.timer.clear(this,this._checkComplete),this._div&&this._div.parentNode&&(this._div.parentNode.removeChild(this._div),this._div=null),this.complete&&(this.complete.runWith(this),this.complete=null)},e._checkComplete=function(){v.measureText("LayaTTFFont",this._fontTxt).width!=this._txtWidth&&this._complete()},e._loadWithFontFace=function(){var t=new Q.window.FontFace(this.fontName,"url('"+this._url+"')");Q.window.document.fonts.add(t);var e=this;t.loaded.then(function(){e._complete()}),t.load()},e._createDiv=function(){this._div=Q.createElement("div"),this._div.innerHTML="laya";var t=this._div.style;t.fontFamily=this.fontName,t.position="absolute",t.left="-100px",t.top="-100px",Q.document.body.appendChild(this._div)},e._loadWithCSS=function(){var t=this,e=Q.createElement("style");e.type="text/css",Q.document.body.appendChild(e),e.textContent="@font-face { font-family:'"+this.fontName+"'; src:url('"+this._url+"');}",this._fontTxt="40px "+this.fontName,this._txtWidth=v.measureText("LayaTTFFont",this._fontTxt).width;var i=this;e.onload=function(){x.timer.once(1e4,i,t._complete)},x.timer.loop(20,this,this._checkComplete),this._createDiv()},t._testString="LayaTTFFont",t}(),Y=function(){function n(t){this._url=null,this._path=null,this._url=n.formatURL(t),this._path=n.getPath(t)}m(n,"laya.net.URL");var t=n.prototype;return f(0,t,"path",function(){return this._path}),f(0,t,"url",function(){return this._url}),n.formatURL=function(t,e){if(!t)return"null path";if(0c&&(f=o._y)u&&o.render(e,i,n);else for(var p=0;p>=1;return e},o.IMAGE=1,o.ALPHA=2,o.TRANSFORM=4,o.BLEND=8,o.CANVAS=16,o.FILTERS=32,o.MASK=64,o.CLIP=128,o.STYLE=256,o.GRAPHICS=512,o.CUSTOM=1024,o.CHILDS=2048,o.INIT=69905,o.renders=[],o.NORENDER=new o(0,null),o}(),j=function(){function a(){this._repaint=!1}m(a,"laya.resource.Context");var t=a.prototype;return t.replaceReset=function(){for(var t,e=0,i=a.replaceKeys.length,e=0;ethis.autoReleaseMaxSize&&this.garbageCollection((1-this._garbageCollectionRate)*this.autoReleaseMaxSize),this._memorySize+=t)},t.garbageCollection=function(t){var e=this._resources;(e=e.slice()).sort(function(t,e){if(!t||!e)throw new Error("a或b不能为空!");return t.released&&e.released?0:t.released?1:e.released?-1:t._lastUseFrameCount-e._lastUseFrameCount});for(var i=ft.loopCount,n=0,s=e.length;n=t&&(this._isOverflow=!0));if(r.releaseResource(),this._memorySizethis._length?this._length:e,t=new Float32Array(this._d_.buffer.slice(t,e));return this._pos_=e,t},t.getUint8Array=function(t,e){e=(e=t+e)>this._length?this._length:e,t=new Uint8Array(this._d_.buffer.slice(t,e));return this._pos_=e,t},t.getInt16Array=function(t,e){e=(e=t+e)>this._length?this._length:e,t=new Int16Array(this._d_.buffer.slice(t,e));return this._pos_=e,t},t.getFloat32=function(){if(this._pos_+4>this._length)throw"getFloat32 error - Out of bounds";var t=this._d_.getFloat32(this._pos_,this._xd_);return this._pos_+=4,t},t.getFloat64=function(){if(this._pos_+8>this._length)throw"getFloat64 error - Out of bounds";var t=this._d_.getFloat64(this._pos_,this._xd_);return this._pos_+=8,t},t.writeFloat32=function(t){this.ensureWrite(this._pos_+4),this._d_.setFloat32(this._pos_,t,this._xd_),this._pos_+=4},t.writeFloat64=function(t){this.ensureWrite(this._pos_+8),this._d_.setFloat64(this._pos_,t,this._xd_),this._pos_+=8},t.getInt32=function(){if(this._pos_+4>this._length)throw"getInt32 error - Out of bounds";var t=this._d_.getInt32(this._pos_,this._xd_);return this._pos_+=4,t},t.getUint32=function(){if(this._pos_+4>this._length)throw"getUint32 error - Out of bounds";var t=this._d_.getUint32(this._pos_,this._xd_);return this._pos_+=4,t},t.writeInt32=function(t){this.ensureWrite(this._pos_+4),this._d_.setInt32(this._pos_,t,this._xd_),this._pos_+=4},t.writeUint32=function(t){this.ensureWrite(this._pos_+4),this._d_.setUint32(this._pos_,t,this._xd_),this._pos_+=4},t.getInt16=function(){if(this._pos_+2>this._length)throw"getInt16 error - Out of bounds";var t=this._d_.getInt16(this._pos_,this._xd_);return this._pos_+=2,t},t.getUint16=function(){if(this._pos_+2>this._length)throw"getUint16 error - Out of bounds";var t=this._d_.getUint16(this._pos_,this._xd_);return this._pos_+=2,t},t.writeUint16=function(t){this.ensureWrite(this._pos_+2),this._d_.setUint16(this._pos_,t,this._xd_),this._pos_+=2},t.writeInt16=function(t){this.ensureWrite(this._pos_+2),this._d_.setInt16(this._pos_,t,this._xd_),this._pos_+=2},t.getUint8=function(){if(this._pos_+1>this._length)throw"getUint8 error - Out of bounds";return this._d_.getUint8(this._pos_++)},t.writeUint8=function(t){this.ensureWrite(this._pos_+1),this._d_.setUint8(this._pos_,t),this._pos_++},t._getUInt8=function(t){return this._d_.getUint8(t)},t._getUint16=function(t){return this._d_.getUint16(t,this._xd_)},t._getMatrix=function(){return new F(this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32())},t.rUTF=function(t){for(var e,i="",n=this._pos_+t,s=String.fromCharCode,r=this._u8d_;this._pos_>6,128|63&n],this._pos_),this._pos_+=2):n<=65535?(this.ensureWrite(this._pos_+3),this._u8d_.set([224|n>>12,128|n>>6&63,128|63&n],this._pos_),this._pos_+=3):(this.ensureWrite(this._pos_+4),this._u8d_.set([240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n],this._pos_),this._pos_+=4)}},t.writeUTFString=function(t){var e=this.pos;this.writeUint16(1),this.writeUTFBytes(t);t=this.pos-e-2;if(65536<=t)throw"writeUTFString byte len more than 65536";this._d_.setUint16(e,t,this._xd_)},t.readUTFString=function(){return this.readUTFBytes(this.getUint16())},t.getUTFString=function(){return this.readUTFString()},t.readUTFBytes=function(t){if(0==(t=void 0===t?-1:t))return"";var e=this.bytesAvailable;if(ethis._length)throw"readByte error - Out of bounds";return this._d_.getInt8(this._pos_++)},t.getByte=function(){return this.readByte()},t.ensureWrite=function(t){this._lengtht&&this.___resizeBuffer(this._allocated_=t),this._length=t}),f(0,t,"pos",function(){return this._pos_},function(t){this._pos_=t}),f(0,t,"bytesAvailable",function(){return this._length-this._pos_}),e.getSystemEndian=function(){var t;return e._sysEndian||(t=new ArrayBuffer(2),new DataView(t).setInt16(0,256,!0),e._sysEndian=256===new Int16Array(t)[0]?"littleEndian":"bigEndian"),e._sysEndian},e.BIG_ENDIAN="bigEndian",e.LITTLE_ENDIAN="littleEndian",e._sysEndian=null,e}(),tt=(m(et,"laya.utils.CacheManager"),et.regCacheByFunction=function(t,e){et.unRegCacheByFunction(t,e),et._cacheList.push({tryDispose:t,getCacheList:e})},et.unRegCacheByFunction=function(t,e){for(var i=0,n=et._cacheList.length,i=0;iet.loopTimeLimit));)i--},et.loopTimeLimit=2,et._cacheList=[],et._index=0,et);function et(){}var it=(m(nt,"laya.utils.ClassUtils"),nt.regClass=function(t,e){nt._classMap[t]=e},nt.getRegClass=function(t){return nt._classMap[t]},nt.getInstance=function(t){var e=nt.getClass(t);return e?new e:(console.warn("[error] Undefined class:",t),null)},nt.createByJson=function(t,e,i,n,s){var r=(t="string"==typeof t?JSON.parse(t):t).props;if(!e&&!(e=s?s.runWith(t):nt.getInstance(r.runtime||t.type)))return null;var o=t.child;if(o)for(var a=0,h=o.length;a>16)/255,((65280&s)>>8)/255,(255&s)/255])}else s=this.numColor=t,this.strColor=vt.toHexColor(s);this._color=[((16711680&s)>>16)/255,((65280&s)>>8)/255,(255&s)/255,1],this._color.__id=++rt._COLODID}!function(){function t(){this._values=[],this._keys=[]}m(t,"laya.utils.Dictionary");var e=t.prototype;e.set=function(t,e){var i=this.indexOf(t);0<=i?this._values[i]=e:(this._keys.push(t),this._values.push(e))},e.indexOf=function(t){var e=this._keys.indexOf(t);return 0<=e?e:(t="string"==typeof t?Number(t):"number"==typeof t?t.toString():t,this._keys.indexOf(t))},e.get=function(t){t=this.indexOf(t);return t<0?null:this._values[t]},e.remove=function(t){t=this.indexOf(t);return 0<=t&&(this._keys.splice(t,1),this._values.splice(t,1),!0)},e.clear=function(){this._values.length=0,this._keys.length=0},f(0,e,"values",function(){return this._values}),f(0,e,"keys",function(){return this._keys})}();var ot=function(){function t(){this.ratio=.92,this.maxOffset=60,this._dragging=!1,this._clickOnly=!0}m(t,"laya.utils.Dragging");var e=t.prototype;return e.start=function(t,e,i,n,s,r,o,a){void 0===a&&(a=.92),this.clearTimer(),this.target=t,this.area=e,this.hasInertia=i,this.elasticDistance=e?n:0,this.elasticBackTime=s,this.data=r,this._disableMouseEvent=o,this.ratio=a,this._parent=t.parent,this._clickOnly=!0,this._dragging=!0,this._elasticRateX=this._elasticRateY=1,this._lastX=this._parent.mouseX,this._lastY=this._parent.mouseY,x.stage.on("mouseup",this,this.onStageMouseUp),x.stage.on("mouseout",this,this.onStageMouseUp),x.timer.frameLoop(1,this,this.loop)},e.clearTimer=function(){x.timer.clear(this,this.loop),x.timer.clear(this,this.tweenMove),this._tween&&(this._tween.recover(),this._tween=null)},e.stop=function(){this._dragging&&(C.instance.disableMouseEvent=!1,x.stage.off("mouseup",this,this.onStageMouseUp),x.stage.off("mouseout",this,this.onStageMouseUp),this._dragging=!1,this.target&&this.area&&this.backToArea(),this.clear())},e.loop=function(){var t=this._parent.getMousePoint(),e=t.x,i=t.y,n=e-this._lastX,t=i-this._lastY;if(this._clickOnly){if(!(1this.area.x+this.area.width?this.target.x-this.area.x-this.area.width:0,this._elasticRateX=Math.max(0,1-t/this.elasticDistance),t=this.target.ythis.area.y+this.area.height?this.target.y-this.area.y-this.area.height:0,this._elasticRateY=Math.max(0,1-t/this.elasticDistance))},e.backToArea=function(){this.target.x=Math.min(Math.max(this.target.x,this.area.x),this.area.x+this.area.width),this.target.y=Math.min(Math.max(this.target.y,this.area.y),this.area.y+this.area.height)},e.onStageMouseUp=function(t){if(C.instance.disableMouseEvent=!1,x.stage.off("mouseup",this,this.onStageMouseUp),x.stage.off("mouseout",this,this.onStageMouseUp),x.timer.clear(this,this.loop),!this._clickOnly&&this.target)if(this.hasInertia){this._offsets.length<1&&this._offsets.push(this._parent.mouseX-this._lastX,this._parent.mouseY-this._lastY),this._offsetX=this._offsetY=0;for(var e=this._offsets.length,i=Math.min(e,6),n=this._offsets.length-i,s=e-1;nthis.maxOffset&&(this._offsetX=0this.maxOffset&&(this._offsetY=0this.area.x+this.area.width&&(e=this.area.x+this.area.width),this.target.ythis.area.y+this.area.height&&(i=this.area.y+this.area.height),isNaN(e)&&isNaN(i)?this.clear():(t={},isNaN(e)||(t.x=e),isNaN(i)||(t.y=i),this._tween=mt.to(this.target,t,this.elasticBackTime,at.sineOut,w.create(this,this.clear),0,!1,!1))},e.tweenMove=function(){this._offsetX*=this.ratio*this._elasticRateX,this._offsetY*=this.ratio*this._elasticRateY,this.target.x+=this._offsetX,this.target.y+=this._offsetY,this.area&&this.checkArea(),this.target.event("dragmove",this.data),(Math.abs(this._offsetX)<1&&Math.abs(this._offsetY)<1||this._elasticRateX<.5||this._elasticRateY<.5)&&(x.timer.clear(this,this.tweenMove),0=Math.max(l,r)||(n.y-l)*(c-h)/(r-l)+h>n.x&&s++)}return s%2==1},u._cmds=[],i(u,["_rec",function(){return this._rec=new O},"_ptPoint",function(){return this._ptPoint=new k}]),u}();(function(){function s(t,e,i,n){this.char=t,this.charNum=t.charCodeAt(0),this._x=this._y=0,this.width=e,this.height=i,this.style=n,this.isWord=!s._isWordRegExp.test(t)}m(s,"laya.utils.HTMLChar");var t=s.prototype;x.imps(t,{"laya.display.ILayout":!0}),t.setSprite=function(t){this._sprite=t},t.getSprite=function(){return this._sprite},t._isChar=function(){return!0},t._getCSSStyle=function(){return this.style},f(0,t,"width",function(){return this._w},function(t){this._w=t}),f(0,t,"x",function(){return this._x},function(t){this._sprite&&(this._sprite.x=t),this._x=t}),f(0,t,"y",function(){return this._y},function(t){this._sprite&&(this._sprite.y=t),this._y=t}),f(0,t,"height",function(){return this._h},function(t){this._h=t}),s._isWordRegExp=new RegExp("[\\w.]","")})(),m(ct,"laya.utils.Log"),ct.enable=function(){ct._logdiv||(ct._logdiv=Q.window.document.createElement("div"),Q.window.document.body.appendChild(ct._logdiv),ct._logdiv.style.cssText="pointer-events:none;border:white;overflow:hidden;z-index:1000000;background:rgba(100,100,100,0.6);color:white;position: absolute;left:0px;top:0px;width:50%;height:50%;")},ct.toggle=function(){var t=ct._logdiv.style;"1px"==t.width?t.width=t.height="50%":t.width=t.height="1px"},ct.print=function(t){ct._logdiv&&(ct.maxCount<=ct._count&&ct.clear(),ct._count++,ct._logdiv.innerText+=t+"\n",ct._logdiv.scrollTop=ct._logdiv.scrollHeight)},ct.clear=function(){ct._logdiv.innerText="",ct._count=0},ct._logdiv=null,ct._count=0,ct.maxCount=20;function ct(){}m(ut,"laya.utils.Mouse"),f(1,ut,"cursor",function(){return ut._style.cursor},function(t){ut._style.cursor=t}),ut.hide=function(){"none"!=ut.cursor&&(ut._preCursor=ut.cursor,ut.cursor="none")},ut.show=function(){"none"==ut.cursor&&(ut.cursor=ut._preCursor||"auto")},ut._preCursor=null,i(ut,["_style",function(){return this._style=Q.document.body.style}]);function ut(){}var _t=(m(dt,"laya.utils.Pool"),dt.getPoolBySign=function(t){return dt._poolDic[t]||(dt._poolDic[t]=[])},dt.clearBySign=function(t){dt._poolDic[t]&&(dt._poolDic[t].length=0)},dt.recover=function(t,e){e.__InPool||(e.__InPool=!0,dt.getPoolBySign(t).push(e))},dt.getItemByClass=function(t,e){t=dt.getPoolBySign(t),e=t.length?t.pop():new e;return e.__InPool=!1,e},dt.getItemByCreateFun=function(t,e,i){t=dt.getPoolBySign(t),i=t.length?t.pop():e.call(i);return i.__InPool=!1,i},dt.getItem=function(t){t=dt.getPoolBySign(t),t=t.length?t.pop():null;return t&&(t.__InPool=!1),t},dt._poolDic={},dt.InPoolSign="__InPool",dt);function dt(){}!function(){function n(){this.sign=null,this.maxCount=1e3}m(n,"laya.utils.PoolCache");var t=n.prototype;t.getCacheList=function(){return _t.getPoolBySign(this.sign)},t.tryDispose=function(t){var e=_t.getPoolBySign(this.sign);e.length>this.maxCount&&e.splice(this.maxCount,e.length-this.maxCount)},n.addPoolCacheManager=function(t,e){var i;void 0===e&&(e=100),(i=new n).sign=t,i.maxCount=e,tt.regCacheByFunction(vt.bind(i.tryDispose,i),vt.bind(i.getCacheList,i))}}();var ft=(m(pt,"laya.utils.Stat"),f(1,pt,"onclick",null,function(t){pt._sp&&pt._sp.on("click",pt._sp,t),pt._canvas&&(pt._canvas.source.onclick=t,pt._canvas.source.style.pointerEvents="")}),pt.show=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),!V.isConchApp||V.isConchWebGL?(V.isConchWebGL||Q.onMiniGame||Q.onLimixiu||Q.onKGMiniGame||Q.onBDMiniGame||Q.onTTMiniGame||Q.onQGMiniGame||Q.onVVMiniGame||Q.onBLMiniGame||Q.onAlipayMiniGame||Q.onQQMiniGame||Q.onTTMiniGame||Q.onHWMiniGame||Q.onTBMiniGame||(pt._useCanvas=!0),pt._show=!0,pt._fpsData.length=60,pt._view[0]={title:"FPS(Canvas)",value:"_fpsStr",color:"yellow",units:"int"},pt._view[1]={title:"Sprite",value:"_spriteStr",color:"white",units:"int"},pt._view[2]={title:"DrawCall",value:"drawCall",color:"white",units:"int"},pt._view[3]={title:"CurMem",value:"currentMemorySize",color:"yellow",units:"M"},V.isWebGL?(pt._view[4]={title:"Shader",value:"shaderCall",color:"white",units:"int"},V.is3DMode?(pt._view[0].title="FPS(3D)",pt._view[5]={title:"TriFaces",value:"trianglesFaces",color:"white",units:"int"},pt._view[6]={title:"treeNodeColl",value:"treeNodeCollision",color:"white",units:"int"},pt._view[7]={title:"treeSpriteColl",value:"treeSpriteCollision",color:"white",units:"int"}):(pt._view[0].title="FPS(WebGL)",pt._view[5]={title:"Canvas",value:"_canvasStr",color:"white",units:"int"})):pt._view[4]={title:"Canvas",value:"_canvasStr",color:"white",units:"int"},pt._useCanvas?pt.createUIPre(t,e):pt.createUI(t,e),pt.enable()):Q.window.conch.showFPS&&Q.window.conch.showFPS(t,e)},pt.createUIPre=function(t,e){var i=Q.pixelRatio;x.stage.useRetinalCanvas&&(i=3),pt._width=130*i,pt._vx=75*i,pt._height=i*(12*pt._view.length+3*i)+4,pt._fontSize=12*i;for(var n=0;n=h.exeTime)if(h.repeat)if(h.jumpFrame)for(;o>=h.exeTime;)h.exeTime+=h.delay,h.run(!1);else h.exeTime+=h.delay,h.run(!1),o>h.exeTime&&(h.exeTime+=Math.ceil((o-h.exeTime)/h.delay)*h.delay);else h.run(!0)}else this._count++;(30=this._duration)return this.complete();for(var i=0=this._duration||(this._startTimer=Q.now()-this._usedTimer-this._delay,this._delayParam?this._usedTimer<0?x.scaleTimer.once(-this._usedTimer,this,this.firstStart,this._delayParam):this.firstStart.apply(this,this._delayParam):this._beginLoop())},f(0,t,"progress",null,function(t){t*=this._duration;this._startTimer=Q.now()-this._delay-t}),c.to=function(t,e,i,n,s,r,o,a){return void 0===r&&(r=0),void 0===o&&(o=!1),void 0===a&&(a=!0),_t.getItemByClass("tween",c)._create(t,e,i,n,s,r,o,!0,a,!0)},c.from=function(t,e,i,n,s,r,o,a){return void 0===r&&(r=0),void 0===o&&(o=!1),void 0===a&&(a=!0),_t.getItemByClass("tween",c)._create(t,e,i,n,s,r,o,!1,a,!0)},c.clearAll=function(t){if(t&&t.$_GID){var e=c.tweenMap[t.$_GID];if(e){for(var i=0,n=e.length;ie;)t[s+1]=t[s];t[s+1]=i,n++}var o=i.parent.conchModel;if(o)if(null!=o.updateZOrder)o.updateZOrder();else{for(n=0;n\s+<"),-1<(t=(new DOMParser).parseFromString(t,"text/xml")).firstChild.textContent.indexOf("This page contains the following errors"))throw new Error(t.firstChild.firstChild.textContent);return t},yt);function yt(){}var wt=function(){function t(){this.useDic={},this.shapeDic={},this.shapeLineDic={},this._id=0,this._checkKey=!1,this._freeIdArray=[],V.isWebGL&&tt.regCacheByFunction(vt.bind(this.startDispose,this),vt.bind(this.getCacheList,this))}m(t,"laya.utils.VectorGraphManager");var e=t.prototype;return e.getId=function(){return this._id++},e.addShape=function(t,e){this.shapeDic[t]=e,this.useDic[t]||(this.useDic[t]=!0)},e.addLine=function(t,e){this.shapeLineDic[t]=e,this.shapeLineDic[t]||(this.shapeLineDic[t]=!0)},e.getShape=function(t){this._checkKey&&null!=this.useDic[t]&&(this.useDic[t]=!0)},e.deleteShape=function(t){this.shapeDic[t]&&(this.shapeDic[t]=null,delete this.shapeDic[t]),this.shapeLineDic[t]&&(this.shapeLineDic[t]=null,delete this.shapeLineDic[t]),null!=this.useDic[t]&&delete this.useDic[t]},e.getCacheList=function(){var t,e=[];for(t in this.shapeDic)e.push(this.shapeDic[t]);for(t in this.shapeLineDic)e.push(this.shapeLineDic[t]);return e},e.startDispose=function(t){for(var e in this.useDic)this.useDic[e]=!1;this._checkKey=!0},e.endDispose=function(){if(this._checkKey){for(var t in this.useDic)this.useDic[t]||this.deleteShape(t);this._checkKey=!1}},t.getInstance=function(){return t.instance=t.instance||new t},t.instance=null,t}(),xt=function(){function n(){this._obj=null,this._obj=n.supportWeakMap?new Q.window.WeakMap:{},n.supportWeakMap||n._maps.push(this)}m(n,"laya.utils.WeakObject");var t=n.prototype;return t.set=function(t,e){var i;null!=t&&(n.supportWeakMap?("string"!=typeof(i=t)&&"number"!=typeof t||(i=(i=n._keys[t])||(n._keys[t]={k:t})),this._obj.set(i,e)):"string"==typeof t||"number"==typeof t?this._obj[t]=e:(t.$_GID||(t.$_GID=vt.getGID()),this._obj[t.$_GID]=e))},t.get=function(t){if(null==t)return null;if(n.supportWeakMap){var e="string"==typeof t||"number"==typeof t?n._keys[t]:t;return e?this._obj.get(e):null}return"string"==typeof t||"number"==typeof t?this._obj[t]:this._obj[t.$_GID]},t.del=function(t){var e;null!=t&&(n.supportWeakMap?(e="string"==typeof t||"number"==typeof t?n._keys[t]:t)&&this._obj.delete(e):"string"==typeof t||"number"==typeof t?delete this._obj[t]:delete this._obj[this._obj.$_GID])},t.has=function(t){if(null==t)return!1;if(n.supportWeakMap){var e="string"==typeof t||"number"==typeof t?n._keys[t]:t;return this._obj.has(e)}return"string"==typeof t||"number"==typeof t?null!=this._obj[t]:null!=this._obj[this._obj.$_GID]},n.__init__=function(){n.supportWeakMap=null!=Q.window.WeakMap,n.supportWeakMap||x.timer.loop(n.delInterval,null,n.clearCache)},n.clearCache=function(){for(var t=0,e=n._maps.length;t=i.length)throw new Error("setChildIndex:The index is out of bounds.");var n=this.getChildIndex(t);if(n<0)throw new Error("setChildIndex:node is must child of this object.");return i.splice(n,1),i.splice(e,0,t),this.conchModel&&(this.conchModel.removeChild(t.conchModel),this.conchModel.addChildAt(t.conchModel,e)),this._childChanged(),t},t._childChanged=function(t){},t.removeChild=function(t){if(!this._childs)return t;t=this._childs.indexOf(t);return this.removeChildAt(t)},t.removeSelf=function(){return this._parent&&this._parent.removeChild(this),this},t.removeChildByName=function(t){t=this.getChildByName(t);return t&&this.removeChild(t),t},t.removeChildAt=function(t){var e=this.getChildAt(t);return e&&(this._childs.splice(t,1),this.conchModel&&this.conchModel.removeChild(e.conchModel),e.parent=null),e},t.removeChildren=function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=2147483647),this._childs&&0y.maxTimeOut)return console.warn("loader callback cost a long time:"+(Q.now()-t)+" url="+y._loaders[y._startIndex-1].url),void x.timer.frameOnce(1,null,y.checkNext);y._loaders.length=0,y._startIndex=0,y._isWorking=!1},y.clearRes=function(t,e){void 0===e&&(e=!1),t=Y.formatURL(t);var i=y.getAtlas(t);if(i){for(var n=0,s=i.length;n=this.maxLoader)){for(var t=0;tu.width&&(n=u.width-e),u.height&&i+s>u.height&&(s=u.height-i),p.width=n,p.height=s,p.offsetX=r,p.offsetY=o,p.sourceWidth=a||n,p.sourceHeight=h||s;l=1/u.width,t=1/u.height,d=p.uv[0],f=p.uv[1],r=p.uv[4],o=p.uv[5],a=r-d,h=o-f,s=g.moveUV(c[0],c[1],[e*=l,i*=t,e+(n*=l),i,e+n,i+(s*=t),e,i+s]);p.uv=[d+s[0]*a,f+s[1]*h,r-(1-s[2])*a,f+s[3]*h,r-(1-s[4])*a,o-(1-s[5])*h,d+s[6]*a,o-(1-s[7])*h],_&&p.addTextureToAtlas();u=u.scaleRate;return u&&1!=u?(p.sourceWidth/=u,p.sourceHeight/=u,p.width/=u,p.height/=u,p.scaleRate=u,p.offsetX/=u,p.offsetY/=u):p.scaleRate=1,p},g.createFromTexture=function(t,e,i,n,s){var r=t.scaleRate;1!=r&&(e*=r,i*=r,n*=r,s*=r);e=O.TEMP.setTo(e-t.offsetX,i-t.offsetY,n,s),i=e.intersection(g._rect1.setTo(0,0,t.width,t.height),g._rect2);if(!i)return null;s=g.create(t,i.x,i.y,i.width,i.height,i.x-e.x,i.y-e.y,n,s);return s.bitmap._removeReference(),s},g.DEF_UV=[0,0,1,0,1,1,0,1],g.INV_UV=[0,1,1,1,1,0,0,0],g._rect1=new O,g._rect2=new O,g}(),Ft=function(){var a;function r(){this._labelDic=null,this._tweenDic={},this._tweenDataList=[],this._endTweenDataList=null,this._currTime=0,this._lastTime=0,this._startTime=0,this._index=0,this._gidIndex=0,this._firstTweenDic={},this._startTimeSort=!1,this._endTimeSort=!1,this._loopKey=!1,this.scale=1,this._frameRate=60,this._frameIndex=0,this._total=0,r.__super.call(this)}m(r,"laya.utils.TimeLine",l);var t=r.prototype;return t.to=function(t,e,i,n,s){return this._create(t,e,i,n,s=void 0===s?0:s,!0)},t.from=function(t,e,i,n,s){return this._create(t,e,i,n,s=void 0===s?0:s,!1)},t._create=function(t,e,i,n,s,r){var o=_t.getItemByClass("tweenData",a);return o.isTo=r,o.type=0,o.target=t,o.duration=i,o.data=e,o.startTime=this._startTime+s,o.endTime=o.startTime+o.duration,o.ease=n,this._startTime=Math.max(o.endTime,this._startTime),this._tweenDataList.push(o),this._startTimeSort=!0,this._endTimeSort=!0,this},t.addLabel=function(t,e){var i=_t.getItemByClass("tweenData",a);return i.type=1,i.data=t,i.endTime=i.startTime=this._startTime+e,this._labelDic||(this._labelDic={}),this._labelDic[t]=i,this._tweenDataList.push(i),this},t.removeLabel=function(t){var e;this._labelDic&&this._labelDic[t]&&(!(e=this._labelDic[t])||-1<(e=this._tweenDataList.indexOf(e))&&this._tweenDataList.splice(e,1),delete this._labelDic[t])},t.gotoTime=function(t){if(null!=this._tweenDataList&&0!=this._tweenDataList.length){var e,i,n,s,r;for(n in this._firstTweenDic)if(i=this._firstTweenDic[n])for(var o in i)i.diyTarget.hasOwnProperty(o)&&(i.diyTarget[o]=i[o]);for(n in this._tweenDic)(e=this._tweenDic[n]).clear(),delete this._tweenDic[n];this._index=0,this._gidIndex=0,this._currTime=t,this._lastTime=Q.now(),null==this._endTweenDataList||this._endTimeSort?(this._endTimeSort=!1,this._endTweenDataList=s=this._tweenDataList.concat(),s.sort(function(t,e){return t.endTime>e.endTime?1:t.endTime=r.endTime))break;this._index=Math.max(this._index,a+1);var l=r.data;if(r.isTo)for(var c in l)r.target[c]=l[c]}for(a=0,h=this._tweenDataList.length;a=r.startTime&&te.startTime?1:t.startTime=this._startTime){if(!this._loopKey){for(var t in this._tweenDic)(e=this._tweenDic[t]).complete();return this._complete(),void this.pause()}if(this._complete(),!this._tweenDataList)return;this.gotoTime(0)}var e,i=Q.now(),n=i-this._lastTime,s=this._currTime+=n*this.scale;for(t in this._lastTime=i,this._tweenDic)(e=this._tweenDic[t])._updateEase(s);0!=this._tweenDataList.length&&this._index=(i=this._tweenDataList[this._index]).startTime&&(this._index++,0==i.type?(this._gidIndex++,(e=_t.getItemByClass("tween",mt))._create(i.target,i.data,i.duration,i.ease,w.create(this,this._animComplete,[this._gidIndex]),0,!1,i.isTo,!0,!1),e.setStartTime(s),e.gid=this._gidIndex,(this._tweenDic[this._gidIndex]=e)._updateEase(s)):this.event("label",i.data)))},t._animComplete=function(t){this._tweenDic[t]&&delete this._tweenDic[t]},t._complete=function(){this.event("complete")},t.reset=function(){if(this._labelDic)for(var t in this._labelDic)delete this._labelDic[t];for(t in this._tweenDic)this._tweenDic[t].clear(),delete this._tweenDic[t];for(t in this._firstTweenDic)delete this._firstTweenDic[t];if(this._endTweenDataList=null,this._tweenDataList&&this._tweenDataList.length)for(var e=0,i=this._tweenDataList.length,e=0;e=this.duration)return this.stop();var t=this.context,e=this.gain,i=t.createBufferSource();(this.bufferSource=i).buffer=this.audioBuffer,i.connect(e),e&&e.disconnect(),e.connect(t.destination),i.onended=this._onPlayEnd,this._startTime=Q.now(),this.gain.gain.setTargetAtTime?this.gain.gain.setTargetAtTime(this._volume,this.context.currentTime,.001):this.gain.gain.value=this._volume,0==this.loops&&(i.loop=!0),i.playbackRate.setTargetAtTime?i.playbackRate.setTargetAtTime(N.playbackRate,this.context.currentTime,.001):i.playbackRate.value=N.playbackRate,i.start(0,this.startTime),this._currentTime=0}},i.__onPlayEnd=function(){if(1==this.loops)return this.completeHandler&&(x.timer.once(10,this,this.__runComplete,[this.completeHandler],!1),this.completeHandler=null),this.stop(),void this.event("complete");0=this._count){if(!this.loop)return this._index--,this.stop(),void this.event("complete");2==this.wrapMode?(this._index=0<=this._count-2?this._count-2:0,this._isReverse=!0):this._index=0,this.event("complete")}this.index=this._index},i._setControlNode=function(t){this._controlNode&&(this._controlNode.off("display",this,this._checkResumePlaying),this._controlNode.off("undisplay",this,this._checkResumePlaying)),(this._controlNode=t)&&t!=this&&(t.on("display",this,this._checkResumePlaying),t.on("undisplay",this,this._checkResumePlaying))},i._setDisplay=function(t){e.prototype._setDisplay.call(this,t),this._checkResumePlaying()},i._checkResumePlaying=function(){this._isPlaying&&(this._controlNode.displayedInStage?this.play(this._index,this.loop,this._actionName):this.clearTimer(this,this._frameLoop))},i.stop=function(){this._isPlaying=!1,this.clearTimer(this,this._frameLoop)},i.addLabel=function(t,e){this._labels||(this._labels={}),this._labels[e]||(this._labels[e]=[]),this._labels[e].push(t)},i.removeLabel=function(t){if(t){if(this._labels)for(var e in this._labels)this._removeLabelFromLabelList(this._labels[e],t)}else this._labels=null},i._removeLabelFromLabelList=function(t,e){if(t)for(var i=t.length-1;0<=i;i--)t[i]==e&&t.splice(i,1)},i.gotoAndStop=function(t){this.index="string"==typeof t?this._getFrameByLabel(t):t,this.stop()},i._displayToIndex=function(t){},i.clear=function(){this.stop(),this._labels=null},f(0,i,"interval",function(){return this._interval},function(t){this._interval!=t&&(this._frameRateChanged=!0,this._interval=t,this._isPlaying&&0this._height?"top":this.valign)?c=.5*(this._height-e*h)+s[0]-s[2]:"bottom"===d&&(c=this._height-e*h-s[2]));var u,_,d,f=this._style;l&&l.autoScaleSize&&(u=l.fontSize/this.fontSize),this._clipPoint&&(i.save(),l&&l.autoScaleSize?(d=_=0,_=this._width?this._width-s[3]-s[1]:this._textWidth,d=this._height?this._height-s[0]-s[2]:this._textHeight,i.clipRect(s[3],s[0],_*=u,d*=u)):i.clipRect(s[3],s[0],this._width?this._width-s[3]-s[1]:this._textWidth,this._height?this._height-s[0]-s[2]:this._textHeight));var p=f.password;"prompt"in this&&this.prompt==this._text&&(p=!1);for(var g,m,v=Math.min(this._lines.length,e+t)||1,y=t;yy-t?this._words[y-t]:new Tt).setText(x)):w=x,f.stroke?i.fillBorderText(w,g,m,n,this.color,f.strokeColor,f.stroke,o):i.fillText(w,g,m,n,this.color,o))}l&&l.autoScaleSize&&this.scale(e=1/u,e),this._clipPoint&&i.restore(),this._startX=r,this._startY=c},t.drawUnderline=function(t,e,i,n){var s=this._lineWidths[n];switch(t){case"center":e-=s/2;break;case"right":e-=s}i+=this._charSize.height,this._graphics.drawLine(e,i,e+s,i,this.underlineColor||this.color,1)},t.typeset=function(){if(this._isChanged=!1,!this._text)return this._clipPoint=null,this._textWidth=this._textHeight=0,void this.graphics.clear(!0);V.isConchApp?(t=""+this._getCSSStyle().font,this._getCSSStyle().stroke&&this._getCSSStyle().strokeColor&&(t+=" 1 "+this._getCSSStyle().strokeColor),Q.context.font=t,V.isConchNode&&(Q.context.direction=this.direction,this.graphics.setDirection&&this.graphics.setDirection(this.direction))):Q.context.font=this._getCSSStyle().font,this._lines.length=0,this._lineWidths.length=0,this._isPassWordMode()?this.parseLines(this._getPassWordTxt(this._text)):this.parseLines(this._text),this.evalTextSize(),this.checkEnabledViewportOrNot()?this._clipPoint||(this._clipPoint=new k(0,0)):this._clipPoint=null;var t=this._lines.length;this.overflow!=d.VISIBLE&&(e=this.overflow==d.HIDDEN?Math.floor:Math.ceil,t=Math.min(t,e((this.height-this.padding[0]-this.padding[2])/(this.leading+this._charSize.height))));var e=this.scrollY/(this._charSize.height+this.leading)|0;this.renderText(e,t),this.repaint()},t.evalTextSize=function(){var t=NaN,e=Math.max.apply(this,this._lineWidths),t=this._currBitmapFont?this._lines.length*(this._currBitmapFont.getMaxHeight()+this.leading)+this.padding[0]+this.padding[2]:this._lines.length*(this._charSize.height+this.leading)+this.padding[0]+this.padding[2];e==this._textWidth&&t==this._textHeight||(this._textWidth=e,this._textHeight=t,this._width&&this._height||this.conchModel&&this.conchModel.size(this._width||this._textWidth,this._height||this._textHeight))},t.checkEnabledViewportOrNot=function(){return this.overflow==d.SCROLL&&(0this._width||0this._height)},t.changeText=function(t){this._text!==t&&(this.lang(t+""),this._graphics&&this._graphics.replaceText(this._text)||this.typeset())},t.parseLines=function(t){var e,i,n=this.wordWrap||this.overflow==d.HIDDEN;n&&(e=this.getWordWrapWidth()),this._currBitmapFont?(this._charSize.width=this._currBitmapFont.getMaxWidth(),this._charSize.height=this._currBitmapFont.getMaxHeight()):(i=Q.context.measureText(d._testWord),V.isConchApp&&0===i.width&&0===i.height&&(i=Q.context.measureText("W")),this._charSize.width=i.width,this._charSize.height=i.height||this.fontSize);for(var s=t.replace(/\r\n/g,"\n").split("\n"),r=0,o=s.length;rthis._count&&(t=this._count);for(var e=this._animationData.nodes,i=0,n=e.length,i=0;ie?r[e]:r[r.length-1],n[s]=r},e._calculateDatas=function(){if(this._animationData){for(var t,e=this._animationData.nodes,i=0,n=e.length,i=this._count=0;ithis._count&&(this._count=o),t.tween)for(null==(n=at[t.tweenMethod])&&(n=at.linearNone),s=r;sthis._count&&(t=this._count);for(var e=this._animationData.nodes,i=0,n=1<(n=e.length)?1:n,i=0;ie?s[e]:s[s.length-1],h[n]=s},e._calculateNodeKeyFrames=function(t){r.prototype._calculateNodeKeyFrames.call(this,t);var e,i,n=t.keyframes,s=(t.target,{});for(e in t.secondFrames=s,n)(i=n[e]).length<=1?s[e]=-1:s[e]=i[1].index},f(0,e,"target",function(){return this._target},function(t){this._target&&this._target.off("effectanimationbegin",this,this._onOtherBegin),this._target=t,this._target&&this._target.on("effectanimationbegin",this,this._onOtherBegin),this.addEvent()}),f(0,e,"playEvent",null,function(t){(this._playEvents=t)&&this.addEvent()}),f(0,e,"effectData",null,function(t){!t||(t=t.animations)&&t[0]&&(this._setUp({},t[0]),t[0].nodes&&t[0].nodes[0]&&(this._aniKeys=t[0].nodes[0].keys))}),f(0,e,"effectClass",null,function(t){this._effectClass=it.getClass(t),this._effectClass&&(!(t=this._effectClass.uiView)||(t=t.animations)&&t[0]&&(this._setUp({},t[0]),t[0].nodes&&t[0].nodes[0]&&(this._aniKeys=t[0].nodes[0].keys)))}),t.EffectAnimationBegin="effectanimationbegin"}(Gt),function(e){var p;function g(){this.animationList=null,this.animationDic=null,this._nodeList=null,this._nodeDefaultProps=null,this._gList=null,this._nodeIDAniDic={},this._rootNode=null,this._nodeGDic=null,g.__super.call(this)}m(g,"laya.utils.GraphicAnimation",e);var t=g.prototype;return t._parseNodeList=function(t){this._nodeList||(this._nodeList=[]),this._nodeDefaultProps[t.compId]=t.props,t.compId&&this._nodeList.push(t.compId);var e=t.child;if(e)for(var i=0,n=e.length,i=0;i=r.length&&(i=r.length-1),null!=t[e][i])return t[e][i]}return s.hasOwnProperty(e)?s[e]:n},t._getNodeGraphicData=function(t,e,i){(i=i||p.create()).transform?i.transform.identity():i.transform=F.create();var n=this.getNodeDataByID(t);if(!n)return i;var s=n.frames,r=this._getParams(s,g._drawTextureCmd,e,this._nodeDefaultProps[t]),o=r[0],a=NaN,h=NaN,l=r[5],c=r[6],u=r[13],_=r[14],d=r[7],f=r[8],n=r[9],s=r[11],e=r[12],a=r[3],h=r[4];0!=a&&0!=h||(o=null),-1==a&&(a=0),-1==h&&(h=0),i.skin=o,i.width=a,i.height=h,o&&((t=this._getTextureByUrl(o))?(a=a||t.sourceWidth,h=h||t.sourceHeight):console.warn("lost skin:",o,",you may load pics first")),i.alpha=r[10],o=i.transform,0!=_&&(c=_*h),0==(l=0!=u?u*a:l)&&0==c||o.translate(-l,-c);l=null;return(n||1!==d||1!==f||s||e)&&((l=g._tempMt).identity(),l.bTransform=!0,c=.0174532922222222*(n-s),s=.0174532922222222*(n+e),n=Math.cos(s),e=Math.sin(s),s=Math.sin(c),c=Math.cos(c),l.a=d*n,l.b=d*e,l.c=-f*s,l.d=f*c,l.tx=l.ty=0),(o=l?F.mul(o,l,o):o).translate(r[1],r[2]),i},t._getTextureByUrl=function(t){return It.getRes(t)},t.setAniData=function(t,e){if(t.animations){this._nodeDefaultProps={},this._nodeGDic={},this._nodeList&&(this._nodeList.length=0),this._rootNode=t,this._parseNodeList(t);for(var i,n={},s=[],r=t.animations,o=0,a=r.length,o=0;o