var Laya=window.Laya=function(t,e){var i={__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?i.__presubstr.call(this,t):i.__presubstr.call(this,t,e>0?e:this.length+e)},__init:function(t){t.forEach(function(t){t.__init$&&t.__init$()})},__isClass:function(t){return t&&(t.__isclass||t==Object||t==String||t==Array)},__newvec:function(t,e){var i=[];i.length=t;for(var n=0;n1)for(var a=0,o=s.length-1;a0){if(0==n.indexOf("laya.")){var a=n.split(".");s=s||a[a.length-1],i[s]&&console.log("Warning!,this class["+s+"] already exist:",i[s]),i[s]=e}}else"Main"==n?t.Main=e:(i[n]&&console.log("Error!,this class["+n+"] already exist:",i[n]),i[n]=e);var o=i.un,h=e.prototype;o(h,"hasOwnProperty",i.__hasOwnProperty),o(h,"__class",e),o(h,"__super",r),o(h,"__className",n),o(e,"__super",r),o(e,"__className",n),o(e,"__isclass",!0),o(e,"super",function(t){this.__super.call(t)})},imps:function(t,e){if(!e)return null;var n=t.__imps||i.un(t,"__imps",{});function __(t){var e,r;if((e=i.__internals[t])&&(n[t]=!0,r=e.extend))for(var s=0;s.01||t._needRepaint()){var o=e.globalAlpha;e.globalAlpha*=r,e.drawTexture(a,i-s.pivotX+a.offsetX,n-s.pivotY+a.offsetY,t._width||a.width,t._height||a.height),e.globalAlpha=o}},LayaGLQuickRunner.alpha_transform_drawTexture=function(t,e,i,n){var r,s=t._style,a=t.texture;if((r=s.alpha)>.01||t._needRepaint()){var o=e.globalAlpha;e.globalAlpha*=r,e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,n),e.drawTexture(a,-s.pivotX+a.offsetX,-s.pivotY+a.offsetY,t._width||a.width,t._height||a.height),e.restoreTransform(LayaGLQuickRunner.curMat),e.globalAlpha=o}},LayaGLQuickRunner.alpha_transform_drawLayaGL=function(t,e,i,n){var r,s=t._style;if((r=s.alpha)>.01||t._needRepaint()){var a=e.globalAlpha;e.globalAlpha*=r,e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,n),t._graphics&&t._graphics._render(t,e,-s.pivotX,-s.pivotY),e.restoreTransform(LayaGLQuickRunner.curMat),e.globalAlpha=a}},LayaGLQuickRunner.alpha_drawLayaGL=function(t,e,i,n){var r,s=t._style;if((r=s.alpha)>.01||t._needRepaint()){var a=e.globalAlpha;e.globalAlpha*=r,t._graphics&&t._graphics._render(t,e,i-s.pivotX,n-s.pivotY),e.globalAlpha=a}},LayaGLQuickRunner.transform_drawLayaGL=function(t,e,i,n){var r=t._style;e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,n),t._graphics&&t._graphics._render(t,e,-r.pivotX,-r.pivotY),e.restoreTransform(LayaGLQuickRunner.curMat)},LayaGLQuickRunner.transform_drawNodes=function(t,e,i,n){var r=t._getBit(256)&&e.drawCallOptimize(!0),s=t._style;e.saveTransform(LayaGLQuickRunner.curMat),e.transformByMatrix(t.transform,i,n),i=-s.pivotX,n=-s.pivotY;var a,o=t._children,h=o.length;if(s.viewport){var u=s.viewport,l=u.x,c=u.y,_=u.right,d=u.bottom,f=NaN,p=NaN;for(m=0;ml&&(p=a._y)c&&a.render(e,i,n)}else for(var m=0;ml&&(p=a._y)c&&a.render(e,i,n)}else for(var m=0;m=0||t.indexOf("rgb(")>=0){var r,s,a=t;for(r=a.indexOf("("),s=a.indexOf(")"),a=a.substring(r+1,s),this.arrColor=a.split(","),i=this.arrColor.length,e=0;e=0||9===this.strColor.length?(this.arrColor=[((4278190080&n)>>>24)/255,((16711680&n)>>16)/255,((65280&n)>>8)/255,(255&n)/255],this.numColor=(4278190080&n)>>>24|(16711680&n)>>8|(65280&n)<<8|(255&n)<<24):(this.arrColor=[((16711680&n)>>16)/255,((65280&n)>>8)/255,(255&n)/255,1],this.numColor=4278190080|(16711680&n)>>16|65280&n|(255&n)<<16),this.arrColor.__id=++ColorUtils._COLODID}return r(ColorUtils,"laya.utils.ColorUtils"),ColorUtils._initDefault=function(){for(var t in ColorUtils._DEFAULT={},ColorUtils._COLOR_MAP)ColorUtils._SAVE[t]=ColorUtils._DEFAULT[t]=new ColorUtils(ColorUtils._COLOR_MAP[t]);return ColorUtils._DEFAULT},ColorUtils._initSaveMap=function(){for(var t in ColorUtils._SAVE_SIZE=0,ColorUtils._SAVE={},ColorUtils._DEFAULT)ColorUtils._SAVE[t]=ColorUtils._DEFAULT[t]},ColorUtils.create=function(t){var e=t+"",i=ColorUtils._SAVE[e];return null!=i?i:(ColorUtils._SAVE_SIZE<1e3&&ColorUtils._initSaveMap(),ColorUtils._SAVE[e]=new ColorUtils(t))},ColorUtils._SAVE={},ColorUtils._SAVE_SIZE=0,ColorUtils._COLOR_MAP={purple:"#800080",orange:"#ffa500",white:"#FFFFFF",red:"#FF0000",green:"#00FF00",blue:"#0000FF",black:"#000000",yellow:"#FFFF00",gray:"#808080"},ColorUtils._DEFAULT=ColorUtils._initDefault(),ColorUtils._COLODID=1,ColorUtils}(),h=function(){function SaveBase(){}r(SaveBase,"laya.webgl.canvas.save.SaveBase");var t=SaveBase.prototype;return i.imps(t,{"laya.webgl.canvas.save.ISaveData":!0}),t.isSaveMark=function(){return!1},t.restore=function(t){this._dataObj[this._valueName]=this._value,SaveBase.POOL[SaveBase.POOL._length++]=this,this._newSubmit&&(t._curSubmit=V.RENDERBASE)},SaveBase._createArray=function(){var t=[];return t._length=0,t},SaveBase._init=function(){var t=SaveBase._namemap={};return t[1]="ALPHA",t[2]="fillStyle",t[8]="font",t[256]="lineWidth",t[512]="strokeStyle",t[8192]="_mergeID",t[1024]=t[2048]=t[4096]=[],t[16384]="textBaseline",t[32768]="textAlign",t[65536]="_nBlendType",t[1048576]="shader",t[2097152]="filters",t[8388608]="_colorFiler",t},SaveBase.save=function(t,e,i,n){if((t._saveMark._saveuse&e)!==e){t._saveMark._saveuse|=e;var r=SaveBase.POOL,s=r._length>0?r[--r._length]:new SaveBase;s._value=i[s._valueName=SaveBase._namemap[e]],s._dataObj=i,s._newSubmit=n;var a=t._save;a[a._length++]=s}},SaveBase.POOL=laya.webgl.canvas.save.SaveBase._createArray(),SaveBase._namemap=SaveBase._init(),SaveBase}(),u=function(){function RenderSprite(t,e){if(a.map[t])return this._fun=a.map[t],void(this._next=RenderSprite.NORENDER);switch(this._next=e||RenderSprite.NORENDER,t){case 0:return void(this._fun=this._no);case 1:return void(this._fun=this._alpha);case 2:return void(this._fun=this._transform);case 4:return void(this._fun=this._blend);case 8:return void(this._fun=this._canvas);case 32:return void(this._fun=this._mask);case 64:return void(this._fun=this._clip);case 128:return void(this._fun=this._style);case 512:return void(this._fun=this._graphics);case 8192:return void(this._fun=this._children);case 2048:return void(this._fun=this._custom);case 256:return void(this._fun=this._texture);case 16:return void(this._fun=vt._filter);case 69905:return void(this._fun=RenderSprite._initRenderFun)}this.onCreate(t)}r(RenderSprite,"laya.renders.RenderSprite");var t=RenderSprite.prototype;return t.onCreate=function(t){},t._style=function(t,e,i,n){var r=t._style;null!=r.render&&r.render(t,e,i,n);var s=this._next;s._fun.call(s,t,e,i,n)},t._no=function(t,e,i,n){},t._custom=function(t,e,i,n){t.customRender(e,i,n),this._next._fun.call(this._next,t,e,i-t.pivotX,n-t.pivotY)},t._clip=function(t,e,i,n){var r=this._next;if(r!=RenderSprite.NORENDER){var s=t._style.scrollRect;e.save(),e.clipRect(i,n,s.width,s.height),r._fun.call(r,t,e,i-s.x,n-s.y),e.restore()}},t._texture=function(t,e,i,n){var r=t.texture;r._getSource()&&e.drawTexture(r,i-t.pivotX+r.offsetX,n-t.pivotY+r.offsetY,t._width||r.width,t._height||r.height);var s=this._next;s!=RenderSprite.NORENDER&&s._fun.call(s,t,e,i,n)},t._graphics=function(t,e,i,n){var r=t._style,s=t._graphics;s&&s._render(t,e,i-r.pivotX,n-r.pivotY);var a=this._next;a!=RenderSprite.NORENDER&&a._fun.call(a,t,e,i,n)},t._image=function(t,e,i,n){var r=t._style;e.drawTexture2(i,n,r.pivotX,r.pivotY,t.transform,t._graphics._one)},t._image2=function(t,e,i,n){var r=t._style;e.drawTexture2(i,n,r.pivotX,r.pivotY,t.transform,t._graphics._one)},t._alpha=function(t,e,i,n){var r;if((r=t._style.alpha)>.01||t._needRepaint()){var s=e.globalAlpha;e.globalAlpha*=r;var a=this._next;a._fun.call(a,t,e,i,n),e.globalAlpha=s}},t._transform=function(t,e,i,n){var r=t.transform,s=this._next;t._style;r&&s!=RenderSprite.NORENDER?(e.save(),e.transform(r.a,r.b,r.c,r.d,r.tx+i,r.ty+n),s._fun.call(s,t,e,0,0),e.restore()):s!=RenderSprite.NORENDER&&s._fun.call(s,t,e,i,n)},t._children=function(t,e,i,n){var r,s=t._style,a=t._children,o=a.length;i-=t.pivotX,n-=t.pivotY;var h=t._getBit(256)&&e.drawCallOptimize(!0);if(s.viewport){var u=s.viewport,l=u.x,c=u.y,_=u.right,d=u.bottom,f=NaN,p=NaN;for(m=0;ml&&(p=r._y)c&&r.render(e,i,n)}else for(var m=0;m2048||u>2048))return console.warn("cache bitmap size larger than 2048,cache ignored"),d.releaseContext(),void f._fun.call(f,t,e,i,n);if(p||(d.createContext(),p=d.canvas),(r=p.context).sprite=t,(p.width!=h||p.height!=u)&&p.size(h,u),"bitmap"===m?r.asBitmap=!0:"normal"===m&&(r.asBitmap=!1),r.clear(),1!=l||1!=c){var g=r;g.save(),g.scale(l,c),f._fun.call(f,t,r,-s,-a),g.restore(),t._applyFilters()}else g=r,f._fun.call(f,t,r,-s,-a),t._applyFilters();d.staticCache&&(d.reCache=!1),kt.canvasReCache++},t._canvas_webgl_normal_repaint=function(t,e){var n=t._cacheStyle,r=this._next,s=n.canvas,a=n.cacheAs;n._calculateCacheRect(t,a,0,0);s||(s=n.canvas=new i.WebGLCacheAsNormalCanvas(e,t));var o=s.context;s.startRec(),r._fun.call(r,t,o,t.pivotX,t.pivotY),t._applyFilters(),kt.canvasReCache++,s.endRec()},t._blend=function(t,e,i,n){var r=t._style,s=this._next;r.blendMode?(e.save(),e.globalCompositeOperation=r.blendMode,s._fun.call(s,t,e,i,n),e.restore()):s._fun.call(s,t,e,i,n)},t._mask=function(t,e,i,n){var r=this._next,s=t.mask,a=e;if(s){a.save();var o=a.globalCompositeOperation,h=new mt;if(h.copyFrom(s.getBounds()),h.width=Math.round(h.width),h.height=Math.round(h.height),h.x=Math.round(h.x),h.y=Math.round(h.y),h.width>0&&h.height>0){var u=h.width,c=h.height,_=Q.getRT(u,c);a.breakNextMerge(),a.pushRT(),a.addRenderObject(l.create([a,_,u,c],RenderSprite.tmpTarget,this)),s.render(a,-h.x,-h.y),a.breakNextMerge(),a.popRT(),a.save(),a.clipRect(i+h.x-t.getStyle().pivotX,n+h.y-t.getStyle().pivotY,u,c),r._fun.call(r,t,a,i,n),a.restore(),o=a.globalCompositeOperation,a.addRenderObject(l.create(["mask"],RenderSprite.setBlendMode,this));var d=st.create(1,0),f=Fe.INV_UV;a.drawTarget(_,i+h.x-t.getStyle().pivotX,n+h.y-t.getStyle().pivotY,u,c,U.TEMP.identity(),d,f,6),a.addRenderObject(l.create([_],RenderSprite.recycleTarget,this)),a.addRenderObject(l.create([o],RenderSprite.setBlendMode,this))}a.restore()}else r._fun.call(r,t,e,i,n)},RenderSprite.__init__=function(){a.__init__();var t,e,i=0;for(e=new RenderSprite(69905,null),t=RenderSprite.renders.length=16384,i=0;i0;)i&t&&(e=new RenderSprite(i,e)),i>>=1;return e},RenderSprite.tmpTarget=function(t,e,i,n){e.start(),e.clear(0,0,0,0)},RenderSprite.recycleTarget=function(t){Q.releaseRT(t)},RenderSprite.setBlendMode=function(t){var e=j.mainContext;Lt.targetFns[Lt.TOINT[t]](e)},RenderSprite.INIT=69905,RenderSprite.renders=[],RenderSprite.NORENDER=new RenderSprite(0,null),n(RenderSprite,["tempUV",function(){return this.tempUV=new Array(8)}]),RenderSprite}(),l=function(){function SubmitCMD(){this.fun=null,this._this=null,this.args=null,this._ref=1,this._key=new _e}r(SubmitCMD,"laya.webgl.submit.SubmitCMD");var t=SubmitCMD.prototype;return i.imps(t,{"laya.webgl.submit.ISubmit":!0}),t.renderSubmit=function(){return this.fun.apply(this._this,this.args),1},t.getRenderType=function(){return 0},t.reUse=function(t,e){return this._ref++,e},t.releaseRender=function(){if(--this._ref<1){var t=SubmitCMD.POOL;t[t._length++]=this}},t.clone=function(t,e,i){return null},SubmitCMD.create=function(t,e,i){var n=SubmitCMD.POOL._length?SubmitCMD.POOL[--SubmitCMD.POOL._length]:new SubmitCMD;return n.fun=e,n.args=t,n._this=i,n._ref=1,n._key.clear(),n},SubmitCMD.POOL=[],SubmitCMD.__init$=function(){SubmitCMD.POOL._length=0},SubmitCMD}(),c=(function(){function WebGLCacheAsNormalCanvas(t,e){this.submitStartPos=0,this.submitEndPos=0,this.context=null,this.touches=[],this.submits=[],this.sprite=null,this._mesh=null,this._pathMesh=null,this._triangleMesh=null,this.meshlist=[],this._oldMesh=null,this._oldPathMesh=null,this._oldTriMesh=null,this._oldMeshList=null,this.oldTx=0,this.oldTy=0,this.cachedClipInfo=new U,this.invMat=new U,this.context=t,this.sprite=e,t._globalClipMatrix.copyTo(this.cachedClipInfo)}r(WebGLCacheAsNormalCanvas,"laya.webgl.canvas.WebGLCacheAsNormalCanvas");var t=WebGLCacheAsNormalCanvas.prototype;t.startRec=function(){this.context._charSubmitCache._enbale&&(this.context._charSubmitCache.enable(!1,this.context),this.context._charSubmitCache.enable(!0,this.context)),this.context._incache=!0,this.touches.length=0,this.context.touches=this.touches,this.context._globalClipMatrix.copyTo(this.cachedClipInfo),this.submits.length=0,this.submitStartPos=this.context._submits._length;for(var t=0,e=this.meshlist.length;t0&&(n=1);var r=i._data;return t.uploadShaderUniforms(e,r,n)},LayaGLRunner}()),_=function(){function DrawLineCmd(){}r(DrawLineCmd,"laya.display.cmd.DrawLineCmd");var t=DrawLineCmd.prototype;return t.recover=function(){re.recover("DrawLineCmd",this)},t.run=function(t,e,i){t._drawLine(e,i,this.fromX,this.fromY,this.toX,this.toY,this.lineColor,this.lineWidth,this.vid)},s(0,t,"cmdID",function(){return"DrawLine"}),DrawLineCmd.create=function(t,e,i,n,r,s,a){var o=re.getItemByClass("DrawLineCmd",DrawLineCmd);return o.fromX=t,o.fromY=e,o.toX=i,o.toY=n,o.lineColor=r,o.lineWidth=s,o.vid=a,o},DrawLineCmd.ID="DrawLine",DrawLineCmd}(),d=function(){function BufferStateBase(){this._nativeVertexArrayObject=null,this._bindedIndexBuffer=null,this._nativeVertexArrayObject=X.instance.createVertexArray()}r(BufferStateBase,"laya.webgl.BufferStateBase");var t=BufferStateBase.prototype;return t.bind=function(){BufferStateBase._curBindedBufferState!==this&&(X.instance.bindVertexArray(this._nativeVertexArrayObject),BufferStateBase._curBindedBufferState=this)},t.unBind=function(){if(BufferStateBase._curBindedBufferState!==this)throw"BufferState: must call bind() function first.";X.instance.bindVertexArray(null),BufferStateBase._curBindedBufferState=null},t.bindForNative=function(){X.instance.bindVertexArray(this._nativeVertexArrayObject),BufferStateBase._curBindedBufferState=this},t.unBindForNative=function(){X.instance.bindVertexArray(null),BufferStateBase._curBindedBufferState=null},t.destroy=function(){X.instance.deleteVertexArray(this._nativeVertexArrayObject)},BufferStateBase._curBindedBufferState=null,BufferStateBase}(),f=function(){var t;function EventDispatcher(){this._$0__events=null}r(EventDispatcher,"laya.events.EventDispatcher");var e=EventDispatcher.prototype;return e.hasListener=function(t){return!!(this._$0__events&&this._$0__events[t])},e.event=function(t,e){if(!this._$0__events||!this._$0__events[t])return!1;var i=this._$0__events[t];if(i.run)i.once&&delete this._$0__events[t],null!=e?i.runWith(e):i.run();else{for(var n=0,r=i.length;n-1;e--)t[e]&&(t[e].recover(),t[e]=null)},e.isMouseEvent=function(t){return EventDispatcher.MOUSE_EVENTS[t]||!1},EventDispatcher.MOUSE_EVENTS={rightmousedown:!0,rightmouseup:!0,rightclick:!0,mousedown:!0,mouseup:!0,mousemove:!0,mouseover:!0,mouseout:!0,click:!0,doubleclick:!0},EventDispatcher.__init$=function(){Object.defineProperty(laya.events.EventDispatcher.prototype,"_events",{enumerable:!1,writable:!0}),t=function(t){function EventHandler(t,e,i,n){EventHandler.__super.call(this,t,e,i,n)}return r(EventHandler,"",p),EventHandler.prototype.recover=function(){this._id>0&&(this._id=0,EventHandler._pool.push(this.clear()))},EventHandler.create=function(t,e,i,n){return void 0===n&&(n=!0),EventHandler._pool.length?EventHandler._pool.pop().setTo(t,e,i,n):new EventHandler(t,e,i,n)},EventHandler._pool=[],EventHandler}()},EventDispatcher}(),p=function(){function Handler(t,e,i,n){this.once=!1,this._id=0,void 0===n&&(n=!1),this.setTo(t,e,i,n)}r(Handler,"laya.utils.Handler");var t=Handler.prototype;return t.setTo=function(t,e,i,n){return this._id=Handler._gid++,this.caller=t,this.method=e,this.args=i,this.once=n,this},t.run=function(){if(null==this.method)return null;var t=this._id,e=this.method.apply(this.caller,this.args);return this._id===t&&this.once&&this.recover(),e},t.runWith=function(t){if(null==this.method)return null;var e=this._id;if(null==t)var i=this.method.apply(this.caller,this.args);else i=this.args||t.unshift?this.args?this.method.apply(this.caller,this.args.concat(t)):this.method.apply(this.caller,t):this.method.call(this.caller,t);return this._id===e&&this.once&&this.recover(),i},t.clear=function(){return this.caller=null,this.method=null,this.args=null,this},t.recover=function(){this._id>0&&(this._id=0,Handler._pool.push(this.clear()))},Handler.create=function(t,e,i,n){return void 0===n&&(n=!0),Handler._pool.length?Handler._pool.pop().setTo(t,e,i,n):new Handler(t,e,i,n)},Handler._pool=[],Handler._gid=1,Handler}(),m=function(){var e;function LocalStorage(){}return r(LocalStorage,"laya.net.LocalStorage"),LocalStorage.__init__=function(){return LocalStorage._baseClass||(LocalStorage._baseClass=e,e.init()),LocalStorage.items=LocalStorage._baseClass.items,LocalStorage.support=LocalStorage._baseClass.support,LocalStorage.support},LocalStorage.setItem=function(t,e){LocalStorage._baseClass.setItem(t,e)},LocalStorage.getItem=function(t){return LocalStorage._baseClass.getItem(t)},LocalStorage.setJSON=function(t,e){LocalStorage._baseClass.setJSON(t,e)},LocalStorage.getJSON=function(t){return LocalStorage._baseClass.getJSON(t)},LocalStorage.removeItem=function(t){LocalStorage._baseClass.removeItem(t)},LocalStorage.clear=function(){LocalStorage._baseClass.clear()},LocalStorage._baseClass=null,LocalStorage.items=null,LocalStorage.support=!1,LocalStorage.__init$=function(){e=function(){function Storage(){}return r(Storage,""),Storage.init=function(){try{Storage.support=!0,Storage.items=t.localStorage,Storage.setItem("laya","1"),Storage.removeItem("laya")}catch(t){Storage.support=!1}Storage.support||console.log("LocalStorage is not supprot or browser is private mode.")},Storage.setItem=function(t,e){try{Storage.support&&Storage.items.setItem(t,e)}catch(t){console.warn("set localStorage failed",t)}},Storage.getItem=function(t){return Storage.support?Storage.items.getItem(t):null},Storage.setJSON=function(t,e){try{Storage.support&&Storage.items.setItem(t,JSON.stringify(e))}catch(t){console.warn("set localStorage failed",t)}},Storage.getJSON=function(t){return JSON.parse(Storage.support?Storage.items.getItem(t):null)},Storage.removeItem=function(t){Storage.support&&Storage.items.removeItem(t)},Storage.clear=function(){Storage.support&&Storage.items.clear()},Storage.items=null,Storage.support=!1,Storage}()},LocalStorage}(),g=function(){function SaveCmd(){}r(SaveCmd,"laya.display.cmd.SaveCmd");var t=SaveCmd.prototype;return t.recover=function(){re.recover("SaveCmd",this)},t.run=function(t,e,i){t.save()},s(0,t,"cmdID",function(){return"Save"}),SaveCmd.create=function(){return re.getItemByClass("SaveCmd",SaveCmd)},SaveCmd.ID="Save",SaveCmd}(),v=function(){function Component(){this._id=St.getGID(),this._resetComp()}r(Component,"laya.components.Component");var t=Component.prototype;return i.imps(t,{"laya.resource.ISingletonElement":!0,"laya.resource.IDestroy":!0}),t._isScript=function(){return!1},t._resetComp=function(){this._indexInList=-1,this._enabled=!0,this._awaked=!1,this.owner=null},t._getIndexInList=function(){return this._indexInList},t._setIndexInList=function(t){this._indexInList=t},t._onAdded=function(){},t._onAwake=function(){},t._onEnable=function(){},t._onDisable=function(){},t._onEnableInScene=function(){},t._onDisableInScene=function(){},t._onDestroy=function(){},t.onReset=function(){},t._parse=function(t){},t._cloneTo=function(t){},t._setActive=function(t){t?(this._awaked||(this._awaked=!0,this._onAwake()),this._enabled&&this._onEnable()):this._enabled&&this._onDisable()},t._setActiveInScene=function(t){t?this._onEnableInScene():this._onDisableInScene()},t.destroy=function(){this.owner&&this.owner._destroyComponent(this)},t._destroy=function(){this.owner.activeInHierarchy&&this._enabled&&(this._setActive(!1),this._isScript()&&this.onDisable()),this.owner._scene&&this._setActiveInScene(!1),this._onDestroy(),this._destroyed=!0,this.onReset!==laya.components.Component.prototype.onReset?(this.onReset(),this._resetComp(),re.recoverByClass(this)):this._resetComp()},s(0,t,"id",function(){return this._id}),s(0,t,"enabled",function(){return this._enabled},function(t){this._enabled=t,this.owner&&(t?this.owner.activeInHierarchy&&this._onEnable():this.owner.activeInHierarchy&&this._onDisable())}),s(0,t,"isSingleton",function(){return!0}),s(0,t,"destroyed",function(){return this._destroyed}),Component}(),x=function(){function WeakObject(){this._obj=null,this._obj=WeakObject.supportWeakMap?new Y.window.WeakMap:{},WeakObject.supportWeakMap||WeakObject._maps.push(this)}r(WeakObject,"laya.utils.WeakObject");var t=WeakObject.prototype;return t.set=function(t,e){if(null!=t)if(WeakObject.supportWeakMap){var i=t;"string"!=typeof t&&"number"!=typeof t||(i=WeakObject._keys[t])||(i=WeakObject._keys[t]={k:t}),this._obj.set(i,e)}else"string"==typeof t||"number"==typeof t?this._obj[t]=e:(t.$_GID||(t.$_GID=St.getGID()),this._obj[t.$_GID]=e)},t.get=function(t){if(null==t)return null;if(WeakObject.supportWeakMap){var e="string"==typeof t||"number"==typeof t?WeakObject._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){if(null!=t)if(WeakObject.supportWeakMap){var e="string"==typeof t||"number"==typeof t?WeakObject._keys[t]:t;if(!e)return;this._obj.delete(e)}else"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(WeakObject.supportWeakMap){var e="string"==typeof t||"number"==typeof t?WeakObject._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]},WeakObject.__init__=function(){WeakObject.supportWeakMap=null!=Y.window.WeakMap,WeakObject.supportWeakMap||i.systemTimer.loop(WeakObject.delInterval,null,WeakObject.clearCache)},WeakObject.clearCache=function(){for(var t=0,e=WeakObject._maps.length;t0&&(this._tex!=e||this._imgId!=i||this._clipid>=0&&this._clipid!=t._clipInfoID)&&this.submit(t),this._clipid=t._clipInfoID,t._globalClipMatrix.copyTo(this._clipMatrix),this._tex=e,this._imgId=i,this._colorFiler=t._colorFiler,this._data[this._ndata]=n,this._data[this._ndata+1]=r,this._data[this._ndata+2]=s,this._ndata+=3},t.getPos=function(){return 0==CharSubmitCache.__nPosPool?new Array(8):CharSubmitCache.__posPool[--CharSubmitCache.__nPosPool]},t.enable=function(t,e){t!==this._enbale&&(this._enbale=t,this._enbale||this.submit(e))},t.submit=function(t){var e=this._ndata;if(e){var i=t._mesh,n=t._colorFiler;t._colorFiler=this._colorFiler;var r=Ie.create(t,i,st.create(1,0));t._submits[t._submits._length++]=t._curSubmit=r,r.shaderValue.textureHost=this._tex,r._key.other=this._imgId,t._colorFiler=n,t._copyClipInfo(r,this._clipMatrix),r.clipInfoID=this._clipid;for(var s=0;s=this._duration)return this.complete();for(var n=i>0?this._ease(i,0,1,this._duration):0,r=this._props,s=0,a=r.length;s=this.repeat?(this.clear(),n&&n.run()):this.restart()}},t.pause=function(){i.timer.clear(this,this._beginLoop),i.timer.clear(this,this._doEase),i.timer.clear(this,this.firstStart);var t;(t=Y.now()-this._startTimer-this._delay)<0&&(this._usedTimer=t)},t.setStartTime=function(t){this._startTimer=t},t.clear=function(){this._target&&(this._remove(),this._clear())},t._clear=function(){this.pause(),i.timer.clear(this,this.firstStart),this._complete=null,this._target=null,this._ease=null,this._props=null,this._delayParam=null,this._usedPool&&(this.update=null,re.recover("tween",this))},t.recover=function(){this._usedPool=!0,this._clear()},t._remove=function(){var t=Tween.tweenMap[this._target.$_GID];if(t)for(var e=0,i=t.length;e=this._duration||(this._startTimer=Y.now()-this._usedTimer-this._delay,this._delayParam?this._usedTimer<0?i.timer.once(-this._usedTimer,this,this.firstStart,this._delayParam):this.firstStart.apply(this,this._delayParam):this._beginLoop())},s(0,t,"progress",null,function(t){var e=t*this._duration;this._startTimer=Y.now()-this._delay-e}),Tween.to=function(t,e,i,n,r,s,a,o){return void 0===s&&(s=0),void 0===a&&(a=!1),void 0===o&&(o=!0),re.getItemByClass("tween",Tween)._create(t,e,i,n,r,s,a,!0,o,!0)},Tween.from=function(t,e,i,n,r,s,a,o){return void 0===s&&(s=0),void 0===a&&(a=!1),void 0===o&&(o=!0),re.getItemByClass("tween",Tween)._create(t,e,i,n,r,s,a,!1,o,!0)},Tween.clearAll=function(t){if(t&&t.$_GID){var e=Tween.tweenMap[t.$_GID];if(e){for(var i=0,n=e.length;it);a++)if(t&s){var o=e[s];o&&(r[o]="")}return i[t]=r,r},ShaderDefinesBase._toInt=function(t,e){for(var i=t.split("."),n=0,r=0,s=i.length;r=a.exeTime)if(a.repeat)if(a.jumpFrame)for(;o>=a.exeTime;)a.exeTime+=a.delay,a.run(!1);else a.exeTime+=a.delay,a.run(!1),o>a.exeTime&&(a.exeTime+=Math.ceil((o-a.exeTime)/a.delay)*a.delay);else a.run(!0)}else this._count++}(this._count>30||t%200==0)&&this._clearHandlers()}},e._clearHandlers=function(){for(var t=this._handlers,e=0,i=t.length;e0?Timer._pool.pop():new t).repeat=i,h.userFrame=e,h.delay=n,h.caller=r,h.method=s,h.args=a,h.exeTime=n+(e?this.currFrame:this.currTimer+Y.now()-this._lastTimer),this._indexHandler(h),this._handlers.push(h),h},e._indexHandler=function(t){var e=t.caller,i=t.method,n=e?e.$_GID||(e.$_GID=St.getGID()):0,r=i.$_TID||(i.$_TID=1e5*Timer._mid++);t.key=n+r,this._map[t.key]=t},e.once=function(t,e,i,n,r){void 0===r&&(r=!0),this._create(!1,!1,t,e,i,n,r)},e.loop=function(t,e,i,n,r,s){void 0===r&&(r=!0),void 0===s&&(s=!1);var a=this._create(!1,!0,t,e,i,n,r);a&&(a.jumpFrame=s)},e.frameOnce=function(t,e,i,n,r){void 0===r&&(r=!0),this._create(!0,!1,t,e,i,n,r)},e.frameLoop=function(t,e,i,n,r){void 0===r&&(r=!0),this._create(!0,!0,t,e,i,n,r)},e.toString=function(){return" handlers:"+this._handlers.length+" pool:"+Timer._pool.length},e.clear=function(t,e){var i=this._getHandler(t,e);i&&(this._map[i.key]=null,i.key=0,i.clear())},e.clearAll=function(t){if(t)for(var e=0,i=this._handlers.length;e>24,n=e>>16&255,r=e>>8&255,s=255&e,a=t._size/TextRender.standardFontSize;this.fontSizeOffX=Math.ceil(i*a),this.fontSizeOffY=Math.ceil(n*a),this.fontSizeW=Math.ceil(r*a),this.fontSizeH=Math.ceil(s*a),t._font.indexOf("italic")>=0?this.fontStr=t._font.replace("italic",""):this.fontStr=t._font}},t.getNextChar=function(t){var e=t.length,i=this._curStrPos;if(i>=e)return null;for(var n=i,r=0;n>>11==27){if(1==r)break;r=1,n++}else if(65038===s||65039===s);else if(8205==s)r=2;else if(0==r)r=1;else if(1==r)break}return this._curStrPos=n,t.substring(i,n)},t.filltext=function(t,e,i,n,r,s,a,o,h,u){if(void 0===u&&(u=0),!(e.length<=0)){var l=Bt.Parse(r),c=0;switch(h){case"center":c=me.ENUM_TEXTALIGN_CENTER;break;case"right":c=me.ENUM_TEXTALIGN_RIGHT}this._fast_filltext(t,e,null,i,n,l,s,a,o,c,u)}},t.fillWords=function(t,e,i,n,r,s,a,o){if(e&&!(e.length<=0)){var h=Bt.Parse(r);this._fast_filltext(t,null,e,i,n,h,s,a,o,0,0)}},t._fast_filltext=function(t,e,i,n,r,s,a,o,h,u,l){if(void 0===l&&(l=0),!(e&&e.length<1||i&&i.length<1)){if(h<0&&(h=0),this.setFont(s),this.fontScaleX=this.fontScaleY=1,!K.isConchApp&&TextRender.scaleFontWithCtx){var c=1,_=1;if(K.isConchApp?(c=t._curMat.getScaleX(),_=t._curMat.getScaleY()):(c=t.getMatScaleX(),_=t.getMatScaleY()),c<1e-4||_<.1)return;c>1&&(this.fontScaleX=c),_>1&&(this.fontScaleY=_)}s._italic&&(t._italicDeg=13);var d=e,f=!i&&e instanceof laya.utils.WordText,p=e,m=!!i,g=f?d.pageChars:[],v=0;switch(f?(p=d._text,(v=d.width)<0&&(v=d.width=this.charRender.getWidth(this.fontStr,p))):v=p?this.charRender.getWidth(this.fontStr,p):0,u){case me.ENUM_TEXTALIGN_CENTER:n-=v/2;break;case me.ENUM_TEXTALIGN_RIGHT:n-=v}d&&g&&this.hasFreedText(g)&&(g=d.pageChars=[]);var x=null,y=(f||TextRender.forceWholeRender,this.renderPerChar=!f||TextRender.forceSplitRender||m||f&&d.splitRender);if(!g||g.length<1)if(y){var T,b=0,C=0;for(this._curStrPos=0;;){if(m){var S=i[this._curStrPos++];S?(T=S.char,b=S.x,C=S.y):T=null}else T=this.getNextChar(p);if(!T)break;if(!(x=this.getCharRenderInfo(T,s,a,o,h,!1)))break;if(x.isSpace);else{var w=g[x.tex.id];if(w)w=w.words;else{var M={texgen:x.tex.genID,tex:x.tex,words:[]};g[x.tex.id]=M,w=M.words}K.isConchApp?w.push({ri:x,x:b,y:C,w:x.bmpWidth/this.fontScaleX,h:x.bmpHeight/this.fontScaleY}):w.push({ri:x,x:b+1/this.fontScaleX,y:C,w:(x.bmpWidth-2)/this.fontScaleX,h:(x.bmpHeight-1)/this.fontScaleY}),b+=x.width}}}else{var A=TextRender.noAtlas||v*this.fontScaleX>TextRender.atlasWidth;x=this.getCharRenderInfo(p,s,a,o,h,A),K.isConchApp?g[0]={texgen:x.tex.genID,tex:x.tex,words:[{ri:x,x:0,y:0,w:x.bmpWidth/this.fontScaleX,h:x.bmpHeight/this.fontScaleY}]}:g[0]={texgen:x.tex.genID,tex:x.tex,words:[{ri:x,x:1/this.fontScaleX,y:0/this.fontScaleY,w:(x.bmpWidth-2)/this.fontScaleX,h:(x.bmpHeight-1)/this.fontScaleY}]}}this._drawResortedWords(t,n,r,g),t._italicDeg=0}},t._drawResortedWords=function(t,e,i,n){for(var r=t._charSubmitCache&&t._charSubmitCache._enbale,s=t._curMat,a=n.length,o=0;o0&&(o+="_"+n+r),e._bold&&(o+="P"),1==this.fontScaleX&&1==this.fontScaleY||(o+=(20*this.fontScaleX|0)+"_"+(20*this.fontScaleY|0));var h=0,u=this.textAtlases.length,l=null,c=null;if(!s)for(h=0;hthis.charRender.canvasWidth&&(this.charRender.canvasWidth=Math.min(2048,f+2*_)),s){d=this.charRender.getCharBmp(t,this.fontStr,r,i,n,l,_,_,_,_,null);var p=ti.getTextTexture(d.width,d.height);p.addChar(d,0,0,l.uv),l.tex=p,l.orix=_,l.oriy=_,p.ri=l,this.isoTextures.push(p)}else{var m=t.length,g=1*r,v=Math.ceil((this.fontSizeW+2*g)*this.fontScaleX),x=Math.ceil((this.fontSizeH+2*g)*this.fontScaleY);TextRender.imgdtRect[0]=(_-this.fontSizeOffX-g)*this.fontScaleX|0,TextRender.imgdtRect[1]=(_-this.fontSizeOffY-g)*this.fontScaleY|0,this.renderPerChar||1==m?(TextRender.imgdtRect[2]=Math.max(f,v),TextRender.imgdtRect[3]=Math.max(f,x)):(TextRender.imgdtRect[2]=-1,TextRender.imgdtRect[3]=x),d=this.charRender.getCharBmp(t,this.fontStr,r,i,n,l,_,_,_,_,TextRender.imgdtRect),c=this.addBmpData(d,l),TextRender.isWan1Wan?(l.orix=_,l.oriy=_):(l.orix=this.fontSizeOffX+g,l.oriy=this.fontSizeOffY+g),c.charMaps[o]=l}return l},t.addBmpData=function(t,e){for(var i=t.width,n=t.height,r=this.textAtlases.length,s=null,a=!1,o=0;oi&&(TextRender.showLog&&console.log(h.texture.id),h.destroy(),this.textAtlases[t]=this.textAtlases[e-1],e--,t--,s=-1)}for(this.textAtlases.length=e,e=this.isoTextures.length,t=0;tTextRender.destroyUnusedTextureDt&&(o.ri.deleted=!0,o.ri.tex=null,o.destroy(),this.isoTextures[t]=this.isoTextures[e-1],e--,t--);this.isoTextures.length=e;var l=this.textAtlases.length>1&&this.textAtlases.length-n>=2;(TextRender.atlasWidth*TextRender.atlasWidth*4*this.textAtlases.length>TextRender.cleanMem||l||TextRender.simClean)&&(TextRender.simClean=!1,TextRender.showLog&&console.log("清理使用率低的贴图。总使用率:",n,":",this.textAtlases.length,"最差贴图:"+s),s>=0&&((h=this.textAtlases[s]).destroy(),this.textAtlases[s]=this.textAtlases[this.textAtlases.length-1],this.textAtlases.length=this.textAtlases.length-1)),ti.clean()},t.cleanAtlases=function(){},t.getCharBmp=function(t){},t.checkBmpLine=function(t,e,i,n){this.bmpData32.buffer!=t.data.buffer&&(this.bmpData32=new Uint32Array(t.data.buffer));for(var r=t.width*e+i,s=i;s=a){e[1]=h;break}this.checkBmpLine(t,h,0,n)?a=h:o=h}if(e[3]>r)e[3]=r;else if(h=a=e[3],o=r,this.checkBmpLine(t,a,0,n))for(;;){if((h=(a+o)/2|0)-1<=a){e[3]=h;break}this.checkBmpLine(t,h,0,n)?a=h:o=h}if(!i){var u=e[0],l=n*e[1];for(h=e[1];h>24,n=e>>16&255,r=e>>8&255,s=255&e;console.log(" "+t," off:",i,n," size:",r,s)}var a=0;console.log("缓存数据:");var o=0,h=0;this.textAtlases.forEach(function(t){var e=t.texture.id,i=kt.loopCount-t.texture.lastTouchTm,n=i>0?i+"帧以前":"当前帧";for(var r in o+=t.texture.curUsedCovRate,h+=t.texture.curUsedCovRateAtlas,console.log("--图集(id:"+e+",当前使用率:"+(1e3*t.texture.curUsedCovRate|0)+"‰","当前图集使用率:",(100*t.texture.curUsedCovRateAtlas|0)+"%","图集使用率:",100*t.usedRate|0,"%, 使用于:"+n+")--:"),t.charMaps){var s=t.charMaps[r];console.log(" off:",s.orix,s.oriy," bmp宽高:",s.bmpWidth,s.bmpHeight,"无效:",s.deleted,"touchdt:",kt.loopCount-s.touchTick,"位置:",s.uv[0]*TextRender.atlasWidth|0,s.uv[1]*TextRender.atlasWidth|0,"字符:",s.char,"key:",r),a++}}),console.log("独立贴图文字("+this.isoTextures.length+"个):"),this.isoTextures.forEach(function(t){console.log(" size:",t._texW,t._texH,"touch间隔:",kt.loopCount-t.lastTouchTm,"char:",t.ri.char)}),console.log("总缓存:",a,"总使用率:",o,"总当前图集使用率:",h)},t.showAtlas=function(t,e,n,r,s,a){if(!this.textAtlases[t])return console.log("没有这个图集"),null;var o=new je,h=this.textAtlases[t].texture,u={width:TextRender.atlasWidth,height:TextRender.atlasWidth,sourceWidth:TextRender.atlasWidth,sourceHeight:TextRender.atlasWidth,offsetX:0,offsetY:0,getIsReady:function(){return!0},_addReference:function(){},_removeReference:function(){},_getSource:function(){return h._getSource()},bitmap:{id:h.id},_uv:Fe.DEF_UV};return o.size=function(t,i){return this.width=t,this.height=i,o.graphics.clear(),o.graphics.drawRect(0,0,o.width,o.height,e),o.graphics.drawTexture(u,0,0,o.width,o.height),this},o.graphics.drawRect(0,0,s,a,e),o.graphics.drawTexture(u,0,0,s,a),o.pos(n,r),i.stage.addChild(o),o},t.filltext_native=function(t,e,i,n,r,s,a,o,h,u,l){if(void 0===l&&(l=0),!(e&&e.length<=0||i&&i.length<1)){var c=Bt.Parse(s),_=0;switch(u){case"center":_=me.ENUM_TEXTALIGN_CENTER;break;case"right":_=me.ENUM_TEXTALIGN_RIGHT}return this._fast_filltext(t,e,i,n,r,c,a,o,h,_,l)}},TextRender.useOldCharBook=!1,TextRender.atlasWidth=2048,TextRender.noAtlas=!1,TextRender.forceSplitRender=!1,TextRender.forceWholeRender=!1,TextRender.scaleFontWithCtx=!0,TextRender.standardFontSize=32,TextRender.destroyAtlasDt=10,TextRender.checkCleanTextureDt=2e3,TextRender.destroyUnusedTextureDt=3e3,TextRender.cleanMem=104857600,TextRender.isWan1Wan=!1,TextRender.showLog=!1,TextRender.debugUV=!1,TextRender.atlasWidth2=4194304,TextRender.textRenderInst=null,TextRender.simClean=!1,n(TextRender,["tmpRI",function(){return this.tmpRI=new J},"pixelBBX",function(){return this.pixelBBX=[0,0,0,0]},"imgdtRect",function(){return this.imgdtRect=[0,0,0,0]}]),TextRender}(),I=function(){function PerfData(t,e,i,n){this.id=0,this.name=null,this.color=0,this.scale=1,this.datapos=0,this.datas=new Array(si.DATANUM),this.id=t,this.color=e,this.name=i,this.scale=n}return r(PerfData,"laya.utils.PerfData"),PerfData.prototype.addData=function(t){this.datas[this.datapos]=t,this.datapos++,this.datapos%=si.DATANUM},PerfData}(),P=function(){function KeyBoardManager(){}return r(KeyBoardManager,"laya.events.KeyBoardManager"),KeyBoardManager.__init__=function(){KeyBoardManager._addEvent("keydown"),KeyBoardManager._addEvent("keypress"),KeyBoardManager._addEvent("keyup")},KeyBoardManager._addEvent=function(t){Y.document.addEventListener(t,function(e){laya.events.KeyBoardManager._dispatch(e,t)},!0)},KeyBoardManager._dispatch=function(t,e){if(KeyBoardManager.enabled){KeyBoardManager._event._stoped=!1,KeyBoardManager._event.nativeEvent=t,KeyBoardManager._event.keyCode=t.keyCode||t.which||t.charCode,"keydown"===e?KeyBoardManager._pressKeys[KeyBoardManager._event.keyCode]=!0:"keyup"===e&&(KeyBoardManager._pressKeys[KeyBoardManager._event.keyCode]=null);for(var n=i.stage.focus&&null!=i.stage.focus.event&&i.stage.focus.displayedInStage?i.stage.focus:i.stage,r=n;r;)r.event(e,KeyBoardManager._event.setTo(e,r,n)),r=r.parent}},KeyBoardManager.hasKeyDown=function(t){return KeyBoardManager._pressKeys[t]},KeyBoardManager._pressKeys={},KeyBoardManager.enabled=!0,n(KeyBoardManager,["_event",function(){return this._event=new ue}]),KeyBoardManager}(),B=(function(){function DrawCanvasCmd(){this._graphicsCmdEncoder=null,this._index=0,this._paramData=null,this.texture=null,this.x=NaN,this.y=NaN,this.width=NaN,this.height=NaN}r(DrawCanvasCmd,"laya.display.cmd.DrawCanvasCmd");var t=DrawCanvasCmd.prototype;t.recover=function(){this._graphicsCmdEncoder=null,re.recover("DrawCanvasCmd",this)},s(0,t,"cmdID",function(){return"DrawCanvasCmd"}),DrawCanvasCmd.create=function(t,e,i,n,r){return null},DrawCanvasCmd.ID="DrawCanvasCmd",DrawCanvasCmd._DRAW_IMAGE_CMD_ENCODER_=null,DrawCanvasCmd._PARAM_TEXTURE_POS_=2,DrawCanvasCmd._PARAM_VB_POS_=5}(),function(){function Earcut(){}return r(Earcut,"laya.webgl.shapes.Earcut"),Earcut.earcut=function(t,e,i){i=i||2;var n,r,s,a,o,h,u,l=e&&e.length,c=l?e[0]*i:t.length,_=Earcut.linkedList(t,0,c,i,!0),d=[];if(!_)return d;if(l&&(_=Earcut.eliminateHoles(t,e,_,i)),t.length>80*i){n=s=t[0],r=a=t[1];for(var f=i;fs&&(s=o),h>a&&(a=h);u=0!==(u=Math.max(s-n,a-r))?1/u:0}return Earcut.earcutLinked(_,d,i,n,r,u),d},Earcut.linkedList=function(t,e,i,n,r){var s,a;if(r===Earcut.signedArea(t,e,i,n)>0)for(s=e;s=e;s-=n)a=Earcut.insertNode(s,t[s],t[s+1],a);return a&&Earcut.equals(a,a.next)&&(Earcut.removeNode(a),a=a.next),a},Earcut.filterPoints=function(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Earcut.equals(n,n.next)&&0!==Earcut.area(n.prev,n,n.next))n=n.next;else{if(Earcut.removeNode(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e},Earcut.earcutLinked=function(t,e,i,n,r,s,a){if(t){!a&&s&&Earcut.indexCurve(t,n,r,s);for(var o,h,u=t;t.prev!==t.next;)if(o=t.prev,h=t.next,s?Earcut.isEarHashed(t,n,r,s):Earcut.isEar(t))e.push(o.i/i),e.push(t.i/i),e.push(h.i/i),Earcut.removeNode(t),t=h.next,u=h.next;else if((t=h)===u){a?1===a?(t=Earcut.cureLocalIntersections(t,e,i),Earcut.earcutLinked(t,e,i,n,r,s,2)):2===a&&Earcut.splitEarcut(t,e,i,n,r,s):Earcut.earcutLinked(Earcut.filterPoints(t,null),e,i,n,r,s,1);break}}},Earcut.isEar=function(t){var e=t.prev,i=t,n=t.next;if(Earcut.area(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Earcut.pointInTriangle(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Earcut.area(r.prev,r,r.next)>=0)return!1;r=r.next}return!0},Earcut.isEarHashed=function(t,e,i,n){var r=t.prev,s=t,a=t.next;if(Earcut.area(r,s,a)>=0)return!1;for(var o=r.xs.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,l=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,c=Earcut.zOrder(o,h,e,i,n),_=Earcut.zOrder(u,l,e,i,n),d=t.nextZ;d&&d.z<=_;){if(d!==t.prev&&d!==t.next&&Earcut.pointInTriangle(r.x,r.y,s.x,s.y,a.x,a.y,d.x,d.y)&&Earcut.area(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&Earcut.pointInTriangle(r.x,r.y,s.x,s.y,a.x,a.y,d.x,d.y)&&Earcut.area(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0},Earcut.cureLocalIntersections=function(t,e,i){var n=t;do{var r=n.prev,s=n.next.next;!Earcut.equals(r,s)&&Earcut.intersects(r,n,n.next,s)&&Earcut.locallyInside(r,s)&&Earcut.locallyInside(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),Earcut.removeNode(n),Earcut.removeNode(n.next),n=t=s),n=n.next}while(n!==t);return n},Earcut.splitEarcut=function(t,e,i,n,r,s){var a=t;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&Earcut.isValidDiagonal(a,o)){var h=Earcut.splitPolygon(a,o);return a=Earcut.filterPoints(a,a.next),h=Earcut.filterPoints(h,h.next),Earcut.earcutLinked(a,e,i,n,r,s),void Earcut.earcutLinked(h,e,i,n,r,s)}o=o.next}a=a.next}while(a!==t)},Earcut.eliminateHoles=function(t,e,i,n){var r,s,a,o,h,u=[];for(r=0,s=e.length;r=n.next.y&&n.next.y!==n.y){var o=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=r&&o>a){if(a=o,o===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x=n.x&&n.x>=l&&r!==n.x&&Earcut.pointInTriangle(si.x)&&Earcut.locallyInside(n,t)&&(i=n,_=h),n=n.next;return i},Earcut.indexCurve=function(t,e,i,n){var r=t;do{null===r.z&&(r.z=Earcut.zOrder(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Earcut.sortLinked(r)},Earcut.sortLinked=function(t){var e,i,n,r,s,a,o,h,u=1;do{for(i=t,t=null,s=null,a=0;i;){for(a++,n=i,o=0,e=0;e0||h>0&&n;)0!==o&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,o--):(r=n,n=n.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,u*=2}while(a>1);return t},Earcut.zOrder=function(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1},Earcut.getLeftmost=function(t){var e=t,i=t;do{e.x=0&&(t-a)*(n-o)-(i-a)*(e-o)>=0&&(i-a)*(s-o)-(r-a)*(n-o)>=0},Earcut.isValidDiagonal=function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Earcut.intersectsPolygon(t,e)&&Earcut.locallyInside(t,e)&&Earcut.locallyInside(e,t)&&Earcut.middleInside(t,e)},Earcut.area=function(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)},Earcut.equals=function(t,e){return t.x===e.x&&t.y===e.y},Earcut.intersects=function(t,e,i,n){return!!(Earcut.equals(t,e)&&Earcut.equals(i,n)||Earcut.equals(t,n)&&Earcut.equals(i,e))||Earcut.area(t,e,i)>0!=Earcut.area(t,e,n)>0&&Earcut.area(i,n,t)>0!=Earcut.area(i,n,e)>0},Earcut.intersectsPolygon=function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Earcut.intersects(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1},Earcut.locallyInside=function(t,e){return Earcut.area(t.prev,t,t.next)<0?Earcut.area(t,e,t.next)>=0&&Earcut.area(t,t.prev,e)>=0:Earcut.area(t,e,t.prev)<0||Earcut.area(t,t.next,e)<0},Earcut.middleInside=function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n},Earcut.splitPolygon=function(t,e){var i=new fe(t.i,t.x,t.y),n=new fe(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n},Earcut.insertNode=function(t,e,i,n){var r=new fe(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r},Earcut.removeNode=function(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)},Earcut.signedArea=function(t,e,i,n){for(var r=0,s=e,a=i-n;s-1;i--)if(this._isTextCmd(e[i]))return e[i].text=t,!0}else if(this._one&&this._isTextCmd(this._one))return this._one.text=t,!0;return!1},t._isTextCmd=function(t){var e=t.cmdID;return"FillText"==e||"StrokeText"==e||"FillBorderText"==e},t.replaceTextColor=function(t){this._repaint();var e=this._cmds;if(e)for(var i=e.length-1;i>-1;i--)this._isTextCmd(e[i])&&this._setTextCmdColor(e[i],t);else this._one&&this._isTextCmd(this._one)&&this._setTextCmdColor(this._one,t)},t._setTextCmdColor=function(t,e){switch(t.cmdID){case"FillText":case"StrokeText":t.color=e;break;case"FillBorderText":case"FillBorderWords":case"FillBorderText":t.fillColor=e}},t.loadImage=function(t,e,i,n,r,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0);var a=Ce.getRes(t);a?a.getIsReady()?this.drawImage(a,e,i,n,r):a.once("ready",this,this.drawImage,[a,e,i,n,r]):((a=new Fe).load(t),Ce.cacheRes(t,a),a.once("ready",this,this.drawImage,[a,e,i,n,r])),null!=s&&(a.getIsReady()?s.call(this._sp):a.on("ready",this._sp,s))},t._renderEmpty=function(t,e,i,n){},t._renderAll=function(t,e,i,n){for(var r=this._cmds,s=0,a=r.length;s=1&&s?a/2:0,h=s?a:0;return this._saveToCmd(K._context.drawRect,de.create.call(this,t+o,e+o,i-h,n-h,r,s,a))},t.drawCircle=function(t,e,i,n,r,s){void 0===s&&(s=1);var a=s>=1&&r?s/2:0;return this._saveToCmd(K._context._drawCircle,Z.create.call(this,t,e,i-a,n,r,s,0))},t.drawPie=function(t,e,i,n,r,s,a,o){void 0===o&&(o=1);var h=o>=1&&a?o/2:0,u=a?o:0;return this._saveToCmd(K._context._drawPie,Yt.create.call(this,t+h,e+h,i-u,St.toRadian(n),St.toRadian(r),s,a,o,0))},t.drawPoly=function(t,e,i,n,r,s){void 0===s&&(s=1);var a=!1;a=!(i.length>6);var o=s>=1&&r?s%2==0?0:.5:0;return this._saveToCmd(K._context._drawPoly,ee.create.call(this,t+o,e+o,i,n,r,s,a,0))},t.drawPath=function(t,e,i,n,r){return this._saveToCmd(K._context._drawPath,R.create.call(this,t,e,i,n,r))},t.draw9Grid=function(t,e,i,n,r,s){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),this._saveToCmd(null,ve.create(t,e,i,n,r,s))},s(0,t,"cmds",function(){return this._cmds},function(t){this._sp&&(this._sp._renderType|=512,this._sp._setRenderType(this._sp._renderType)),this._cmds=t,this._render=this._renderAll,this._repaint()}),Graphics}(),V=function(){function Submit(t){this.clipInfoID=-1,this._mesh=null,this._blendFn=null,this._id=0,this._renderType=0,this._parent=null,this._startIdx=0,this._numEle=0,this._ref=1,this.shaderValue=null,this._key=new _e,void 0===t&&(t=1e4),this._renderType=t,this._id=++Submit.ID}r(Submit,"laya.webgl.submit.Submit");var t=Submit.prototype;return i.imps(t,{"laya.webgl.submit.ISubmit":!0}),t.getID=function(){return this._id},t.releaseRender=function(){Submit.RENDERBASE!=this&&--this._ref<1&&(Submit.POOL[Submit._poolSize++]=this,this.shaderValue.release(),this.shaderValue=null,this._mesh=null,this._parent&&(this._parent.releaseRender(),this._parent=null))},t.getRenderType=function(){return this._renderType},t.renderSubmit=function(){if(0===this._numEle||!this._mesh||0==this._numEle)return 1;var t=this.shaderValue.textureHost;if(t){var e=t._getSource();if(!e)return 1;this.shaderValue.texture=e}var i=j.mainContext;return this._mesh.useMesh(i),this.shaderValue.upload(),Lt.activeBlendFunction!==this._blendFn&&(jt.setBlend(i,!0),this._blendFn(i),Lt.activeBlendFunction=this._blendFn),i.drawElements(4,this._numEle,5123,this._startIdx),kt.renderBatches++,kt.trianglesFaces+=this._numEle/3,1},t._cloneInit=function(t,e,i,n){t._ref=1,t._mesh=i,t._id=this._id,t._key.copyFrom(this._key),t._parent=this,t._blendFn=this._blendFn,t._renderType=this._renderType,t._startIdx=n*ft.BYTES_PIDX,t._numEle=this._numEle,t.shaderValue=this.shaderValue,this.shaderValue.ref++,this._ref++},t.clone=function(t,e,i){return null},t.reUse=function(t,e){return 0},t.toString=function(){return"ibindex:"+this._startIdx+" num:"+this._numEle+" key="+this._key},Submit.__init__=function(){var t=Submit.RENDERBASE=new Submit(-1);t.shaderValue=new st(0,0),t.shaderValue.ALPHA=1,t._ref=4294967295},Submit.create=function(t,e,i){var n=Submit._poolSize?Submit.POOL[--Submit._poolSize]:new Submit;n._ref=1,n._mesh=e,n._key.clear(),n._startIdx=e.indexNum*ft.BYTES_PIDX,n._numEle=0;var r=t._nBlendType;n._blendFn=t._targets?Lt.targetFns[r]:Lt.fns[r],n.shaderValue=i,n.shaderValue.setValue(t._shader2D);var s=t._shader2D.filters;return s&&n.shaderValue.setFilters(s),n},Submit.createShape=function(t,e,i,n){var r=Submit._poolSize?Submit.POOL[--Submit._poolSize]:new Submit;r._mesh=e,r._numEle=i,r._startIdx=2*e.indexNum,r._ref=1,r.shaderValue=n,r.shaderValue.setValue(t._shader2D);var s=t._nBlendType;return r._key.blendShader=s,r._blendFn=t._targets?Lt.targetFns[s]:Lt.fns[s],r},Submit.TYPE_2D=1e4,Submit.TYPE_CANVAS=10003,Submit.TYPE_CMDSETRT=10004,Submit.TYPE_CUSTOM=10005,Submit.TYPE_BLURRT=10006,Submit.TYPE_CMDDESTORYPRERT=10007,Submit.TYPE_DISABLESTENCIL=10008,Submit.TYPE_OTHERIBVB=10009,Submit.TYPE_PRIMITIVE=10010,Submit.TYPE_RT=10011,Submit.TYPE_BLUR_RT=10012,Submit.TYPE_TARGET=10013,Submit.TYPE_CHANGE_VALUE=10014,Submit.TYPE_SHAPE=10015,Submit.TYPE_TEXTURE=10016,Submit.TYPE_FILLTEXTURE=10017,Submit.KEY_ONCE=-1,Submit.KEY_FILLRECT=1,Submit.KEY_DRAWTEXTURE=2,Submit.KEY_VG=3,Submit.KEY_TRIANGLES=4,Submit.RENDERBASE=null,Submit.ID=1,Submit.preRender=null,Submit._poolSize=0,Submit.POOL=[],Submit}(),H=function(){function FillTextureCmd(){}r(FillTextureCmd,"laya.display.cmd.FillTextureCmd");var t=FillTextureCmd.prototype;return t.recover=function(){this.texture=null,this.offset=null,this.other=null,re.recover("FillTextureCmd",this)},t.run=function(t,e,i){t.fillTexture(this.texture,this.x+e,this.y+i,this.width,this.height,this.type,this.offset,this.other)},s(0,t,"cmdID",function(){return"FillTexture"}),FillTextureCmd.create=function(t,e,i,n,r,s,a,o){var h=re.getItemByClass("FillTextureCmd",FillTextureCmd);return h.texture=t,h.x=e,h.y=i,h.width=n,h.height=r,h.type=s,h.offset=a,h.other=o,h},FillTextureCmd.ID="FillTexture",FillTextureCmd}(),X=(function(){function KeyLocation(){}r(KeyLocation,"laya.events.KeyLocation"),KeyLocation.STANDARD=0,KeyLocation.LEFT=1,KeyLocation.RIGHT=2,KeyLocation.NUM_PAD=3}(),function(){function LayaGL(){}r(LayaGL,"laya.layagl.LayaGL");var t=LayaGL.prototype;return t.createCommandEncoder=function(t,e,i){return void 0===t&&(t=128),void 0===e&&(e=64),void 0===i&&(i=!1),new It(this,t,e,i)},t.beginCommandEncoding=function(t){},t.endCommandEncoding=function(){},t.matrix4x4Multiply=function(t,e,i){},t.evaluateClipDatasRealTime=function(t,e,i,n){},LayaGL.getFrameCount=function(){return 0},LayaGL.syncBufferToRenderThread=function(t,e){void 0===e&&(e=0)},LayaGL.createArrayBufferRef=function(t,e,i){},LayaGL.createArrayBufferRefs=function(t,e,i,n){},LayaGL.EXECUTE_JS_THREAD_BUFFER=0,LayaGL.EXECUTE_RENDER_THREAD_BUFFER=1,LayaGL.EXECUTE_COPY_TO_RENDER=2,LayaGL.EXECUTE_COPY_TO_RENDER3D=3,LayaGL.ARRAY_BUFFER_TYPE_DATA=0,LayaGL.ARRAY_BUFFER_TYPE_CMD=1,LayaGL.ARRAY_BUFFER_REF_REFERENCE=0,LayaGL.ARRAY_BUFFER_REF_COPY=1,LayaGL.UPLOAD_SHADER_UNIFORM_TYPE_ID=0,LayaGL.UPLOAD_SHADER_UNIFORM_TYPE_DATA=1,LayaGL.instance=null,LayaGL}()),Y=function(){function Browser(){}return r(Browser,"laya.utils.Browser"),s(1,Browser,"pixelRatio",function(){if(Browser._pixelRatio<0)if(Browser.__init__(),Browser.userAgent.indexOf("Mozilla/6.0(Linux; Android 6.0; HUAWEI NXT-AL10 Build/HUAWEINXT-AL10)")>-1)Browser._pixelRatio=2;else{var t=Browser.context,e=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;Browser._pixelRatio=(Browser._window.devicePixelRatio||1)/e,Browser._pixelRatio<1&&(Browser._pixelRatio=1)}return Browser._pixelRatio}),s(1,Browser,"height",function(){return Browser.__init__(),(i.stage&&i.stage.canvasRotation?Browser.clientWidth:Browser.clientHeight)*Browser.pixelRatio}),s(1,Browser,"clientWidth",function(){return Browser.__init__(),Browser._window.innerWidth||Browser._document.body.clientWidth}),s(1,Browser,"window",function(){return Browser._window||Browser.__init__()}),s(1,Browser,"clientHeight",function(){return Browser.__init__(),Browser._window.innerHeight||Browser._document.body.clientHeight||Browser._document.documentElement.clientHeight}),s(1,Browser,"width",function(){return Browser.__init__(),(i.stage&&i.stage.canvasRotation?Browser.clientHeight:Browser.clientWidth)*Browser.pixelRatio}),s(1,Browser,"container",function(){return Browser._container||(Browser.__init__(),Browser._container=Browser.createElement("div"),Browser._container.id="layaContainer",Browser._document.body.appendChild(Browser._container)),Browser._container},function(t){Browser._container=t}),s(1,Browser,"document",function(){return Browser.__init__(),Browser._document}),Browser.__init__=function(){if(Browser._window)return Browser._window;var e=Browser._window=t,n=Browser._document=e.document,r=Browser.userAgent=e.navigator.userAgent,s=e._layalibs;if(s){s.sort(function(t,e){return t.i-e.i});for(var a=0;a-1&&Browser.window.hasOwnProperty("wx")&&(laya.utils.Browser.window.hasOwnProperty("bl")?i.BLMiniAdapter?i.BLMiniAdapter.enable():console.error("请先添加小游戏适配库,详细教程:https://ldc2.layabox.com/doc/?nav=zh-ts-5-0-0"):laya.utils.Browser.window.hasOwnProperty("qq")?i.QQMiniAdapter?i.QQMiniAdapter.enable():console.error("请先添加小游戏适配库,详细教程:https://ldc2.layabox.com/doc/?nav=zh-ts-5-0-0"):i.MiniAdpter?i.MiniAdpter.enable():console.error("请先添加小游戏适配库,详细教程:https://ldc2.layabox.com/doc/?nav=zh-ts-5-0-0")),r.indexOf("SwanGame")>-1&&(i.BMiniAdapter?i.BMiniAdapter.enable():console.error("请先添加百度小游戏适配库,详细教程:https://ldc2.layabox.com/doc/?nav=zh-ts-5-0-0")),"function"==typeof getApp&&(i.KGMiniAdapter?i.KGMiniAdapter.enable():console.error("请先添加小米小游戏适配库,详细教程:https://ldc2.layabox.com/doc/?nav=zh-ts-5-0-0")),r.indexOf("OPPO")>-1&&r.indexOf("MiniGame")>-1&&(i.QGMiniAdapter?i.QGMiniAdapter.enable():console.error("请先添加OPPO小游戏适配库")),r.indexOf("VVGame")>-1&&(i.VVMiniAdapter?i.VVMiniAdapter.enable():console.error("请先添加VIVO小游戏适配库")),r.indexOf("AlipayMiniGame")>-1&&(i.ALIMiniAdapter?i.ALIMiniAdapter.enable():console.error("请先添加VIVO小游戏适配库")),e.trace=console.log,e.requestAnimationFrame=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){return e.setTimeout(t,1e3/60)};var o=n.body.style;o.margin=0,o.overflow="hidden",o["-webkit-user-select"]="none",o["-webkit-tap-highlight-color"]="rgba(200,200,200,0)";for(var h=n.getElementsByTagName("meta"),u=0,l=!1,c="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no";u-1,Browser.onIOS=!!r.match(/\(i[^;]+;(U;)? CPU.+Mac OS X/),Browser.onIPhone=r.indexOf("iPhone")>-1,Browser.onMac=r.indexOf("Mac OS X")>-1,Browser.onIPad=r.indexOf("iPad")>-1,Browser.onAndroid=r.indexOf("Android")>-1||r.indexOf("Adr")>-1,Browser.onWP=r.indexOf("Windows Phone")>-1,Browser.onQQBrowser=r.indexOf("QQBrowser")>-1,Browser.onMQQBrowser=r.indexOf("MQQBrowser")>-1||r.indexOf("Mobile")>-1&&r.indexOf("QQ")>-1,Browser.onIE=!!e.ActiveXObject||"ActiveXObject"in e,Browser.onWeiXin=r.indexOf("MicroMessenger")>-1,Browser.onSafari=r.indexOf("Safari")>-1,Browser.onPC=!Browser.onMobile,Browser.onMiniGame=r.indexOf("MiniGame")>-1,Browser.onBDMiniGame=r.indexOf("SwanGame")>-1,r.indexOf("OPPO")>-1&&r.indexOf("MiniGame")>-1?(Browser.onQGMiniGame=!0,Browser.onMiniGame=!1):laya.utils.Browser.window.hasOwnProperty("bl")&&r.indexOf("MiniGame")>-1?(Browser.onBLMiniGame=!0,Browser.onMiniGame=!1):laya.utils.Browser.window.hasOwnProperty("qq")&&r.indexOf("MiniGame")>-1&&(Browser.onQQMiniGame=!0,Browser.onMiniGame=!1),Browser.onVVMiniGame=r.indexOf("VVGame")>-1,Browser.onLimixiu=r.indexOf("limixiu")>-1,Browser.onKGMiniGame=r.indexOf("QuickGame")>-1,r.indexOf("AlipayMiniGame")>-1&&(Browser.onAlipayMiniGame=!0,Browser.onMiniGame=!1),Browser.supportLocalStorage=m.__init__(),Browser.supportWebAudio=rt.__init__(),K._mainCanvas=new hi(!0);var d=K._mainCanvas.source.style;d.position="absolute",d.top=d.left="0px",d.background="#000000",Browser.canvas=new hi(!0),Browser.context=Browser.canvas.getContext("2d");var f=new hi(!0);(laya.utils.Browser.onQGMiniGame||laya.utils.Browser.onVVMiniGame)&&(f=K._mainCanvas);var p=["webgl","experimental-webgl","webkit-3d","moz-webgl"],g=null;for(u=0;u0?a.offsetX:0,p=a.offsetY>0?a.offsetY:0;f*=l,p*=c,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x-f,s.y-p,_,d),r)}break;case"FillTexture":s.width&&s.height?GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x,s.y,s.width,s.height),r):(a=s.texture,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x,s.y,a.width,a.height),r));break;case"DrawTexture":var m;s.matrix?(r.copyTo(o),o.concat(s.matrix),m=o):m=r,t?s.width&&s.height?GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x,s.y,s.width,s.height),m):(a=s.texture,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x,s.y,a.width,a.height),m)):(a=s.texture,l=(s.width||a.sourceWidth)/a.width,c=(s.height||a.sourceHeight)/a.height,_=l*a.sourceWidth,d=c*a.sourceHeight,f=a.offsetX>0?a.offsetX:0,p=a.offsetY>0?a.offsetY:0,f*=l,p*=c,GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x-f,s.y-p,_,d),m));break;case"DrawRect":GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x,s.y,s.width,s.height),r);break;case"DrawCircle":GraphicsBounds._addPointArrToRst(e,mt._getBoundPointS(s.x-s.radius,s.y-s.radius,s.radius+s.radius,s.radius+s.radius),r);break;case"DrawLine":GraphicsBounds._tempPoints.length=0;var g;g=.5*s.lineWidth,s.fromX==s.toX?GraphicsBounds._tempPoints.push(s.fromX+g,s.fromY,s.toX+g,s.toY,s.fromX-g,s.fromY,s.toX-g,s.toY):s.fromY==s.toY?GraphicsBounds._tempPoints.push(s.fromX,s.fromY+g,s.toX,s.toY+g,s.fromX,s.fromY-g,s.toX,s.toY-g):GraphicsBounds._tempPoints.push(s.fromX,s.fromY,s.toX,s.toY),GraphicsBounds._addPointArrToRst(e,GraphicsBounds._tempPoints,r);break;case"DrawCurves":GraphicsBounds._addPointArrToRst(e,ht.I.getBezierPoints(s.points),r,s.x,s.y);break;case"DrawLines":case"DrawPoly":GraphicsBounds._addPointArrToRst(e,s.points,r,s.x,s.y);break;case"DrawPath":GraphicsBounds._addPointArrToRst(e,this._getPathPoints(s.paths),r,s.x,s.y);break;case"DrawPie":GraphicsBounds._addPointArrToRst(e,this._getPiePoints(s.x,s.y,s.radius,s.startAngle,s.endAngle),r)}return e.length>200?e=St.copyArray(e,mt._getWrapRec(e)._getBoundPoints()):e.length>8&&(e=$t.scanPList(e)),e},t._switchMatrix=function(t,e){e.concat(t),e.copyTo(t)},t._getPiePoints=function(t,e,i,n,r){var s=GraphicsBounds._tempPoints;GraphicsBounds._tempPoints.length=0;var a=Math.PI/180,o=r-n;if(o>=360||o<=-360)return s.push(t-i,e-i),s.push(t+i,e-i),s.push(t+i,e+i),s.push(t-i,e+i),s;s.push(t,e);var h=o%360;h<0&&(h+=360);var u=n+h,l=n*a,c=u*a;s.push(t+i*Math.cos(l),e+i*Math.sin(l)),s.push(t+i*Math.cos(c),e+i*Math.sin(c));for(var _=90*Math.ceil(n/90),d=90*Math.floor(u/90),f=_;f<=d;f+=90){var p=f*a;s.push(t+i*Math.cos(p),e+i*Math.sin(p))}return s},t._getPathPoints=function(t){var e,i,n=0,r=GraphicsBounds._tempPoints;for(r.length=0,e=t.length,n=0;n1&&(r.push(i[1],i[2]),i.length>3&&r.push(i[3],i[4]));return r},GraphicsBounds.create=function(){return re.getItemByClass("GraphicsBounds",GraphicsBounds)},GraphicsBounds._addPointArrToRst=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var s,a=0;for(s=e.length,a=0;as)for(n=a-s,e=new Uint16Array(n),r=s;r60&&(QuickTestTool.showCountInfo(),QuickTestTool._i=0)},QuickTestTool._addType=function(t){QuickTestTool._countDic[t]?QuickTestTool._countDic[t]+=1:QuickTestTool._countDic[t]=1},QuickTestTool.showCountInfo=function(){var t;for(t in console.log("==================="),QuickTestTool._countDic)console.log("count:"+QuickTestTool._countDic[t]),QuickTestTool.showRenderTypeInfo(t,!0)},QuickTestTool.enableQuickTest=function(){QuickTestTool.__init__(),je.prototype.render=QuickTestTool.prototype.render,QuickTestTool._PreStageRender=ni.prototype.render,ni.prototype.render=QuickTestTool.prototype._stageRender},QuickTestTool.showedDic={},QuickTestTool._rendertypeToStrDic={},QuickTestTool._typeToNameDic={},QuickTestTool._PreStageRender=null,QuickTestTool._countDic={},QuickTestTool._i=0}(),function(){function WebGLRTMgr(){}return r(WebGLRTMgr,"laya.resource.WebGLRTMgr"),WebGLRTMgr.getRT=function(t,e){e|=0,(t|=0)>=1e4&&console.error("getRT error! w too big");var i,n=1e4*e+t,r=WebGLRTMgr.dict[n];return r&&r.length>0?((i=r.pop())._mgrKey=n,i):((i=new ci(t,e,1,-1))._mgrKey=n,i)},WebGLRTMgr.releaseRT=function(t){if(!(t._mgrKey<=0)){var e=WebGLRTMgr.dict[t._mgrKey];!e&&(e=[],WebGLRTMgr.dict[t._mgrKey]=e),t._mgrKey=0,e.push(t)}},WebGLRTMgr.dict={},WebGLRTMgr}()),$=function(){function Byte(t){this._xd_=!0,this._allocated_=8,this._pos_=0,this._length=0,t?(this._u8d_=new Uint8Array(t),this._d_=new DataView(this._u8d_.buffer),this._length=this._d_.byteLength):this._resizeBuffer(this._allocated_)}r(Byte,"laya.utils.Byte");var t=Byte.prototype;return t._resizeBuffer=function(t){try{var e=new Uint8Array(t);null!=this._u8d_&&(this._u8d_.length<=t?e.set(this._u8d_):e.set(this._u8d_.subarray(0,t))),this._u8d_=e,this._d_=new DataView(e.buffer)}catch(e){throw"Invalid typed array length:"+t}},t.getString=function(){return this.readString()},t.readString=function(){return this._rUTF(this.getUint16())},t.getFloat32Array=function(t,e){return this.readFloat32Array(t,e)},t.readFloat32Array=function(t,e){var i=t+e;i=i>this._length?this._length:i;var n=new Float32Array(this._d_.buffer.slice(t,i));return this._pos_=i,n},t.getUint8Array=function(t,e){return this.readUint8Array(t,e)},t.readUint8Array=function(t,e){var i=t+e;i=i>this._length?this._length:i;var n=new Uint8Array(this._d_.buffer.slice(t,i));return this._pos_=i,n},t.getInt16Array=function(t,e){return this.readInt16Array(t,e)},t.readInt16Array=function(t,e){var i=t+e;i=i>this._length?this._length:i;var n=new Int16Array(this._d_.buffer.slice(t,i));return this._pos_=i,n},t.getFloat32=function(){return this.readFloat32()},t.readFloat32=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(){return this.readFloat64()},t.readFloat64=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(){return this.readInt32()},t.readInt32=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(){return this.readUint32()},t.readUint32=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(){return this.readInt16()},t.readInt16=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(){return this.readUint16()},t.readUint16=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(){return this.readUint8()},t.readUint8=function(){if(this._pos_+1>this._length)throw"getUint8 error - Out of bounds";return this._u8d_[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._readUInt8(t)},t._readUInt8=function(t){return this._d_.getUint8(t)},t._getUint16=function(t){return this._readUint16(t)},t._readUint16=function(t){return this._d_.getUint16(t,this._xd_)},t._getMatrix=function(){return this._readMatrix()},t._readMatrix=function(){return new U(this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32(),this.getFloat32())},t._rUTF=function(t){var e=this._pos_+t,i=0,n=0,r=0,s=String.fromCharCode,a=this._u8d_,o=[],h=0;for(o.length=1e3;this._pos_0;)if((n=s[this._pos_])<128)e+=r(n),this._pos_++,t--;else for(i=n-128,this._pos_++,t-=i;i>0;)n=s[this._pos_++],e+=r(s[this._pos_++]<<8|n),i--;return e},t.clear=function(){this._pos_=0,this.length=0},t.__getBuffer=function(){return this._d_.buffer},t.writeUTFBytes=function(t){for(var e=0,i=(t+="").length;e>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);var i=this.pos-e-2;this._d_.setUint16(e,i,this._xd_)},t.readUTFString=function(){return this.readUTFBytes(this.getUint16())},t.getUTFString=function(){return this.readUTFString()},t.readUTFBytes=function(t){if(void 0===t&&(t=-1),0===t)return"";var e=this.bytesAvailable;if(t>e)throw"readUTFBytes error - Out of bounds";return t=t>0?t:e,this._rUTF(t)},t.getUTFBytes=function(t){return void 0===t&&(t=-1),this.readUTFBytes(t)},t.writeByte=function(t){this._ensureWrite(this._pos_+1),this._d_.setInt8(this._pos_,t),this._pos_+=1},t.readByte=function(){if(this._pos_+1>this._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}),s(0,t,"pos",function(){return this._pos_},function(t){this._pos_=t}),s(0,t,"bytesAvailable",function(){return this._length-this._pos_}),Byte.getSystemEndian=function(){if(!Byte._sysEndian){var t=new ArrayBuffer(2);new DataView(t).setInt16(0,256,!0),Byte._sysEndian=256===new Int16Array(t)[0]?"littleEndian":"bigEndian"}return Byte._sysEndian},Byte.BIG_ENDIAN="bigEndian",Byte.LITTLE_ENDIAN="littleEndian",Byte._sysEndian=null,Byte}(),q=function(){function ShaderNode(t){this.childs=[],this.text="",this.parent=null,this.name=null,this.noCompile=!1,this.includefiles=null,this.condition=null,this.conditionType=0,this.useFuns="",this.z=0,this.src=null,this.includefiles=t}r(ShaderNode,"laya.webgl.utils.ShaderNode");var t=ShaderNode.prototype;return t.setParent=function(t){t.childs.push(this),this.z=t.z+1,this.parent=t},t.setCondition=function(t,e){t&&(this.conditionType=e,t=t.replace(/(\s*$)/g,""),this.condition=function(){return this[t]},this.condition.__condition=t)},t.toscript=function(t,e){return this._toscript(t,e,++ShaderNode.__id)},t._toscript=function(t,e,i){if(this.childs.length<1&&!this.text)return e;e.length;if(this.condition){var n=!!this.condition.call(t);if(2===this.conditionType&&(n=!n),!n)return e}if(this.text&&e.push(this.text),this.childs.length>0&&this.childs.forEach(function(n,r,s){n._toscript(t,e,i)}),this.includefiles.length>0&&this.useFuns.length>0)for(var r,s=0,a=this.includefiles.length;s0&&(this.includefiles[s].curUseID=i,e[0]=r+e[0]);return e},ShaderNode.__id=1,ShaderNode}(),Z=function(){function DrawCircleCmd(){}r(DrawCircleCmd,"laya.display.cmd.DrawCircleCmd");var t=DrawCircleCmd.prototype;return t.recover=function(){this.fillColor=null,this.lineColor=null,re.recover("DrawCircleCmd",this)},t.run=function(t,e,i){t._drawCircle(this.x+e,this.y+i,this.radius,this.fillColor,this.lineColor,this.lineWidth,this.vid)},s(0,t,"cmdID",function(){return"DrawCircle"}),DrawCircleCmd.create=function(t,e,i,n,r,s,a){var o=re.getItemByClass("DrawCircleCmd",DrawCircleCmd);return o.x=t,o.y=e,o.radius=i,o.fillColor=n,o.lineColor=r,o.lineWidth=s,o.vid=a,o},DrawCircleCmd.ID="DrawCircle",DrawCircleCmd}(),J=function(){function CharRenderInfo(){this.char="",this.tex=null,this.deleted=!1,this.pos=0,this.width=0,this.height=0,this.bmpWidth=0,this.bmpHeight=0,this.orix=0,this.oriy=0,this.touchTick=0,this.isSpace=!1,this.uv=new Array(8)}return r(CharRenderInfo,"laya.webgl.text.CharRenderInfo"),CharRenderInfo.prototype.touch=function(){var t=kt.loopCount;this.touchTick!=t&&this.tex.touchRect(this,t),this.touchTick=t},CharRenderInfo}(),tt=function(){function RenderState2D(){}return r(RenderState2D,"laya.webgl.utils.RenderState2D"),RenderState2D.mat2MatArray=function(t,e){var i=t,n=e;return n[0]=i.a,n[1]=i.b,n[2]=RenderState2D.EMPTYMAT4_ARRAY[2],n[3]=RenderState2D.EMPTYMAT4_ARRAY[3],n[4]=i.c,n[5]=i.d,n[6]=RenderState2D.EMPTYMAT4_ARRAY[6],n[7]=RenderState2D.EMPTYMAT4_ARRAY[7],n[8]=RenderState2D.EMPTYMAT4_ARRAY[8],n[9]=RenderState2D.EMPTYMAT4_ARRAY[9],n[10]=RenderState2D.EMPTYMAT4_ARRAY[10],n[11]=RenderState2D.EMPTYMAT4_ARRAY[11],n[12]=i.tx,n[13]=i.ty,n[14]=RenderState2D.EMPTYMAT4_ARRAY[14],n[15]=RenderState2D.EMPTYMAT4_ARRAY[15],e},RenderState2D.restoreTempArray=function(){RenderState2D.TEMPMAT4_ARRAY[0]=1,RenderState2D.TEMPMAT4_ARRAY[1]=0,RenderState2D.TEMPMAT4_ARRAY[4]=0,RenderState2D.TEMPMAT4_ARRAY[5]=1,RenderState2D.TEMPMAT4_ARRAY[12]=0,RenderState2D.TEMPMAT4_ARRAY[13]=0},RenderState2D.clear=function(){RenderState2D.worldScissorTest=!1,RenderState2D.worldAlpha=1},RenderState2D._MAXSIZE=99999999,RenderState2D.EMPTYMAT4_ARRAY=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],RenderState2D.TEMPMAT4_ARRAY=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],RenderState2D.worldMatrix4=RenderState2D.TEMPMAT4_ARRAY,RenderState2D.matWVP=null,RenderState2D.worldAlpha=1,RenderState2D.worldScissorTest=!1,RenderState2D.worldShaderDefines=null,RenderState2D.worldFilters=null,RenderState2D.width=0,RenderState2D.height=0,n(RenderState2D,["worldMatrix",function(){return this.worldMatrix=new U}]),RenderState2D}(),et=function(){function Mesh2D(t,e,i){this._stride=0,this.vertNum=0,this.indexNum=0,this._applied=!1,this._vb=null,this._ib=null,this._vao=null,this._attribInfo=null,this._quadNum=0,this.canReuse=!1,this._stride=t,this._vb=new Ze(t,35048),e?this._vb._resizeBuffer(e,!1):Rt.webGL2D_MeshAllocMaxMem&&this._vb._resizeBuffer(65536*t,!1),this._ib=new qe,i&&this._ib._resizeBuffer(i,!1)}r(Mesh2D,"laya.webgl.utils.Mesh2D");var t=Mesh2D.prototype;return t.cloneWithNewVB=function(){var t=new Mesh2D(this._stride,0,0);return t._ib=this._ib,t._quadNum=this._quadNum,t._attribInfo=this._attribInfo,t},t.cloneWithNewVBIB=function(){var t=new Mesh2D(this._stride,0,0);return t._attribInfo=this._attribInfo,t},t.getVBW=function(){return this._vb.setNeedUpload(),this._vb},t.getVBR=function(){return this._vb},t.getIBR=function(){return this._ib},t.getIBW=function(){return this._ib.setNeedUpload(),this._ib},t.createQuadIB=function(t){this._quadNum=t,this._ib._resizeBuffer(6*t*2,!1),this._ib.byteLength=this._ib.bufferLength;for(var e=this._ib.getUint16Array(),i=0,n=0,r=0;r1||Math.abs(s*i.stage._canvasTransform.getScaleY())>1))return;this._clickOnly=!1,this._offsets||(this._offsets=[]),this._offsets.length=0,this.target.event("dragstart",this.data),Et.instance.disableMouseEvent=this._disableMouseEvent}else this._offsets.push(r,s);0===r&&0===s||(this._lastX=e,this._lastY=n,this.target.x+=r*this._elasticRateX,this.target.y+=s*this._elasticRateY,this.area&&this.checkArea(),this.target.event("dragmove",this.data))},t.checkArea=function(){if(this.elasticDistance<=0)this.backToArea();else{if(this.target._xthis.area.x+this.area.width?this.target._x-this.area.x-this.area.width:0;if(this._elasticRateX=Math.max(0,1-t/this.elasticDistance),this.target._ythis.area.y+this.area.height?this.target._y-this.area.y-this.area.height:0;this._elasticRateY=Math.max(0,1-e/this.elasticDistance)}},t.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)},t.onStageMouseUp=function(t){if(Et.instance.disableMouseEvent=!1,i.stage.off("mouseup",this,this.onStageMouseUp),i.stage.off("mouseout",this,this.onStageMouseUp),i.systemTimer.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,n=Math.min(e,6),r=this._offsets.length-n,s=e-1;s>r;s--)this._offsetY+=this._offsets[s--],this._offsetX+=this._offsets[s];this._offsetX=this._offsetX/n*2,this._offsetY=this._offsetY/n*2,Math.abs(this._offsetX)>this.maxOffset&&(this._offsetX=this._offsetX>0?this.maxOffset:-this.maxOffset),Math.abs(this._offsetY)>this.maxOffset&&(this._offsetY=this._offsetY>0?this.maxOffset:-this.maxOffset),i.systemTimer.frameLoop(1,this,this.tweenMove)}else this.elasticDistance>0?this.checkElastic():this.clear()},t.checkElastic=function(){var t=NaN,e=NaN;if(this.target.xthis.area.x+this.area.width&&(t=this.area.x+this.area.width),this.target.ythis.area.y+this.area.height&&(e=this.area.y+this.area.height),isNaN(t)&&isNaN(e))this.clear();else{var i={};isNaN(t)||(i.x=t),isNaN(e)||(i.y=e),this._tween=w.to(this.target,i,this.elasticBackTime,nt.sineOut,p.create(this,this.clear),0,!1,!1)}},t.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)&&(i.systemTimer.clear(this,this.tweenMove),this.elasticDistance>0?this.checkElastic():this.clear())},t.clear=function(){if(this.target){this.clearTimer();var t=this.target;this.target=null,this._parent=null,t.event("dragend",this.data)}},Dragging}(),nt=function(){function Ease(){}return r(Ease,"laya.utils.Ease"),Ease.linearNone=function(t,e,i,n){return i*t/n+e},Ease.linearIn=function(t,e,i,n){return i*t/n+e},Ease.linearInOut=function(t,e,i,n){return i*t/n+e},Ease.linearOut=function(t,e,i,n){return i*t/n+e},Ease.bounceIn=function(t,e,i,n){return i-Ease.bounceOut(n-t,0,i,n)+e},Ease.bounceInOut=function(t,e,i,n){return t<.5*n?.5*Ease.bounceIn(2*t,0,i,n)+e:.5*Ease.bounceOut(2*t-n,0,i,n)+.5*i+e},Ease.bounceOut=function(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},Ease.backIn=function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*(t/=n)*t*((r+1)*t-r)+e},Ease.backInOut=function(t,e,i,n,r){return void 0===r&&(r=1.70158),(t/=.5*n)<1?.5*i*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},Ease.backOut=function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*((t=t/n-1)*t*((r+1)*t+r)+1)+e},Ease.elasticIn=function(t,e,i,n,r,s){var a;return void 0===r&&(r=0),void 0===s&&(s=0),0==t?e:1==(t/=n)?e+i:(s||(s=.3*n),!r||i>0&&r0&&r0&&r=0||SoundManager._channels.push(t)},SoundManager.removeChannel=function(t){var e=0;for(e=SoundManager._channels.length-1;e>=0;e--)SoundManager._channels[e]==t&&SoundManager._channels.splice(e,1)},SoundManager.disposeSoundLater=function(t){SoundManager._lastSoundUsedTimeDic[t]=Y.now(),SoundManager._isCheckingDispose||(SoundManager._isCheckingDispose=!0,i.timer.loop(5e3,null,SoundManager._checkDisposeSound))},SoundManager._checkDisposeSound=function(){var t,e=Y.now(),n=!1;for(t in SoundManager._lastSoundUsedTimeDic)e-SoundManager._lastSoundUsedTimeDic[t]>3e4?(delete SoundManager._lastSoundUsedTimeDic[t],SoundManager.disposeSoundIfNotUsed(t)):n=!0;n||(SoundManager._isCheckingDispose=!1,i.timer.clear(null,SoundManager._checkDisposeSound))},SoundManager.disposeSoundIfNotUsed=function(t){var e=0;for(e=SoundManager._channels.length-1;e>=0;e--)if(SoundManager._channels[e].url==t)return;SoundManager.destroySound(t)},SoundManager._visibilityChange=function(){i.stage.isVisibility?SoundManager._stageOnFocus():SoundManager._stageOnBlur()},SoundManager._stageOnBlur=function(){SoundManager._isActive=!1,SoundManager._musicChannel&&(SoundManager._musicChannel.isStopped||(SoundManager._blurPaused=!0,SoundManager._musicChannel.pause())),SoundManager.stopAllSound(),i.stage.once("mousedown",null,SoundManager._stageOnFocus)},SoundManager._recoverWebAudio=function(){Ge.ctx&&"running"!=Ge.ctx.state&&Ge.ctx.resume&&Ge.ctx.resume()},SoundManager._stageOnFocus=function(){SoundManager._isActive=!0,SoundManager._recoverWebAudio(),i.stage.off("mousedown",null,SoundManager._stageOnFocus),SoundManager._blurPaused&&SoundManager._musicChannel&&SoundManager._musicChannel.isStopped&&(SoundManager._blurPaused=!1,SoundManager._musicChannel.resume())},SoundManager.playSound=function(t,e,n,r,s){if(void 0===e&&(e=1),void 0===s&&(s=0),!SoundManager._isActive||!t)return null;if(SoundManager._muted)return null;if(SoundManager._recoverWebAudio(),(t=Ut.formatURL(t))==SoundManager._bgMusic){if(SoundManager._musicMuted)return null}else{if(K.isConchApp){var a=St.getFileExtension(t);if("wav"!=a&&"ogg"!=a)return alert("The sound only supports wav or ogg format,for optimal performance reason,please refer to the official website document."),null}if(SoundManager._soundMuted)return null}var o,h;return Y.onMiniGame||Y.onBLMiniGame||Y.onQQMiniGame||Y.onQGMiniGame||Y.onVVMiniGame||Y.onBDMiniGame||Y.onKGMiniGame||(o=i.loader.getRes(t)),r||(r=SoundManager._soundClass),o||((o=new r).load(t),Y.onMiniGame||Y.onBLMiniGame||Y.onQQMiniGame||Y.onQGMiniGame||Y.onVVMiniGame||Y.onBDMiniGame||Y.onKGMiniGame||Ce.cacheRes(t,o)),(h=o.play(s,e))?(h.url=t,h.volume=t==SoundManager._bgMusic?SoundManager.musicVolume:SoundManager.soundVolume,h.completeHandler=n,h):null},SoundManager.destroySound=function(t){var e=i.loader.getRes(t);e&&(Ce.clearRes(t),e.dispose())},SoundManager.playMusic=function(t,e,i,n){return void 0===e&&(e=0),void 0===n&&(n=0),t=Ut.formatURL(t),SoundManager._bgMusic=t,SoundManager._musicChannel&&SoundManager._musicChannel.stop(),SoundManager._musicChannel=SoundManager.playSound(t,e,i,SoundManager._musicClass,n)},SoundManager.stopSound=function(t){t=Ut.formatURL(t);var e,i=0;for(i=SoundManager._channels.length-1;i>=0;i--)(e=SoundManager._channels[i]).url==t&&e.stop()},SoundManager.stopAll=function(){SoundManager._bgMusic=null;var t=0;for(t=SoundManager._channels.length-1;t>=0;t--)SoundManager._channels[t].stop()},SoundManager.stopAllSound=function(){var t,e=0;for(e=SoundManager._channels.length-1;e>=0;e--)(t=SoundManager._channels[e]).url!=SoundManager._bgMusic&&t.stop()},SoundManager.stopMusic=function(){SoundManager._musicChannel&&SoundManager._musicChannel.stop(),SoundManager._bgMusic=null},SoundManager.setSoundVolume=function(t,e){if(e)e=Ut.formatURL(e),SoundManager._setVolume(e,t);else{SoundManager.soundVolume=t;var i,n=0;for(n=SoundManager._channels.length-1;n>=0;n--)(i=SoundManager._channels[n]).url!=SoundManager._bgMusic&&(i.volume=t)}},SoundManager.setMusicVolume=function(t){SoundManager.musicVolume=t,SoundManager._setVolume(SoundManager._bgMusic,t)},SoundManager._setVolume=function(t,e){t=Ut.formatURL(t);var i,n=0;for(n=SoundManager._channels.length-1;n>=0;n--)(i=SoundManager._channels[n]).url==t&&(i.volume=e)},SoundManager.musicVolume=1,SoundManager.soundVolume=1,SoundManager.playbackRate=1,SoundManager._useAudioMusic=!0,SoundManager._muted=!1,SoundManager._soundMuted=!1,SoundManager._musicMuted=!1,SoundManager._bgMusic=null,SoundManager._musicChannel=null,SoundManager._channels=[],SoundManager._autoStopMusic=!1,SoundManager._blurPaused=!1,SoundManager._isActive=!0,SoundManager._soundClass=null,SoundManager._musicClass=null,SoundManager._lastSoundUsedTimeDic={},SoundManager._isCheckingDispose=!1,SoundManager.autoReleaseSound=!0,SoundManager}(),st=(function(){function Log(){}r(Log,"laya.utils.Log"),Log.enable=function(){Log._logdiv||(Log._logdiv=Y.createElement("div"),Log._logdiv.style.cssText="border:white;padding:4px;overflow-y:auto;z-index:1000000;background:rgba(100,100,100,0.6);color:white;position: absolute;left:0px;top:0px;width:50%;height:50%;",Y.document.body.appendChild(Log._logdiv),Log._btn=Y.createElement("button"),Log._btn.innerText="Hide",Log._btn.style.cssText="z-index:1000001;position: absolute;left:10px;top:10px;",Log._btn.onclick=Log.toggle,Y.document.body.appendChild(Log._btn))},Log.toggle=function(){var t=Log._logdiv.style;""===t.display?(Log._btn.innerText="Show",t.display="none"):(Log._btn.innerText="Hide",t.display="")},Log.print=function(t){Log._logdiv&&(Log._count>=Log.maxCount&&Log.clear(),Log._count++,Log._logdiv.innerText+=t+"\n",Log.autoScrollToBottom&&Log._logdiv.scrollHeight-Log._logdiv.scrollTop-Log._logdiv.clientHeight<50&&(Log._logdiv.scrollTop=Log._logdiv.scrollHeight))},Log.clear=function(){Log._logdiv.innerText="",Log._count=0},Log._logdiv=null,Log._btn=null,Log._count=0,Log.maxCount=50,Log.autoScrollToBottom=!0}(),function(){function Value2D(t,e){this.size=[0,0],this.alpha=1,this.ALPHA=1,this.subID=0,this.ref=1,this._cacheID=0,this.clipMatDir=[99999999,0,0,99999999],this.clipMatPos=[0,0],this.clipOff=[0,0],this.defines=new Pe,this.mainID=t,this.subID=e,this.textureHost=null,this.texture=null,this.color=null,this.colorAdd=null,this.u_mmat2=null,this._cacheID=t|e,this._inClassCache=Value2D._cache[this._cacheID],t>0&&!this._inClassCache&&(this._inClassCache=Value2D._cache[this._cacheID]=[],this._inClassCache._length=0),this.clear()}r(Value2D,"laya.webgl.shader.d2.value.Value2D");var t=Value2D.prototype;return t.setValue=function(t){},t._ShaderWithCompile=function(){return ii.withCompile2D(0,this.mainID,this.defines.toNameDic(),this.mainID|this.defines._value,li.create,this._attribLocation)},t.upload=function(){var t=tt;tt.worldMatrix4===tt.TEMPMAT4_ARRAY||this.defines.addInt(128),this.mmat=t.worldMatrix4,tt.matWVP&&(this.defines.addInt(2048),this.u_MvpMatrix=tt.matWVP.elements);var e=ii.sharders[this.mainID|this.defines._value]||this._ShaderWithCompile();e._shaderValueWidth!==t.width||e._shaderValueHeight!==t.height?(this.size[0]=t.width,this.size[1]=t.height,e._shaderValueWidth=t.width,e._shaderValueHeight=t.height,e.upload(this,null)):e.upload(this,e._params2dQuick2||e._make2dQuick2())},t.setFilters=function(t){if(this.filters=t,t)for(var e,i=t.length,n=0;n0?t:5),n=0;n<=1;n+=i)this._calFun(n,e)},t.getBezierPoints=function(t,e,i){void 0===e&&(e=5),void 0===i&&(i=2);var n,r=0;if((n=t.length)<2*(i+1))return[];var s=[];switch(i){case 2:this._calFun=this.getPoint2;break;case 3:this._calFun=this.getPoint3;break;default:return[]}for(;this._controlPoints.length<=i;)this._controlPoints.push(ct.create());for(r=0;r<2*i;r+=2)this._switchPoint(t[r],t[r+1]);for(r=2*i;r0){var e=1/t;this.x*=e,this.y*=e}},t.copy=function(t){return this.setTo(t.x,t.y)},Point.create=function(){return re.getItemByClass("Point",Point)},Point.TEMP=new Point,Point.EMPTY=new Point,Point}(),_t=(function(){function HTMLChar(){this.reset()}r(HTMLChar,"laya.utils.HTMLChar");var t=HTMLChar.prototype;t.setData=function(t,e,i,n){return this.char=t,this.charNum=t.charCodeAt(0),this.x=this.y=0,this.width=e,this.height=i,this.style=n,this.isWord=!HTMLChar._isWordRegExp.test(t),this},t.reset=function(){return this.x=this.y=this.width=this.height=0,this.isWord=!1,this.char=null,this.charNum=0,this.style=null,this},t.recover=function(){re.recover("HTMLChar",this.reset())},t._isChar=function(){return!0},t._getCSSStyle=function(){return this.style},HTMLChar.create=function(){return re.getItemByClass("HTMLChar",HTMLChar)},HTMLChar._isWordRegExp=new RegExp("[\\w.]","")}(),function(){function FillTextCmd(){this._textIsWorldText=!1,this._fontColor=4294967295,this._strokeColor=0,this._nTexAlign=0,this._fontObj=FillTextCmd._defFontObj}r(FillTextCmd,"laya.display.cmd.FillTextCmd");var t=FillTextCmd.prototype;return t.recover=function(){re.recover("FillTextCmd",this)},t.run=function(t,e,n){i.stage.isGlobalRepaint()&&this._textIsWorldText&&this._text.cleanCache(),this._textIsWorldText?t._fast_filltext(this._text,this.x+e,this.y+n,this._fontObj,this._color,null,0,this._nTexAlign,0):t.drawText(this._text,this.x+e,this.y+n,this._font,this._color,this._textAlign)},s(0,t,"text",function(){return this._text},function(t){this._text=t,this._textIsWorldText=t instanceof laya.utils.WordText,this._textIsWorldText&&this._text.cleanCache()}),s(0,t,"cmdID",function(){return"FillText"}),s(0,t,"color",function(){return this._color},function(t){this._color=t,this._fontColor=o.create(t).numColor,this._textIsWorldText&&this._text.cleanCache()}),s(0,t,"font",function(){return this._font},function(t){this._font=t,this._fontObj=Bt.Parse(t),this._textIsWorldText&&this._text.cleanCache()}),s(0,t,"textAlign",function(){return this._textAlign},function(t){switch(this._textAlign=t,t){case"center":this._nTexAlign=me.ENUM_TEXTALIGN_CENTER;break;case"right":this._nTexAlign=me.ENUM_TEXTALIGN_RIGHT;break;default:this._nTexAlign=me.ENUM_TEXTALIGN_DEFAULT}this._textIsWorldText&&this._text.cleanCache()}),FillTextCmd.create=function(t,e,i,n,r,s){var a=re.getItemByClass("FillTextCmd",FillTextCmd);return a.text=t,a._textIsWorldText=t instanceof laya.utils.WordText,a.x=e,a.y=i,a.font=n,a.color=r,a.textAlign=s,a},FillTextCmd.ID="FillText",n(FillTextCmd,["_defFontObj",function(){return this._defFontObj=new Bt(null)}]),FillTextCmd}()),dt=function(){function TextAtlas(){this.texWidth=1024,this.texHeight=1024,this.atlasgrid=null,this.protectDist=1,this.texture=null,this.charMaps={},this.texHeight=this.texWidth=D.atlasWidth,this.texture=ti.getTextTexture(this.texWidth,this.texHeight),this.texWidth/TextAtlas.atlasGridW>256&&(TextAtlas.atlasGridW=Math.ceil(this.texWidth/256)),this.atlasgrid=new wt(this.texWidth/TextAtlas.atlasGridW,this.texHeight/TextAtlas.atlasGridW,this.texture.id)}r(TextAtlas,"laya.webgl.text.TextAtlas");var t=TextAtlas.prototype;return t.setProtecteDist=function(t){this.protectDist=t},t.getAEmpty=function(t,e,i){var n=this.atlasgrid.addRect(1,Math.ceil(t/TextAtlas.atlasGridW),Math.ceil(e/TextAtlas.atlasGridW),i);return n&&(i.x*=TextAtlas.atlasGridW,i.y*=TextAtlas.atlasGridW),n},t.destroy=function(){for(var t in this.charMaps){this.charMaps[t].deleted=!0}this.texture.discard()},t.printDebugInfo=function(){},s(0,t,"usedRate",function(){return this.atlasgrid._used}),TextAtlas.atlasGridW=16,TextAtlas}(),ft=function(){function CONST3D2D(){}return r(CONST3D2D,"laya.webgl.utils.CONST3D2D"),CONST3D2D.BYTES_PE=4,CONST3D2D.BYTES_PIDX=2,CONST3D2D.defaultMatrix4=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],CONST3D2D.defaultMinusYMatrix4=[1,0,0,0,0,-1,0,0,0,0,1,0,0,0,0,1],CONST3D2D.uniformMatrix3=[1,0,0,0,0,1,0,0,0,0,1,0],CONST3D2D._TMPARRAY=[],CONST3D2D._OFFSETX=0,CONST3D2D._OFFSETY=0,CONST3D2D}(),pt=function(){function Prefab(){this.json=null}return r(Prefab,"laya.components.Prefab"),Prefab.prototype.create=function(){return this.json?xe.createByData(null,this.json):null},Prefab}(),mt=function(){function Rectangle(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.width=i,this.height=n}r(Rectangle,"laya.maths.Rectangle");var t=Rectangle.prototype;return t.setTo=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},t.reset=function(){return this.x=this.y=this.width=this.height=0,this},t.recover=function(){this!=Rectangle.TEMP&&this!=Rectangle.EMPTY?re.recover("Rectangle",this.reset()):console.log("recover Temp or Empty:",this)},t.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.contains=function(t,e){return!(this.width<=0||this.height<=0)&&(t>=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.widthh.x?r:h.x,a=a>h.y?a:h.y;return e.setTo(n,s,r-n,a-s)},Rectangle.EMPTY=new Rectangle,Rectangle.TEMP=new Rectangle,Rectangle._temB=[],Rectangle._temA=[],Rectangle}(),gt=function(){function DrawTextureCmd(){this.colorFlt=null}r(DrawTextureCmd,"laya.display.cmd.DrawTextureCmd");var t=DrawTextureCmd.prototype;return t.recover=function(){this.texture._removeReference(),this.texture=null,this.matrix=null,re.recover("DrawTextureCmd",this)},t.run=function(t,e,i){t.drawTextureWithTransform(this.texture,this.x,this.y,this.width,this.height,this.matrix,e,i,this.alpha,this.blendMode,this.colorFlt)},s(0,t,"cmdID",function(){return"DrawTexture"}),DrawTextureCmd.create=function(t,e,i,n,r,s,a,o,h){var u=re.getItemByClass("DrawTextureCmd",DrawTextureCmd);return u.texture=t,t._addReference(),u.x=e,u.y=i,u.width=n,u.height=r,u.matrix=s,u.alpha=a,u.color=o,u.blendMode=h,o&&(u.colorFlt=new He,u.colorFlt.setColor(o)),u},DrawTextureCmd.ID="DrawTexture",DrawTextureCmd}(),vt=function(){function Filter(){this._glRender=null}r(Filter,"laya.filters.Filter");var t=Filter.prototype;return i.imps(t,{"laya.filters.IFilter":!0}),s(0,t,"type",function(){return-1}),Filter.BLUR=16,Filter.COLOR=32,Filter.GLOW=8,Filter._filter=function(t,e,i,n){var r=e,s=this._next;if(s){var a=t.filters,o=a.length;if(1==o&&32==a[0].type)return e.save(),e.setColorFilter(a[0]),s._fun.call(s,t,e,i,n),void e.restore();var h,u=st.create(1,0),c=ct.TEMP,_=r._curMat,d=U.create();_.copyTo(d);var f=0,p=0,m=null,g=t._cacheStyle.filterCache||null;if(g&&0==t.getRepaint()){if((t._cacheStyle.hasGlowFilter||!1)&&(f=50,p=25),(h=t.getBounds()).width<=0||h.height<=0)return;h.width+=f,h.height+=f,c.x=h.x*d.a+h.y*d.c,c.y=h.y*d.d+h.x*d.b,h.x=c.x,h.y=c.y,c.x=h.width*d.a+h.height*d.c,c.y=h.height*d.d+h.width*d.b,h.width=c.x,h.height=c.y}else{t._isHaveGlowFilter()&&(f=50,p=25),(h=new mt).copyFrom(t.getSelfBounds()),h.x+=t.x,h.y+=t.y,h.x-=t.pivotX+4,h.y-=t.pivotY+4;var v=h.x,x=h.y;if(h.width+=f+8,h.height+=f+8,c.x=h.x*d.a+h.y*d.c,c.y=h.y*d.d+h.x*d.b,h.x=c.x,h.y=c.y,c.x=h.width*d.a+h.height*d.c,c.y=h.height*d.d+h.width*d.b,h.width=c.x,h.height=c.y,h.width<=0||h.height<=0)return;g&&Q.releaseRT(g),m=Q.getRT(h.width,h.height);var y=g=Q.getRT(h.width,h.height);t._getCacheStyle().filterCache=g,r.pushRT(),r.useRT(m);var T=t.x-v+p,b=t.y-x+p;s._fun.call(s,t,e,T,b),r.useRT(y);for(var C=0;C=0;i--)e[i].id==t&&e.splice(i,1)},t.createTouchO=function(t,e){var i;return(i=re.getItem("TouchData")||{}).id=e,i.tar=t,i},t.onMouseDown=function(t,e,i){var n,r,s,a;(void 0===i&&(i=!1),this.enable)&&(n=this.getTouchFromArr(e,this.preOvers),s=this.getEles(t,null,TouchManager._tEleArr),n?n.tar=t:(r=this.createTouchO(t,e),this.preOvers.push(r)),Y.onMobile&&this.sendEvents(s,"mouseover"),a=i?this.preDowns:this.preRightDowns,(n=this.getTouchFromArr(e,a))?n.tar=t:(r=this.createTouchO(t,e),a.push(r)),this.sendEvents(s,i?"mousedown":"rightmousedown"),this._clearTempArrs())},t.sendEvents=function(t,e){var i,n,r,s=0;for(i=t.length,this._event._stoped=!1,n=t[0],s=0;s=0){h.splice(u,h.length-u);break}r.push(n)}r.length>0&&this.sendEvents(r,"mouseout"),h.length>0&&this.sendEvents(h,"mouseover")}}},t.onMouseMove=function(t,e){var i,n;this.enable&&((i=this.getTouchFromArr(e,this.preOvers))?(this.checkMouseOutAndOverOfMove(t,i.tar),i.tar=t,n=this.getEles(t,null,TouchManager._tEleArr)):(n=this.getEles(t,null,TouchManager._tEleArr),this.sendEvents(n,"mouseover"),this.preOvers.push(this.createTouchO(t,e))),this.sendEvents(n,"mousemove"),this._clearTempArrs())},t.getLastOvers=function(){return TouchManager._tEleArr.length=0,this.preOvers.length>0&&this.preOvers[0].tar?this.getEles(this.preOvers[0].tar,null,TouchManager._tEleArr):(TouchManager._tEleArr.push(i.stage),TouchManager._tEleArr)},t.stageMouseOut=function(){var t;t=this.getLastOvers(),this.preOvers.length=0,this.sendEvents(t,"mouseout")},t.onMouseUp=function(t,e,i){if(void 0===i&&(i=!1),this.enable){var n,r,s,a,o,h,u=0,l=0,c=Y.onMobile;if(r=this.getEles(t,null,TouchManager._tEleArr),this.sendEvents(r,i?"mouseup":"rightmouseup"),h=i?this.preDowns:this.preRightDowns,n=this.getTouchFromArr(e,h)){var _,d=Y.now();if(_=d-this._lastClickTime<300,this._lastClickTime=d,t==n.tar)o=r;else for(s=this.getEles(n.tar,null,TouchManager._oldArr),(o=TouchManager._newArr).length=0,l=s.length,u=0;u=0&&o.push(a);o.length>0&&this.sendEvents(o,i?"click":"rightclick"),i&&_&&this.sendEvents(o,"doubleclick"),this.removeTouchFromArr(e,h),n.tar=null,re.recover("TouchData",n)}else;(n=this.getTouchFromArr(e,this.preOvers))&&c&&((o=this.getEles(n.tar,null,o))&&o.length>0&&this.sendEvents(o,"mouseout"),this.removeTouchFromArr(e,this.preOvers),n.tar=null,re.recover("TouchData",n)),this._clearTempArrs()}},TouchManager._oldArr=[],TouchManager._newArr=[],TouchManager._tEleArr=[],n(TouchManager,["I",function(){return this.I=new TouchManager}]),TouchManager}(),yt=function(){function ScaleCmd(){}r(ScaleCmd,"laya.display.cmd.ScaleCmd");var t=ScaleCmd.prototype;return t.recover=function(){re.recover("ScaleCmd",this)},t.run=function(t,e,i){t._scale(this.scaleX,this.scaleY,this.pivotX+e,this.pivotY+i)},s(0,t,"cmdID",function(){return"Scale"}),ScaleCmd.create=function(t,e,i,n){var r=re.getItemByClass("ScaleCmd",ScaleCmd);return r.scaleX=t,r.scaleY=e,r.pivotX=i,r.pivotY=n,r},ScaleCmd.ID="Scale",ScaleCmd}(),Tt=function(){function AlphaCmd(){}r(AlphaCmd,"laya.display.cmd.AlphaCmd");var t=AlphaCmd.prototype;return t.recover=function(){re.recover("AlphaCmd",this)},t.run=function(t,e,i){t.alpha(this.alpha)},s(0,t,"cmdID",function(){return"Alpha"}),AlphaCmd.create=function(t){var e=re.getItemByClass("AlphaCmd",AlphaCmd);return e.alpha=t,e},AlphaCmd.ID="Alpha",AlphaCmd}(),bt=(function(){function DrawParticleCmd(){}r(DrawParticleCmd,"laya.display.cmd.DrawParticleCmd");var t=DrawParticleCmd.prototype;t.recover=function(){this._templ=null,re.recover("DrawParticleCmd",this)},t.run=function(t,e,i){t.drawParticle(e,i,this._templ)},s(0,t,"cmdID",function(){return"DrawParticleCmd"}),DrawParticleCmd.create=function(t){var e=re.getItemByClass("DrawParticleCmd",DrawParticleCmd);return e._templ=t,e},DrawParticleCmd.ID="DrawParticleCmd"}(),function(){function SaveMark(){this._saveuse=0}r(SaveMark,"laya.webgl.canvas.save.SaveMark");var t=SaveMark.prototype;return i.imps(t,{"laya.webgl.canvas.save.ISaveData":!0}),t.isSaveMark=function(){return!0},t.restore=function(t){t._saveMark=this._preSaveMark,SaveMark.POOL[SaveMark.POOL._length++]=this},SaveMark.Create=function(t){var e=SaveMark.POOL,i=e._length>0?e[--e._length]:new SaveMark;return i._saveuse=0,i._preSaveMark=t._saveMark,t._saveMark=i,i},SaveMark.POOL=h._createArray(),SaveMark}()),Ct=(function(){function Mouse(){}r(Mouse,"laya.utils.Mouse"),s(1,Mouse,"cursor",function(){return Mouse._style.cursor},function(t){Mouse._style.cursor=t}),Mouse.hide=function(){"none"!=Mouse.cursor&&(Mouse._preCursor=Mouse.cursor,Mouse.cursor="none")},Mouse.show=function(){"none"==Mouse.cursor&&(Mouse._preCursor?Mouse.cursor=Mouse._preCursor:Mouse.cursor="auto")},Mouse._preCursor=null,n(Mouse,["_style",function(){return this._style=Y.document.body.style}])}(),function(){function SpriteStyle(){this.reset()}r(SpriteStyle,"laya.display.css.SpriteStyle");var t=SpriteStyle.prototype;return t.reset=function(){return this.scaleX=this.scaleY=1,this.skewX=this.skewY=0,this.pivotX=this.pivotY=this.rotation=0,this.alpha=1,this.scrollRect&&this.scrollRect.recover(),this.scrollRect=null,this.viewport&&this.viewport.recover(),this.viewport=null,this.hitArea=null,this.dragging=null,this.blendMode=null,this},t.recover=function(){this!==SpriteStyle.EMPTY&&re.recover("SpriteStyle",this.reset())},SpriteStyle.create=function(){return re.getItemByClass("SpriteStyle",SpriteStyle)},SpriteStyle.EMPTY=new SpriteStyle,SpriteStyle}()),St=function(){function Utils(){}return r(Utils,"laya.utils.Utils"),Utils.toRadian=function(t){return t*Utils._pi2},Utils.toAngle=function(t){return t*Utils._pi},Utils.toHexColor=function(t){if(t<0||isNaN(t))return null;for(var e=t.toString(16);e.length<6;)e="0"+e;return"#"+e},Utils.getGID=function(){return Utils._gid++},Utils.concatArray=function(t,e){if(!e)return t;if(!t)return e;var i=0,n=e.length;for(i=0;i-1&&t[n]._zOrder>s;)t[n+1]=t[n];t[n+1]=e,i++}return!0},Utils.transPointList=function(t,e,i){var n=0,r=t.length;for(n=0;n1?e[1].toLowerCase():null},Utils.getTransformRelativeToWindow=function(t,e,n){var r=i.stage,s=laya.utils.Utils.getGlobalPosAndScale(t),a=r._canvasTransform.clone(),o=a.tx,h=a.ty;a.rotate(-Math.PI/180*i.stage.canvasDegree),a.scale(i.stage.clientScaleX,i.stage.clientScaleY);var u=i.stage.canvasDegree%180!=0,l=NaN,c=NaN;u?(l=n+s.y,c=e+s.x,l*=a.d,c*=a.a,90==i.stage.canvasDegree?(l=o-l,c+=h):(l+=o,c=h-c)):(l=e+s.x,c=n+s.y,l*=a.a,c*=a.d,l+=o,c+=h),c+=i.stage._safariOffsetY;var _=NaN,d=NaN;return u?(_=a.d*s.height,d=a.a*s.width):(_=a.a*s.width,d=a.d*s.height),{x:l,y:c,scaleX:_,scaleY:d}},Utils.fitDOMElementInArea=function(t,e,n,r,s,a){t._fitLayaAirInitialized||(t._fitLayaAirInitialized=!0,t.style.transformOrigin=t.style.webKittransformOrigin="left top",t.style.position="absolute");var o=Utils.getTransformRelativeToWindow(e,n,r);t.style.transform=t.style.webkitTransform="scale("+o.scaleX+","+o.scaleY+") rotate("+i.stage.canvasDegree+"deg)",t.style.width=s+"px",t.style.height=a+"px",t.style.left=o.x+"px",t.style.top=o.y+"px"},Utils.isOkTextureList=function(t){if(!t)return!1;var e,i=0,n=t.length;for(i=0;i\s+<"),(e=(new DOMParser).parseFromString(t,"text/xml")).firstChild.textContent.indexOf("This page contains the following errors")>-1)throw new Error(e.firstChild.firstChild.textContent);return e},Utils}(),wt=function(){function AtlasGrid(t,e,i){this.atlasID=0,this._width=0,this._height=0,this._texCount=0,this._rowInfo=null,this._cells=null,this._used=0,void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._cells=null,this._rowInfo=null,this.atlasID=i,this._init(t,e)}r(AtlasGrid,"laya.webgl.text.AtlasGrid");var t=AtlasGrid.prototype;return t.addRect=function(t,e,i,n){return!!this._get(e,i,n)&&(this._fill(n.x,n.y,e,i,t),this._texCount++,!0)},t._release=function(){this._cells=null,this._rowInfo=null},t._init=function(t,e){return this._width=t,this._height=e,this._release(),0!=this._width&&(this._cells=new Uint8Array(this._width*this._height*3),this._rowInfo=new Uint8Array(this._height),this._used=0,this._clear(),!0)},t._get=function(t,e,i){if(t>this._width||e>this._height)return!1;for(var n=-1,r=-1,s=this._width,a=this._height,o=this._cells,h=0;h=i),this._rowInfo[o]-=i;for(var h=0;h0)for(o=0;o=0&&0==this._cells[3*((e+o)*s+h)];--h,++l);for(h=l;h>0;--h)this._cells[3*((e+o)*s+t-h)+1]=h,this._check(h>0)}if(e>0)for(h=t;h=0&&0==this._cells[3*(h+o*s)];--o,l++);for(o=l;o>0;--o)this._cells[3*(h+(e-o)*s)+2]=o,this._check(o>0)}this._used+=i*n/(this._width*this._height)},t._check=function(t){0==t&&console.log("xtexMerger 错误啦")},t._clear=function(){this._texCount=0;for(var t=0;t0?e[--e._length]:new SaveTranslate;t._curMat.copyTo(i._mat);var n=t._save;n[n._length++]=i},SaveTranslate.POOL=h._createArray(),SaveTranslate}(),Rt=function(){function Config(){}return r(Config,"Config"),Config.animationInterval=50,Config.isAntialias=!1,Config.isAlpha=!1,Config.premultipliedAlpha=!0,Config.isStencil=!0,Config.preserveDrawingBuffer=!1,Config.webGL2D_MeshAllocMaxMem=!0,Config.is2DPixelArtGame=!1,Config.useWebGL2=!1,Config.useRetinalCanvas=!1,Config}(),Lt=function(){function BlendMode(){}return r(BlendMode,"laya.webgl.canvas.BlendMode"),BlendMode._init_=function(t){BlendMode.fns=[BlendMode.BlendNormal,BlendMode.BlendAdd,BlendMode.BlendMultiply,BlendMode.BlendScreen,BlendMode.BlendOverlay,BlendMode.BlendLight,BlendMode.BlendMask,BlendMode.BlendDestinationOut],BlendMode.targetFns=[BlendMode.BlendNormalTarget,BlendMode.BlendAddTarget,BlendMode.BlendMultiplyTarget,BlendMode.BlendScreenTarget,BlendMode.BlendOverlayTarget,BlendMode.BlendLightTarget,BlendMode.BlendMask,BlendMode.BlendDestinationOut]},BlendMode.BlendNormal=function(t){jt.setBlendFunc(t,1,771)},BlendMode.BlendAdd=function(t){jt.setBlendFunc(t,1,772)},BlendMode.BlendMultiply=function(t){jt.setBlendFunc(t,774,771)},BlendMode.BlendScreen=function(t){jt.setBlendFunc(t,1,1)},BlendMode.BlendOverlay=function(t){jt.setBlendFunc(t,1,769)},BlendMode.BlendLight=function(t){jt.setBlendFunc(t,1,1)},BlendMode.BlendNormalTarget=function(t){jt.setBlendFunc(t,1,771)},BlendMode.BlendAddTarget=function(t){jt.setBlendFunc(t,1,772)},BlendMode.BlendMultiplyTarget=function(t){jt.setBlendFunc(t,774,771)},BlendMode.BlendScreenTarget=function(t){jt.setBlendFunc(t,1,1)},BlendMode.BlendOverlayTarget=function(t){jt.setBlendFunc(t,1,769)},BlendMode.BlendLightTarget=function(t){jt.setBlendFunc(t,1,1)},BlendMode.BlendMask=function(t){jt.setBlendFunc(t,0,770)},BlendMode.BlendDestinationOut=function(t){jt.setBlendFunc(t,0,0)},BlendMode.activeBlendFunction=null,BlendMode.NAMES=["normal","add","multiply","screen","overlay","light","mask","destination-out"],BlendMode.TOINT={normal:0,add:1,multiply:2,screen:3,overlay:4,light:5,mask:6,"destination-out":7,lighter:1},BlendMode.NORMAL="normal",BlendMode.ADD="add",BlendMode.MULTIPLY="multiply",BlendMode.SCREEN="screen",BlendMode.OVERLAY="overlay",BlendMode.LIGHT="light",BlendMode.MASK="mask",BlendMode.DESTINATIONOUT="destination-out",BlendMode.LIGHTER="lighter",BlendMode.fns=[],BlendMode.targetFns=[],BlendMode}(),Et=function(){function MouseManager(){this.mouseX=0,this.mouseY=0,this.disableMouseEvent=!1,this.mouseDownTime=0,this.mouseMoveAccuracy=2,this._stage=null,this._captureSp=null,this._captureExlusiveMode=!1,this._hitCaputreSp=!1,this._target=null,this._lastMoveTimer=0,this._isLeftMouse=!1,this._touchIDs={},this._id=1,this._tTouchID=0,this._event=new ue,this._captureChain=[],this._matrix=new U,this._point=new ct,this._rect=new mt,this._prePoint=new ct,this._curTouchID=NaN}r(MouseManager,"laya.events.MouseManager");var t=MouseManager.prototype;return t.__init__=function(t,e){var i=this;this._stage=t;var n=this;e.oncontextmenu=function(t){if(MouseManager.enabled)return!1},e.addEventListener("mousedown",function(t){MouseManager.enabled&&(Y.onIE||t.preventDefault(),n.mouseDownTime=Y.now(),i.runEvent(t))}),e.addEventListener("mouseup",function(t){MouseManager.enabled&&(t.preventDefault(),n.mouseDownTime=-Y.now(),i.runEvent(t))},!0),e.addEventListener("mousemove",function(t){if(MouseManager.enabled){t.preventDefault();var e=Y.now();if(e-n._lastMoveTimer<10)return;n._lastMoveTimer=e,i.runEvent(t)}},!0),e.addEventListener("mouseout",function(t){MouseManager.enabled&&i.runEvent(t)}),e.addEventListener("mouseover",function(t){MouseManager.enabled&&i.runEvent(t)}),e.addEventListener("touchstart",function(t){MouseManager.enabled&&(MouseManager._isFirstTouch||di.isInputting||t.preventDefault(),n.mouseDownTime=Y.now(),i.runEvent(t))}),e.addEventListener("touchend",function(t){MouseManager.enabled?(MouseManager._isFirstTouch||di.isInputting||t.preventDefault(),MouseManager._isFirstTouch=!1,n.mouseDownTime=-Y.now(),i.runEvent(t)):i._curTouchID=NaN},!0),e.addEventListener("touchmove",function(t){MouseManager.enabled&&(t.preventDefault(),i.runEvent(t))},!0),e.addEventListener("touchcancel",function(t){MouseManager.enabled?(t.preventDefault(),i.runEvent(t)):i._curTouchID=NaN},!0),e.addEventListener("mousewheel",function(t){MouseManager.enabled&&i.runEvent(t)}),e.addEventListener("DOMMouseScroll",function(t){MouseManager.enabled&&i.runEvent(t)})},t.initEvent=function(t,e){var i;this._event._stoped=!1,this._event.nativeEvent=e||t,this._target=null,this._point.setTo(t.pageX||t.clientX,t.pageY||t.clientY),this._stage._canvasTransform&&(this._stage._canvasTransform.invertTransformPoint(this._point),this.mouseX=this._point.x,this.mouseY=this._point.y),this._event.touchId=t.identifier||0,this._tTouchID=this._event.touchId,(i=xt.I._event)._stoped=!1,i.nativeEvent=this._event.nativeEvent,i.touchId=this._event.touchId},t.checkMouseWheel=function(t){this._event.delta=t.wheelDelta?.025*t.wheelDelta:-t.detail;for(var e=xt.I.getLastOvers(),i=0,n=e.length;i-1;s--){var a=t._children[s];if(!a.destroyed&&a._mouseState>1&&a._visible&&this.check(a,e,i,n))return!0}for(s=t._extUIChild.length-1;s>=0;s--){var o=t._extUIChild[s];if(!o.destroyed&&o._mouseState>1&&o._visible&&this.check(o,e,i,n))return!0}}var h=!(!t.hitTestPrior||t.mouseThrough||this.disableMouseEvent)||this.hitTest(t,e,i);return h?(this._target=t,n.call(this,t),this._target==this._hitCaputreSp&&(this._hitCaputreSp=!0)):n===this.onMouseUp&&t===this._stage&&(this._target=this._stage,n.call(this,this._target)),h},t.hitTest=function(t,e,i){var n=!1;t.scrollRect&&(e-=t._style.scrollRect.x,i-=t._style.scrollRect.y);var r=t._style.hitArea;return r&&r._hit?r.contains(e,i):((t.width>0&&t.height>0||t.mouseThrough||r)&&(n=t.mouseThrough?t.getGraphicBounds().contains(e,i):(r||this._rect.setTo(0,0,t.width,t.height)).contains(e,i)),n)},t._checkAllBaseUI=function(t,e,i){var n=this.handleExclusiveCapture(this.mouseX,this.mouseY,i);return!!n||(n=this.check(this._stage,this.mouseX,this.mouseY,i),this.handleCapture(this.mouseX,this.mouseY,i)||n)},t.check3DUI=function(t,e,i){for(var n=this._stage._3dUI,r=0,s=!1;r1&&a._visible&&(s=s||this.check(a,this.mouseX,this.mouseY,i))}return this._stage._curUIBase=this._stage,s},t.handleExclusiveCapture=function(t,e,i){if(this._captureExlusiveMode&&this._captureSp&&this._captureChain.length>0){var n;this._point.setTo(t,e);for(var r=0;r0){var n;this._point.setTo(t,e);for(var r=0;r=this.mouseMoveAccuracy&&(this._prePoint.x=t.clientX,this._prePoint.y=t.clientY,this.initEvent(t),this._checkAllBaseUI(this.mouseX,this.mouseY,this.onMouseMove));break;case"touchstart":MouseManager._isTouchRespond=!0,this._isLeftMouse=!0;var r=t.changedTouches;for(i=0,n=r.length;i=Math.max(o,u)))(n.y-o)*(h-a)/(u-o)+a>n.x&&s++}return s%2==1},HitArea._cmds=[],n(HitArea,["_rect",function(){return this._rect=new mt},"_ptPoint",function(){return this._ptPoint=new ct}]),HitArea}(),Bt=(function(){function Const(){}r(Const,"laya.Const"),Const.NOT_ACTIVE=1,Const.ACTIVE_INHIERARCHY=2,Const.AWAKED=4,Const.NOT_READY=8,Const.DISPLAY=16,Const.HAS_ZORDER=32,Const.HAS_MOUSE=64,Const.DISPLAYED_INSTAGE=128,Const.DRAWCALL_OPTIMIZE=256}(),function(){function FontInfo(t){this._font="14px Arial",this._family="Arial",this._size=14,this._italic=!1,this._bold=!1,this._id=FontInfo._gfontID++,this.setFont(t||this._font)}return r(FontInfo,"laya.utils.FontInfo"),FontInfo.prototype.setFont=function(t){this._font=t;var e=t.split(" "),i=e.length;if(i<2)1==i&&e[0].indexOf("px")>0&&(this._size=parseInt(e[0]));else{for(var n=-1,r=0;r0||e[r].indexOf("pt")>0){n=r,this._size=parseInt(e[r]),this._size<=0&&(console.error("font parse error:"+t),this._size=14);break}var s=n+1,a=e[s];for(s++;s=0,this._bold=e.indexOf("bold")>=0}},FontInfo.Parse=function(t){if(t===FontInfo._lastFont)return FontInfo._lastFontInfo;var e=FontInfo._cache[t];return e||(e=FontInfo._cache[t]=new FontInfo(t)),FontInfo._lastFont=t,FontInfo._lastFontInfo=e,e},FontInfo.EMPTY=new FontInfo(null),FontInfo._cache={},FontInfo._gfontID=0,FontInfo._lastFont="",FontInfo._lastFontInfo=null,FontInfo}()),Gt=function(){function TranslateCmd(){}r(TranslateCmd,"laya.display.cmd.TranslateCmd");var t=TranslateCmd.prototype;return t.recover=function(){re.recover("TranslateCmd",this)},t.run=function(t,e,i){t.translate(this.tx,this.ty)},s(0,t,"cmdID",function(){return"Translate"}),TranslateCmd.create=function(t,e){var i=re.getItemByClass("TranslateCmd",TranslateCmd);return i.tx=t,i.ty=e,i},TranslateCmd.ID="Translate",TranslateCmd}(),Ft=function(){var t;function Path(){this._lastOriX=0,this._lastOriY=0,this.paths=[],this._curPath=null}r(Path,"laya.webgl.canvas.Path");var e=Path.prototype;return e.beginPath=function(e){this.paths.length=1,this._curPath=this.paths[0]=new t,this._curPath.convex=e},e.closePath=function(){this._curPath.loop=!0},e.newPath=function(){this._curPath=new t,this.paths.push(this._curPath)},e.addPoint=function(t,e){this._curPath.path.push(t,e)},e.push=function(e,i){this._curPath?this._curPath.path.length>0&&(this._curPath=new t,this.paths.push(this._curPath)):(this._curPath=new t,this.paths.push(this._curPath));var n=this._curPath;n.path=e.slice(),n.convex=i},e.reset=function(){this.paths.length=0},Path.__init$=function(){t=function(){function renderPath(){this.path=[],this.loop=!1,this.convex=!1}return r(renderPath,""),renderPath}()},Path}(),Wt=function(){function BlurFilterGLRender(){}r(BlurFilterGLRender,"laya.filters.BlurFilterGLRender");var t=BlurFilterGLRender.prototype;return t.render=function(t,e,i,n,r){var s=st.create(1,0);this.setShaderInfo(s,r,t.width,t.height),e.drawTarget(t,0,0,i,n,U.EMPTY.identity(),s)},t.setShaderInfo=function(t,e,i,n){t.defines.add(16);var r=t;BlurFilterGLRender.blurinfo[0]=i,BlurFilterGLRender.blurinfo[1]=n,r.blurInfo=BlurFilterGLRender.blurinfo;var s=e.strength/3,a=s*s;e.strength_sig2_2sig2_gauss1[0]=e.strength,e.strength_sig2_2sig2_gauss1[1]=a,e.strength_sig2_2sig2_gauss1[2]=2*a,e.strength_sig2_2sig2_gauss1[3]=1/(2*Math.PI*a),r.strength_sig2_2sig2_gauss1=e.strength_sig2_2sig2_gauss1},n(BlurFilterGLRender,["blurinfo",function(){return this.blurinfo=new Array(2)}]),BlurFilterGLRender}(),Ot=function(){function StringKey(){this._strsToID={},this._idToStrs=[],this._length=0}r(StringKey,"laya.utils.StringKey");var t=StringKey.prototype;return t.add=function(t){var e=this._strsToID[t];return null!=e?e:(this._idToStrs[this._length]=t,this._strsToID[t]=this._length++)},t.getID=function(t){var e=this._strsToID[t];return null==e?-1:e},t.getName=function(t){var e=this._idToStrs[t];return null==e?void 0:e},StringKey}(),Nt=(function(){function ArabicReshaper(){}r(ArabicReshaper,"laya.webgl.text.ArabicReshaper");var t=ArabicReshaper.prototype;t.characterMapContains=function(t){for(var e=0;e-1)return String.fromCharCode(ArabicReshaper.charsMap[e][0]);for(e=0;e-1)return String.fromCharCode(ArabicReshaper.combCharsMap[e][0][0])+String.fromCharCode(ArabicReshaper.combCharsMap[e][0][1]);return String.fromCharCode(t)},t.convertArabic=function(t){for(var e,i,n="",r=0;r=0&&this.isTransparent(t.charCodeAt(h));--h);for((!(e=!!(a=h>=0?t.charCodeAt(h):null)&&this.getCharRep(a))||null==e[2]&&null==e[3])&&(a=null);ut.length+2?BasePoly.tempData:new Array(t.length+2);a[0]=t[0],a[1]=t[1];var o=2,h=0,u=t.length;for(h=2;h.01&&(a[o++]=t[h],a[o++]=t[h+1]);s&&Math.abs(t[0]-a[o-2])+Math.abs(t[1]-a[o-1])>.01&&(a[o++]=t[0],a[o++]=t[1]);var l=r;u=o/2;var c,_,d,f,p,m,g,v,x,y,T,b,C,S,w,M,A,R,L,E,D=i/2;d=a[0],f=a[1],y=d-(p=a[2]);x=(x=-(f-(m=a[3])))/(E=Math.sqrt(x*x+y*y))*D,y=y/E*D;for(l.push(d-x,f-y,d+x,f+y),h=1;h.001&&(g[d=4*v]=u,g[d+1]=l,g[d+2]=f/_,g[d+3]=p/_,v++);for(n?(u=o[h-2],l=o[h-1],c=o[0],p=o[1]-l,0!=(f=c-u)&&0!=p&&(_=Math.sqrt(f*f+p*p))>.001&&(g[d=4*v]=u,g[d+1]=l,g[d+2]=f/_,g[d+3]=p/_,v++)):(g[d=4*v]=u,g[d+1]=l,g[d+2]=f/_,g[d+3]=p/_,v++),x=0,y=0;y0)return t;if(null!=URL.customFormat&&(t=URL.customFormat(t)),t.indexOf(":")>0)return t;var e=t.charAt(0);if("."===e)return URL._formatRelativePath(URL._basePath+t);if("~"===e)return URL.rootPath+t.substring(1);if("d"===e){if(0===t.indexOf("data:image"))return t}else if("/"===e)return t;return URL._basePath+t},URL._formatRelativePath=function(t){for(var e=t.split("/"),i=0,n=e.length;i0?t.substr(0,e+1):""},URL.getFileName=function(t){var e=t.lastIndexOf("/");return e>0?t.substr(e+1):t},URL.getAdptedFilePath=function(t){if(!URL.exportSceneToJson||!t)return t;var e,i,n=0;for(e=URL._adpteTypeList.length,n=0;n0?Math.floor(1e3/Stat.FPS).toString():" ";Stat._fpsStr=Stat.FPS+(Stat.renderSlow?" slow":"")+" "+i,Stat._useCanvas?Stat._spriteStr=Stat.spriteCount-1+(Stat.spriteRenderUseCacheCount?"/"+Stat.spriteRenderUseCacheCount:""):Stat._spriteStr=Stat.spriteCount-4+(Stat.spriteRenderUseCacheCount?"/"+Stat.spriteRenderUseCacheCount:""),Stat._canvasStr=Stat.canvasReCache+"/"+Stat.canvasNormal+"/"+Stat.canvasBitmap,Stat.cpuMemory=Me.cpuMemory,Stat.gpuMemory=Me.gpuMemory,Stat._useCanvas?Stat.renderInfoPre():Stat.renderInfo(),Stat.clear()}Stat._count=0,Stat._timer=t}},Stat.renderInfoPre=function(){var t,e,i=0;if(Stat._canvas){var n=Stat._ctx;for(n.clearRect(Stat._first?0:Stat._vx,0,Stat._width,Stat._height),i=0;i0){for(var i=0,n=e-1;i<=n;i++){var r=t[i];this._map[r.key]=null,null!==r.method&&(r.run(),r.clear()),this._pool.push(r),i===n&&(n=t.length-1)}t.length=0}},e._getHandler=function(t,e){var i=t?t.$_GID||(t.$_GID=St.getGID()):0,n=e.$_TID||(e.$_TID=1e5*E._mid++);return this._map[i+n]},e.callLater=function(e,i,n){if(null==this._getHandler(e,i)){if(this._pool.length)var r=this._pool.pop();else r=new t;r.caller=e,r.method=i,r.args=n;var s=e?e.$_GID:0,a=i.$_TID;r.key=s+a,this._map[r.key]=r,this._laters.push(r)}},e.runCallLater=function(t,e){var i=this._getHandler(t,e);i&&null!=i.method&&(this._map[i.key]=null,i.run(),i.clear())},CallLater.I=new CallLater,CallLater.__init$=function(){t=function(){function LaterHandler(){this.key=0,this.caller=null,this.method=null,this.args=null}r(LaterHandler,"");var t=LaterHandler.prototype;return t.clear=function(){this.caller=null,this.method=null,this.args=null},t.run=function(){var t=this.caller;if(t&&t.destroyed)return this.clear();var e=this.method,i=this.args;null!=e&&(i?e.apply(t,i):e.call(t))},LaterHandler}()},CallLater}(),Kt=function(){function SaveClipRect(){this._clipInfoID=-1,this.incache=!1,this._globalClipMatrix=new U,this._clipRect=new mt}r(SaveClipRect,"laya.webgl.canvas.save.SaveClipRect");var t=SaveClipRect.prototype;return i.imps(t,{"laya.webgl.canvas.save.ISaveData":!0}),t.isSaveMark=function(){return!1},t.restore=function(t){this._globalClipMatrix.copyTo(t._globalClipMatrix),this._clipRect.clone(t._clipRect),t._clipInfoID=this._clipInfoID,SaveClipRect.POOL[SaveClipRect.POOL._length++]=this,t._clipInCache=this.incache},SaveClipRect.save=function(t){if(131072!=(131072&t._saveMark._saveuse)){t._saveMark._saveuse|=131072;var e=SaveClipRect.POOL,i=e._length>0?e[--e._length]:new SaveClipRect;t._globalClipMatrix.copyTo(i._globalClipMatrix),t._clipRect.clone(i._clipRect),i._clipInfoID=t._clipInfoID,i.incache=t._clipInCache;var n=t._save;n[n._length++]=i}},SaveClipRect.POOL=h._createArray(),SaveClipRect}(),jt=function(){function WebGLContext(){}r(WebGLContext,"laya.webgl.WebGLContext");var e=WebGLContext.prototype;return e.getContextAttributes=function(){return null},e.isContextLost=function(){},e.getSupportedExtensions=function(){return null},e.getExtension=function(t){return null},e.activeTexture=function(t){},e.attachShader=function(t,e){},e.bindAttribLocation=function(t,e,i){},e.bindBuffer=function(t,e){},e.bindFramebuffer=function(t,e){},e.bindRenderbuffer=function(t,e){},e.bindTexture=function(t,e){},e.useTexture=function(t){},e.blendColor=function(t,e,i,n){},e.blendEquation=function(t){},e.blendEquationSeparate=function(t,e){},e.blendFunc=function(t,e){},e.blendFuncSeparate=function(t,e,i,n){},e.bufferData=function(t,e,i){},e.bufferSubData=function(t,e,i){},e.checkFramebufferStatus=function(t){return null},e.clear=function(t){},e.clearColor=function(t,e,i,n){},e.clearDepth=function(t){},e.clearStencil=function(t){},e.colorMask=function(t,e,i,n){},e.compileShader=function(t){},e.copyTexImage2D=function(t,e,i,n,r,s,a,o){},e.copyTexSubImage2D=function(t,e,i,n,r,s,a,o){},e.createBuffer=function(){},e.createFramebuffer=function(){},e.createProgram=function(){},e.createRenderbuffer=function(){},e.createShader=function(t){},e.createTexture=function(){return null},e.cullFace=function(t){},e.deleteBuffer=function(t){},e.deleteFramebuffer=function(t){},e.deleteProgram=function(t){},e.deleteRenderbuffer=function(t){},e.deleteShader=function(t){},e.deleteTexture=function(t){},e.depthFunc=function(t){},e.depthMask=function(t){},e.depthRange=function(t,e){},e.detachShader=function(t,e){},e.disable=function(t){},e.disableVertexAttribArray=function(t){},e.drawArrays=function(t,e,i){},e.drawElements=function(t,e,i,n){},e.enable=function(t){},e.enableVertexAttribArray=function(t){},e.finish=function(){},e.flush=function(){},e.framebufferRenderbuffer=function(t,e,i,n){},e.framebufferTexture2D=function(t,e,i,n,r){},e.frontFace=function(t){return null},e.generateMipmap=function(t){return null},e.getActiveAttrib=function(t,e){return null},e.getActiveUniform=function(t,e){return null},e.getAttribLocation=function(t,e){return 0},e.getParameter=function(t){return null},e.getBufferParameter=function(t,e){return null},e.getError=function(){return null},e.getFramebufferAttachmentParameter=function(t,e,i){},e.getProgramParameter=function(t,e){return 0},e.getProgramInfoLog=function(t){return null},e.getRenderbufferParameter=function(t,e){return null},e.getShaderPrecisionFormat=function(t){return null},e.getShaderParameter=function(t,e){},e.getShaderInfoLog=function(t){return null},e.getShaderSource=function(t){return null},e.getTexParameter=function(t,e){},e.getUniform=function(t,e){},e.getUniformLocation=function(t,e){return null},e.getVertexAttrib=function(t,e){return null},e.getVertexAttribOffset=function(t,e){return null},e.hint=function(t,e){},e.isBuffer=function(t){},e.isEnabled=function(t){},e.isFramebuffer=function(t){},e.isProgram=function(t){},e.isRenderbuffer=function(t){},e.isShader=function(t){},e.isTexture=function(t){},e.lineWidth=function(t){},e.linkProgram=function(t){},e.pixelStorei=function(t,e){},e.polygonOffset=function(t,e){},e.readPixels=function(t,e,i,n,r,s,a){},e.renderbufferStorage=function(t,e,i,n){},e.sampleCoverage=function(t,e){},e.scissor=function(t,e,i,n){},e.shaderSource=function(t,e){},e.stencilFunc=function(t,e,i){},e.stencilFuncSeparate=function(t,e,i,n){},e.stencilMask=function(t){},e.stencilMaskSeparate=function(t,e){},e.stencilOp=function(t,e,i){},e.stencilOpSeparate=function(t,e,i,n){},e.texImage2D=function(t){},e.texParameterf=function(t,e,i){},e.texParameteri=function(t,e,i){},e.texSubImage2D=function(t){},e.uniform1f=function(t,e){},e.uniform1fv=function(t,e){},e.uniform1i=function(t,e){},e.uniform1iv=function(t,e){},e.uniform2f=function(t,e,i){},e.uniform2fv=function(t,e){},e.uniform2i=function(t,e,i){},e.uniform2iv=function(t,e){},e.uniform3f=function(t,e,i,n){},e.uniform3fv=function(t,e){},e.uniform3i=function(t,e,i,n){},e.uniform3iv=function(t,e){},e.uniform4f=function(t,e,i,n,r){},e.uniform4fv=function(t,e){},e.uniform4i=function(t,e,i,n,r){},e.uniform4iv=function(t,e){},e.uniformMatrix2fv=function(t,e,i){},e.uniformMatrix3fv=function(t,e,i){},e.uniformMatrix4fv=function(t,e,i){},e.useProgram=function(t){},e.validateProgram=function(t){},e.vertexAttrib1f=function(t,e){},e.vertexAttrib1fv=function(t,e){},e.vertexAttrib2f=function(t,e,i){},e.vertexAttrib2fv=function(t,e){},e.vertexAttrib3f=function(t,e,i,n){},e.vertexAttrib3fv=function(t,e){},e.vertexAttrib4f=function(t,e,i,n,r){},e.vertexAttrib4fv=function(t,e){},e.vertexAttribPointer=function(t,e,i,n,r,s){},e.viewport=function(t,e,i,n){},e.configureBackBuffer=function(t,e,i,n,r){void 0===n&&(n=!0),void 0===r&&(r=!1)},e.compressedTexImage2D=function(t){},e.createVertexArray=function(){throw"not implemented"},e.bindVertexArray=function(t){throw"not implemented"},e.deleteVertexArray=function(t){throw"not implemented"},e.isVertexArray=function(t){throw"not implemented"},WebGLContext._forceSupportVAOPlatform=function(){return Y.onMiniGame&&Y.onIOS||Y.onBDMiniGame||Y.onQGMiniGame},WebGLContext.__init__=function(e){if(laya.webgl.WebGLContext._checkExtensions(e),!j._isWebGL2&&!K.isConchApp){t._setupVertexArrayObject&&(WebGLContext._forceSupportVAOPlatform()?t._forceSetupVertexArrayObject(e):t._setupVertexArrayObject(e));var i=(e.rawgl||e).getExtension("OES_vertex_array_object");if(i){var n=e;n.createVertexArray=function(){return i.createVertexArrayOES()},n.bindVertexArray=function(t){i.bindVertexArrayOES(t)},n.deleteVertexArray=function(t){i.deleteVertexArrayOES(t)},n.isVertexArray=function(t){i.isVertexArrayOES(t)}}}},WebGLContext._getExtension=function(t,e){var i=WebGLContext._extentionVendorPrefixes;for(var n in i){var r=t.getExtension(i[n]+e);if(r)return r}return null},WebGLContext._checkExtensions=function(t){WebGLContext._extTextureFilterAnisotropic=WebGLContext._getExtension(t,"EXT_texture_filter_anisotropic"),WebGLContext._compressedTextureS3tc=WebGLContext._getExtension(t,"WEBGL_compressed_texture_s3tc"),WebGLContext._compressedTexturePvrtc=WebGLContext._getExtension(t,"WEBGL_compressed_texture_pvrtc"),WebGLContext._compressedTextureEtc1=WebGLContext._getExtension(t,"WEBGL_compressed_texture_etc1"),WebGLContext._forceSupportVAOPlatform()||(WebGLContext._angleInstancedArrays=WebGLContext._getExtension(t,"ANGLE_instanced_arrays"))},WebGLContext.__init_native=function(){if(K.supportWebGLPlusRendering){var t=WebGLContext;t.activeTexture=t.activeTextureForNative,t.bindTexture=t.bindTextureForNative}},WebGLContext.useProgram=function(t,e){return WebGLContext._useProgram!==e&&(t.useProgram(e),WebGLContext._useProgram=e,!0)},WebGLContext.setDepthTest=function(t,e){e!==WebGLContext._depthTest&&(WebGLContext._depthTest=e,e?t.enable(2929):t.disable(2929))},WebGLContext.setDepthMask=function(t,e){e!==WebGLContext._depthMask&&(WebGLContext._depthMask=e,t.depthMask(e))},WebGLContext.setDepthFunc=function(t,e){e!==WebGLContext._depthFunc&&(WebGLContext._depthFunc=e,t.depthFunc(e))},WebGLContext.setBlend=function(t,e){e!==WebGLContext._blend&&(WebGLContext._blend=e,e?t.enable(3042):t.disable(3042))},WebGLContext.setBlendFunc=function(t,e,i){(e!==WebGLContext._sFactor||i!==WebGLContext._dFactor)&&(WebGLContext._sFactor=WebGLContext._srcAlpha=e,WebGLContext._dFactor=WebGLContext._dstAlpha=i,t.blendFunc(e,i))},WebGLContext.setBlendFuncSeperate=function(t,e,i,n,r){e===WebGLContext._sFactor&&i===WebGLContext._dFactor&&n===WebGLContext._srcAlpha&&r===WebGLContext._dstAlpha||(WebGLContext._sFactor=e,WebGLContext._dFactor=i,WebGLContext._srcAlpha=n,WebGLContext._dstAlpha=r,t.blendFuncSeparate(e,i,n,r))},WebGLContext.setCullFace=function(t,e){e!==WebGLContext._cullFace&&(WebGLContext._cullFace=e,e?t.enable(2884):t.disable(2884))},WebGLContext.setFrontFace=function(t,e){e!==WebGLContext._frontFace&&(WebGLContext._frontFace=e,t.frontFace(e))},WebGLContext.activeTexture=function(t,e){WebGLContext._activedTextureID!==e&&(t.activeTexture(e),WebGLContext._activedTextureID=e)},WebGLContext.bindTexture=function(t,e,i){WebGLContext._activeTextures[WebGLContext._activedTextureID-33984]!==i&&(t.bindTexture(e,i),WebGLContext._activeTextures[WebGLContext._activedTextureID-33984]=i)},WebGLContext.useProgramForNative=function(t,e){return t.useProgram(e),!0},WebGLContext.setDepthTestForNative=function(t,e){e?t.enable(2929):t.disable(2929)},WebGLContext.setDepthMaskForNative=function(t,e){t.depthMask(e)},WebGLContext.setDepthFuncForNative=function(t,e){t.depthFunc(e)},WebGLContext.setBlendForNative=function(t,e){e?t.enable(3042):t.disable(3042)},WebGLContext.setBlendFuncForNative=function(t,e,i){t.blendFunc(e,i)},WebGLContext.setCullFaceForNative=function(t,e){e?t.enable(2884):t.disable(2884)},WebGLContext.setFrontFaceForNative=function(t,e){t.frontFace(e)},WebGLContext.activeTextureForNative=function(t,e){t.activeTexture(e)},WebGLContext.bindTextureForNative=function(t,e,i){t.bindTexture(e,i)},WebGLContext.bindVertexArrayForNative=function(t,e){t.bindVertexArray(e)},WebGLContext.DEPTH_BUFFER_BIT=256,WebGLContext.STENCIL_BUFFER_BIT=1024,WebGLContext.COLOR_BUFFER_BIT=16384,WebGLContext.POINTS=0,WebGLContext.LINES=1,WebGLContext.LINE_LOOP=2,WebGLContext.LINE_STRIP=3,WebGLContext.TRIANGLES=4,WebGLContext.TRIANGLE_STRIP=5,WebGLContext.TRIANGLE_FAN=6,WebGLContext.ZERO=0,WebGLContext.ONE=1,WebGLContext.SRC_COLOR=768,WebGLContext.ONE_MINUS_SRC_COLOR=769,WebGLContext.SRC_ALPHA=770,WebGLContext.ONE_MINUS_SRC_ALPHA=771,WebGLContext.DST_ALPHA=772,WebGLContext.ONE_MINUS_DST_ALPHA=773,WebGLContext.DST_COLOR=774,WebGLContext.ONE_MINUS_DST_COLOR=775,WebGLContext.SRC_ALPHA_SATURATE=776,WebGLContext.FUNC_ADD=32774,WebGLContext.BLEND_EQUATION=32777,WebGLContext.BLEND_EQUATION_RGB=32777,WebGLContext.BLEND_EQUATION_ALPHA=34877,WebGLContext.FUNC_SUBTRACT=32778,WebGLContext.FUNC_REVERSE_SUBTRACT=32779,WebGLContext.BLEND_DST_RGB=32968,WebGLContext.BLEND_SRC_RGB=32969,WebGLContext.BLEND_DST_ALPHA=32970,WebGLContext.BLEND_SRC_ALPHA=32971,WebGLContext.CONSTANT_COLOR=32769,WebGLContext.ONE_MINUS_CONSTANT_COLOR=32770,WebGLContext.CONSTANT_ALPHA=32771,WebGLContext.ONE_MINUS_CONSTANT_ALPHA=32772,WebGLContext.BLEND_COLOR=32773,WebGLContext.ARRAY_BUFFER=34962,WebGLContext.ELEMENT_ARRAY_BUFFER=34963,WebGLContext.ARRAY_BUFFER_BINDING=34964,WebGLContext.ELEMENT_ARRAY_BUFFER_BINDING=34965,WebGLContext.STREAM_DRAW=35040,WebGLContext.STATIC_DRAW=35044,WebGLContext.DYNAMIC_DRAW=35048,WebGLContext.BUFFER_SIZE=34660,WebGLContext.BUFFER_USAGE=34661,WebGLContext.CURRENT_VERTEX_ATTRIB=34342,WebGLContext.FRONT=1028,WebGLContext.BACK=1029,WebGLContext.CULL_FACE=2884,WebGLContext.FRONT_AND_BACK=1032,WebGLContext.BLEND=3042,WebGLContext.DITHER=3024,WebGLContext.STENCIL_TEST=2960,WebGLContext.DEPTH_TEST=2929,WebGLContext.SCISSOR_TEST=3089,WebGLContext.POLYGON_OFFSET_FILL=32823,WebGLContext.SAMPLE_ALPHA_TO_COVERAGE=32926,WebGLContext.SAMPLE_COVERAGE=32928,WebGLContext.NO_ERROR=0,WebGLContext.INVALID_ENUM=1280,WebGLContext.INVALID_VALUE=1281,WebGLContext.INVALID_OPERATION=1282,WebGLContext.OUT_OF_MEMORY=1285,WebGLContext.CW=2304,WebGLContext.CCW=2305,WebGLContext.LINE_WIDTH=2849,WebGLContext.ALIASED_POINT_SIZE_RANGE=33901,WebGLContext.ALIASED_LINE_WIDTH_RANGE=33902,WebGLContext.CULL_FACE_MODE=2885,WebGLContext.FRONT_FACE=2886,WebGLContext.DEPTH_RANGE=2928,WebGLContext.DEPTH_WRITEMASK=2930,WebGLContext.DEPTH_CLEAR_VALUE=2931,WebGLContext.DEPTH_FUNC=2932,WebGLContext.STENCIL_CLEAR_VALUE=2961,WebGLContext.STENCIL_FUNC=2962,WebGLContext.STENCIL_FAIL=2964,WebGLContext.STENCIL_PASS_DEPTH_FAIL=2965,WebGLContext.STENCIL_PASS_DEPTH_PASS=2966,WebGLContext.STENCIL_REF=2967,WebGLContext.STENCIL_VALUE_MASK=2963,WebGLContext.STENCIL_WRITEMASK=2968,WebGLContext.STENCIL_BACK_FUNC=34816,WebGLContext.STENCIL_BACK_FAIL=34817,WebGLContext.STENCIL_BACK_PASS_DEPTH_FAIL=34818,WebGLContext.STENCIL_BACK_PASS_DEPTH_PASS=34819,WebGLContext.STENCIL_BACK_REF=36003,WebGLContext.STENCIL_BACK_VALUE_MASK=36004,WebGLContext.STENCIL_BACK_WRITEMASK=36005,WebGLContext.VIEWPORT=2978,WebGLContext.SCISSOR_BOX=3088,WebGLContext.COLOR_CLEAR_VALUE=3106,WebGLContext.COLOR_WRITEMASK=3107,WebGLContext.UNPACK_ALIGNMENT=3317,WebGLContext.PACK_ALIGNMENT=3333,WebGLContext.MAX_TEXTURE_SIZE=3379,WebGLContext.MAX_VIEWPORT_DIMS=3386,WebGLContext.SUBPIXEL_BITS=3408,WebGLContext.RED_BITS=3410,WebGLContext.GREEN_BITS=3411,WebGLContext.BLUE_BITS=3412,WebGLContext.ALPHA_BITS=3413,WebGLContext.DEPTH_BITS=3414,WebGLContext.STENCIL_BITS=3415,WebGLContext.POLYGON_OFFSET_UNITS=10752,WebGLContext.POLYGON_OFFSET_FACTOR=32824,WebGLContext.TEXTURE_BINDING_2D=32873,WebGLContext.SAMPLE_BUFFERS=32936,WebGLContext.SAMPLES=32937,WebGLContext.SAMPLE_COVERAGE_VALUE=32938,WebGLContext.SAMPLE_COVERAGE_INVERT=32939,WebGLContext.NUM_COMPRESSED_TEXTURE_FORMATS=34466,WebGLContext.COMPRESSED_TEXTURE_FORMATS=34467,WebGLContext.DONT_CARE=4352,WebGLContext.FASTEST=4353,WebGLContext.NICEST=4354,WebGLContext.GENERATE_MIPMAP_HINT=33170,WebGLContext.BYTE=5120,WebGLContext.UNSIGNED_BYTE=5121,WebGLContext.SHORT=5122,WebGLContext.UNSIGNED_SHORT=5123,WebGLContext.INT=5124,WebGLContext.UNSIGNED_INT=5125,WebGLContext.FLOAT=5126,WebGLContext.DEPTH_COMPONENT=6402,WebGLContext.ALPHA=6406,WebGLContext.RGB=6407,WebGLContext.RGBA=6408,WebGLContext.LUMINANCE=6409,WebGLContext.LUMINANCE_ALPHA=6410,WebGLContext.UNSIGNED_SHORT_4_4_4_4=32819,WebGLContext.UNSIGNED_SHORT_5_5_5_1=32820,WebGLContext.UNSIGNED_SHORT_5_6_5=33635,WebGLContext.FRAGMENT_SHADER=35632,WebGLContext.VERTEX_SHADER=35633,WebGLContext.MAX_VERTEX_ATTRIBS=34921,WebGLContext.MAX_VERTEX_UNIFORM_VECTORS=36347,WebGLContext.MAX_VARYING_VECTORS=36348,WebGLContext.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661,WebGLContext.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660,WebGLContext.MAX_TEXTURE_IMAGE_UNITS=34930,WebGLContext.MAX_FRAGMENT_UNIFORM_VECTORS=36349,WebGLContext.SHADER_TYPE=35663,WebGLContext.DELETE_STATUS=35712,WebGLContext.LINK_STATUS=35714,WebGLContext.VALIDATE_STATUS=35715,WebGLContext.ATTACHED_SHADERS=35717,WebGLContext.ACTIVE_UNIFORMS=35718,WebGLContext.ACTIVE_ATTRIBUTES=35721,WebGLContext.SHADING_LANGUAGE_VERSION=35724,WebGLContext.CURRENT_PROGRAM=35725,WebGLContext.NEVER=512,WebGLContext.LESS=513,WebGLContext.EQUAL=514,WebGLContext.LEQUAL=515,WebGLContext.GREATER=516,WebGLContext.NOTEQUAL=517,WebGLContext.GEQUAL=518,WebGLContext.ALWAYS=519,WebGLContext.KEEP=7680,WebGLContext.REPLACE=7681,WebGLContext.INCR=7682,WebGLContext.DECR=7683,WebGLContext.INVERT=5386,WebGLContext.INCR_WRAP=34055,WebGLContext.DECR_WRAP=34056,WebGLContext.VENDOR=7936,WebGLContext.RENDERER=7937,WebGLContext.VERSION=7938,WebGLContext.NEAREST=9728,WebGLContext.LINEAR=9729,WebGLContext.NEAREST_MIPMAP_NEAREST=9984,WebGLContext.LINEAR_MIPMAP_NEAREST=9985,WebGLContext.NEAREST_MIPMAP_LINEAR=9986,WebGLContext.LINEAR_MIPMAP_LINEAR=9987,WebGLContext.TEXTURE_MAG_FILTER=10240,WebGLContext.TEXTURE_MIN_FILTER=10241,WebGLContext.TEXTURE_WRAP_S=10242,WebGLContext.TEXTURE_WRAP_T=10243,WebGLContext.TEXTURE_2D=3553,WebGLContext.TEXTURE_3D=32879,WebGLContext.TEXTURE=5890,WebGLContext.TEXTURE_CUBE_MAP=34067,WebGLContext.TEXTURE_BINDING_CUBE_MAP=34068,WebGLContext.TEXTURE_CUBE_MAP_POSITIVE_X=34069,WebGLContext.TEXTURE_CUBE_MAP_NEGATIVE_X=34070,WebGLContext.TEXTURE_CUBE_MAP_POSITIVE_Y=34071,WebGLContext.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072,WebGLContext.TEXTURE_CUBE_MAP_POSITIVE_Z=34073,WebGLContext.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074,WebGLContext.MAX_CUBE_MAP_TEXTURE_SIZE=34076,WebGLContext.TEXTURE0=33984,WebGLContext.TEXTURE1=33985,WebGLContext.TEXTURE2=33986,WebGLContext.TEXTURE3=33987,WebGLContext.TEXTURE4=33988,WebGLContext.TEXTURE5=33989,WebGLContext.TEXTURE6=33990,WebGLContext.TEXTURE7=33991,WebGLContext.TEXTURE8=33992,WebGLContext.TEXTURE9=33993,WebGLContext.TEXTURE10=33994,WebGLContext.TEXTURE11=33995,WebGLContext.TEXTURE12=33996,WebGLContext.TEXTURE13=33997,WebGLContext.TEXTURE14=33998,WebGLContext.TEXTURE15=33999,WebGLContext.TEXTURE16=34e3,WebGLContext.TEXTURE17=34001,WebGLContext.TEXTURE18=34002,WebGLContext.TEXTURE19=34003,WebGLContext.TEXTURE20=34004,WebGLContext.TEXTURE21=34005,WebGLContext.TEXTURE22=34006,WebGLContext.TEXTURE23=34007,WebGLContext.TEXTURE24=34008,WebGLContext.TEXTURE25=34009,WebGLContext.TEXTURE26=34010,WebGLContext.TEXTURE27=34011,WebGLContext.TEXTURE28=34012,WebGLContext.TEXTURE29=34013,WebGLContext.TEXTURE30=34014,WebGLContext.TEXTURE31=34015,WebGLContext.ACTIVE_TEXTURE=34016,WebGLContext.REPEAT=10497,WebGLContext.CLAMP_TO_EDGE=33071,WebGLContext.MIRRORED_REPEAT=33648,WebGLContext.FLOAT_VEC2=35664,WebGLContext.FLOAT_VEC3=35665,WebGLContext.FLOAT_VEC4=35666,WebGLContext.INT_VEC2=35667,WebGLContext.INT_VEC3=35668,WebGLContext.INT_VEC4=35669,WebGLContext.BOOL=35670,WebGLContext.BOOL_VEC2=35671,WebGLContext.BOOL_VEC3=35672,WebGLContext.BOOL_VEC4=35673,WebGLContext.FLOAT_MAT2=35674,WebGLContext.FLOAT_MAT3=35675,WebGLContext.FLOAT_MAT4=35676,WebGLContext.SAMPLER_2D=35678,WebGLContext.SAMPLER_CUBE=35680,WebGLContext.VERTEX_ATTRIB_ARRAY_ENABLED=34338,WebGLContext.VERTEX_ATTRIB_ARRAY_SIZE=34339,WebGLContext.VERTEX_ATTRIB_ARRAY_STRIDE=34340,WebGLContext.VERTEX_ATTRIB_ARRAY_TYPE=34341,WebGLContext.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922,WebGLContext.VERTEX_ATTRIB_ARRAY_POINTER=34373,WebGLContext.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975,WebGLContext.COMPILE_STATUS=35713,WebGLContext.LOW_FLOAT=36336,WebGLContext.MEDIUM_FLOAT=36337,WebGLContext.HIGH_FLOAT=36338,WebGLContext.LOW_INT=36339,WebGLContext.MEDIUM_INT=36340,WebGLContext.HIGH_INT=36341,WebGLContext.FRAMEBUFFER=36160,WebGLContext.RENDERBUFFER=36161,WebGLContext.RGBA4=32854,WebGLContext.RGB5_A1=32855,WebGLContext.RGB565=36194,WebGLContext.DEPTH_COMPONENT16=33189,WebGLContext.STENCIL_INDEX=6401,WebGLContext.STENCIL_INDEX8=36168,WebGLContext.DEPTH_STENCIL=34041,WebGLContext.RENDERBUFFER_WIDTH=36162,WebGLContext.RENDERBUFFER_HEIGHT=36163,WebGLContext.RENDERBUFFER_INTERNAL_FORMAT=36164,WebGLContext.RENDERBUFFER_RED_SIZE=36176,WebGLContext.RENDERBUFFER_GREEN_SIZE=36177,WebGLContext.RENDERBUFFER_BLUE_SIZE=36178,WebGLContext.RENDERBUFFER_ALPHA_SIZE=36179,WebGLContext.RENDERBUFFER_DEPTH_SIZE=36180,WebGLContext.RENDERBUFFER_STENCIL_SIZE=36181,WebGLContext.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048,WebGLContext.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049,WebGLContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050,WebGLContext.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051,WebGLContext.COLOR_ATTACHMENT0=36064,WebGLContext.DEPTH_ATTACHMENT=36096,WebGLContext.STENCIL_ATTACHMENT=36128,WebGLContext.DEPTH_STENCIL_ATTACHMENT=33306,WebGLContext.NONE=0,WebGLContext.FRAMEBUFFER_COMPLETE=36053,WebGLContext.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054,WebGLContext.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055,WebGLContext.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057,WebGLContext.FRAMEBUFFER_UNSUPPORTED=36061,WebGLContext.FRAMEBUFFER_BINDING=36006,WebGLContext.RENDERBUFFER_BINDING=36007,WebGLContext.MAX_RENDERBUFFER_SIZE=34024,WebGLContext.INVALID_FRAMEBUFFER_OPERATION=1286,WebGLContext.UNPACK_FLIP_Y_WEBGL=37440,WebGLContext.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441,WebGLContext.CONTEXT_LOST_WEBGL=37442,WebGLContext.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443,WebGLContext.BROWSER_DEFAULT_WEBGL=37444,WebGLContext._extTextureFilterAnisotropic=null,WebGLContext._compressedTextureS3tc=null,WebGLContext._compressedTexturePvrtc=null,WebGLContext._compressedTextureEtc1=null,WebGLContext._angleInstancedArrays=null,WebGLContext._glTextureIDs=[33984,33985,33986,33987,33988,33989,33990,33991],WebGLContext._useProgram=null,WebGLContext._depthTest=!0,WebGLContext._depthMask=!0,WebGLContext._blend=!1,WebGLContext._cullFace=!1,WebGLContext._activedTextureID=33984,n(WebGLContext,["_extentionVendorPrefixes",function(){return this._extentionVendorPrefixes=["","WEBKIT_","MOZ_"]},"_activeTextures",function(){return this._activeTextures=new Array(8)},"_depthFunc",function(){return this._depthFunc=513},"_sFactor",function(){return this._sFactor=1},"_dFactor",function(){return this._dFactor=0},"_srcAlpha",function(){return this._srcAlpha=1},"_dstAlpha",function(){return this._dstAlpha=0},"_frontFace",function(){return this._frontFace=2305}]),WebGLContext}(),Qt=(function(){function SpriteConst(){}r(SpriteConst,"laya.display.SpriteConst"),SpriteConst.ALPHA=1,SpriteConst.TRANSFORM=2,SpriteConst.BLEND=4,SpriteConst.CANVAS=8,SpriteConst.FILTERS=16,SpriteConst.MASK=32,SpriteConst.CLIP=64,SpriteConst.STYLE=128,SpriteConst.TEXTURE=256,SpriteConst.GRAPHICS=512,SpriteConst.LAYAGL3D=1024,SpriteConst.CUSTOM=2048,SpriteConst.ONECHILD=4096,SpriteConst.CHILDS=8192,SpriteConst.REPAINT_NONE=0,SpriteConst.REPAINT_NODE=1,SpriteConst.REPAINT_CACHE=2,SpriteConst.REPAINT_ALL=3}(),function(){function DrawLinesCmd(){}r(DrawLinesCmd,"laya.display.cmd.DrawLinesCmd");var t=DrawLinesCmd.prototype;return t.recover=function(){this.points=null,this.lineColor=null,re.recover("DrawLinesCmd",this)},t.run=function(t,e,i){t._drawLines(this.x+e,this.y+i,this.points,this.lineColor,this.lineWidth,this.vid)},s(0,t,"cmdID",function(){return"DrawLines"}),DrawLinesCmd.create=function(t,e,i,n,r,s){var a=re.getItemByClass("DrawLinesCmd",DrawLinesCmd);return a.x=t,a.y=e,a.points=i,a.lineColor=n,a.lineWidth=r,a.vid=s,a},DrawLinesCmd.ID="DrawLines",DrawLinesCmd}()),$t=function(){function GrahamScan(){}return r(GrahamScan,"laya.maths.GrahamScan"),GrahamScan.multiply=function(t,e,i){return(t.x-i.x)*(e.y-i.y)-(e.x-i.x)*(t.y-i.y)},GrahamScan.dis=function(t,e){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)},GrahamScan._getPoints=function(t,e,i){for(void 0===e&&(e=!1),GrahamScan._mPointList||(GrahamScan._mPointList=[]);GrahamScan._mPointList.length=0;r--)n=(e=t[r]).x+"_"+e.y,h.hasOwnProperty(n)||(h[n]=!0,i.push(e));for(o=i.length,St.copyArray(t,i),r=1;r0||0==GrahamScan.multiply(t[s],t[a],t[0])&&GrahamScan.dis(t[0],t[s])=2&&GrahamScan.multiply(t[r],i[i.length-1],i[i.length-2])>=0;)i.pop();t[r]&&i.push(t[r])}return i},GrahamScan._mPointList=null,GrahamScan._tempPointList=[],GrahamScan._temPList=[],GrahamScan._temArr=[],GrahamScan}(),qt=function(){function WordText(){this.id=NaN,this.save=[],this.toUpperCase=null,this.changed=!1,this._text=null,this.width=-1,this.pageChars=[],this.startID=0,this.startIDStroke=0,this.lastGCCnt=0,this.splitRender=!1}r(WordText,"laya.utils.WordText");var t=WordText.prototype;return t.setText=function(t){this.changed=!0,this._text=t,this.width=-1,this.cleanCache()},t.toString=function(){return this._text},t.charCodeAt=function(t){return this._text?this._text.charCodeAt(t):NaN},t.charAt=function(t){return this._text?this._text.charAt(t):null},t.cleanCache=function(){this.pageChars.forEach(function(t){var e=t.tex;t.words;1==t.words.length&&e&&e.ri&&e.destroy()}),this.pageChars=[],this.startID=0},s(0,t,"length",function(){return this._text?this._text.length:0}),WordText}(),Zt=function(){function SaveTransform(){this._matrix=new U}r(SaveTransform,"laya.webgl.canvas.save.SaveTransform");var t=SaveTransform.prototype;return i.imps(t,{"laya.webgl.canvas.save.ISaveData":!0}),t.isSaveMark=function(){return!1},t.restore=function(t){t._curMat=this._savematrix,SaveTransform.POOL[SaveTransform.POOL._length++]=this},SaveTransform.save=function(t){var e=t._saveMark;if(2048!=(2048&e._saveuse)){e._saveuse|=2048;var i=SaveTransform.POOL,n=i._length>0?i[--i._length]:new SaveTransform;n._savematrix=t._curMat,t._curMat=t._curMat.copyTo(n._matrix);var r=t._save;r[r._length++]=n}},SaveTransform.POOL=h._createArray(),SaveTransform}(),Jt=function(){function ShaderCompile(t,e,i,n){this._clearCR=new RegExp("\r","g");var r=this;function _compile(t){t=t.replace(r._clearCR,"");var e=[],i=new q(e);return r._compileToTree(i,t.split("\n"),0,e,n),i}var s=Y.now();this._VS=_compile(t),this._PS=_compile(e),this._nameMap=i,Y.now()-s>2&&console.log("ShaderCompile use time:"+(Y.now()-s)+" size:"+t.length+"/"+e.length)}r(ShaderCompile,"laya.webgl.utils.ShaderCompile");var t=ShaderCompile.prototype;return t._compileToTree=function(t,e,i,n,r){var s,a,o,h,u,l,c,_=0,d=0,f=0,p=0;for(d=i;d=0&&(o=o.substr(0,_)),s=c||new q(n),c=null,s.text=o,s.noCompile=!0,(_=o.indexOf("#"))>=0){for(h="#",p=_+1,f=o.length;p]/),s.noCompile?console.log("function():Boolean{return "+o.substr(_+s.name.length)+"}"):(l=o.replace(/^\s*/,"").split(/\s+/),s.setCondition(l[1],"#ifdef"===h?1:2),s.text="//"+s.text),s.setParent(t),t=s,r)for(l=o.substr(p).split(ShaderCompile._splitToWordExps3),p=0;p0&&ShaderCompile.splitToWords(o,a),c=s,a.text+="\n"+o;continue}n.length>0&&ShaderCompile.splitToWords(o,s)}s.setParent(t)}},t.createShader=function(t,e,i,n){var r={},s="";if(t)for(var a in t)s+="#define "+a+"\n",r[a]=!0;var o=this._VS.toscript(r,[]),h=this._PS.toscript(r,[]);return(i||ii.create)(s+o.join("\n"),s+h.join("\n"),e,this._nameMap,n)},ShaderCompile._parseOne=function(t,e,i,n,r,s){var a={type:ShaderCompile.shaderParamsMap[i[n+1]],name:i[n+2],size:isNaN(parseInt(i[n+3]))?1:parseInt(i[n+3])};return s&&("attribute"==r?t.push(a):e.push(a)),":"==i[n+3]&&(a.type=i[n+4],n+=2),n+=2},ShaderCompile.addInclude=function(t,e){if(!e||0===e.length)throw new Error("add shader include file err:"+t);if(ShaderCompile.includes[t])throw new Error("add shader include file err, has add:"+t);ShaderCompile.includes[t]=new he(e)},ShaderCompile.preGetParams=function(t,e){var i=[t,e],n={},r=[],s=[],a={},o=[];n.attributes=r,n.uniforms=s,n.defines=a;for(var h=0,u=0,l=0;l<2;l++){i[l]=i[l].replace(ShaderCompile._removeAnnotation,"");var c,_=i[l].match(ShaderCompile._reg);for(h=0,u=_.length;h()'\",;".indexOf(i)>=0){if(s>=0&&a-s>1&&(n=t.substr(s,a-s),r.push(n)),'"'==i||"'"==i){var h=t.indexOf(i,a+1);if(h<0)throw"Sharder err:"+t;r.push(t.substr(a+1,h-a-1)),a=h,s=-1;continue}"("==i&&e&&r.length>0&&(n=r[r.length-1]+";","vec4;main;".indexOf(n)<0&&(e.useFuns+=n)),s=-1}else s<0&&(s=a);return s1&&(n=t.substr(s,o-s),r.push(n)),r},ShaderCompile.IFDEF_NO=0,ShaderCompile.IFDEF_YES=1,ShaderCompile.IFDEF_ELSE=2,ShaderCompile.IFDEF_PARENT=3,ShaderCompile._removeAnnotation=new RegExp("(/\\*([^*]|[\\r\\\n]|(\\*+([^*/]|[\\r\\n])))*\\*+/)|(//.*)","g"),ShaderCompile._reg=new RegExp("(\".*\")|('.*')|([#\\w\\*-\\.+/()=<>{}\\\\]+)|([,;:\\\\])","g"),ShaderCompile._splitToWordExps=new RegExp("[(\".*\")]+|[('.*')]+|([ \\t=\\+\\-*/&%!<>!%(),;])","g"),ShaderCompile.includes={},n(ShaderCompile,["shaderParamsMap",function(){return this.shaderParamsMap={float:5126,int:5124,bool:35670,vec2:35664,vec3:35665,vec4:35666,ivec2:35667,ivec3:35668,ivec4:35669,bvec2:35671,bvec3:35672,bvec4:35673,mat2:35674,mat3:35675,mat4:35676,sampler2D:35678,samplerCube:35680}},"_splitToWordExps3",function(){return this._splitToWordExps3=new RegExp("[ \\t=\\+\\-*/&%!<>!%(),;\\|]","g")}]),ShaderCompile}(),te=(function(){function PoolCache(){this.sign=null,this.maxCount=1e3}r(PoolCache,"laya.utils.PoolCache");var t=PoolCache.prototype;t.getCacheList=function(){return re.getPoolBySign(this.sign)},t.tryDispose=function(t){var e;(e=re.getPoolBySign(this.sign)).length>this.maxCount&&e.splice(this.maxCount,e.length-this.maxCount)},PoolCache.addPoolCacheManager=function(t,e){var i;void 0===e&&(e=100),(i=new PoolCache).sign=t,i.maxCount=e,ae.regCacheByFunction(St.bind(i.tryDispose,i),St.bind(i.getCacheList,i))}}(),function(){function ClipRectCmd(){}r(ClipRectCmd,"laya.display.cmd.ClipRectCmd");var t=ClipRectCmd.prototype;return t.recover=function(){re.recover("ClipRectCmd",this)},t.run=function(t,e,i){t.clipRect(this.x+e,this.y+i,this.width,this.height)},s(0,t,"cmdID",function(){return"ClipRect"}),ClipRectCmd.create=function(t,e,i,n){var r=re.getItemByClass("ClipRectCmd",ClipRectCmd);return r.x=t,r.y=e,r.width=i,r.height=n,r},ClipRectCmd.ID="ClipRect",ClipRectCmd}()),ee=(function(){function ShaderValue(){}r(ShaderValue,"laya.webgl.shader.ShaderValue")}(),function(){function DrawPolyCmd(){}r(DrawPolyCmd,"laya.display.cmd.DrawPolyCmd");var t=DrawPolyCmd.prototype;return t.recover=function(){this.points=null,this.fillColor=null,this.lineColor=null,re.recover("DrawPolyCmd",this)},t.run=function(t,e,i){t._drawPoly(this.x+e,this.y+i,this.points,this.fillColor,this.lineColor,this.lineWidth,this.isConvexPolygon,this.vid)},s(0,t,"cmdID",function(){return"DrawPoly"}),DrawPolyCmd.create=function(t,e,i,n,r,s,a,o){var h=re.getItemByClass("DrawPolyCmd",DrawPolyCmd);return h.x=t,h.y=e,h.points=i,h.fillColor=n,h.lineColor=r,h.lineWidth=s,h.isConvexPolygon=a,h.vid=o,h},DrawPolyCmd.ID="DrawPoly",DrawPolyCmd}()),ie=function(){function MathUtil(){}return r(MathUtil,"laya.maths.MathUtil"),MathUtil.subtractVector3=function(t,e,i){i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2]},MathUtil.lerp=function(t,e,i){return t*(1-i)+e*i},MathUtil.scaleVector3=function(t,e,i){i[0]=t[0]*e,i[1]=t[1]*e,i[2]=t[2]*e},MathUtil.lerpVector3=function(t,e,i,n){var r=t[0],s=t[1],a=t[2];n[0]=r+i*(e[0]-r),n[1]=s+i*(e[1]-s),n[2]=a+i*(e[2]-a)},MathUtil.lerpVector4=function(t,e,i,n){var r=t[0],s=t[1],a=t[2],o=t[3];n[0]=r+i*(e[0]-r),n[1]=s+i*(e[1]-s),n[2]=a+i*(e[2]-a),n[3]=o+i*(e[3]-o)},MathUtil.slerpQuaternionArray=function(t,e,i,n,r,s,a){var o,h,u,l,c,_=t[e+0],d=t[e+1],f=t[e+2],p=t[e+3],m=i[n+0],g=i[n+1],v=i[n+2],x=i[n+3];return(h=_*m+d*g+f*v+p*x)<0&&(h=-h,m=-m,g=-g,v=-v,x=-x),1-h>1e-6?(o=Math.acos(h),u=Math.sin(o),l=Math.sin((1-r)*o)/u,c=Math.sin(r*o)/u):(l=1-r,c=r),s[a+0]=l*_+c*m,s[a+1]=l*d+c*g,s[a+2]=l*f+c*v,s[a+3]=l*p+c*x,s},MathUtil.getRotation=function(t,e,i,n){return Math.atan2(n-e,i-t)/Math.PI*180},MathUtil.sortBigFirst=function(t,e){return t==e?0:e>t?1:-1},MathUtil.sortSmallFirst=function(t,e){return t==e?0:e>t?-1:1},MathUtil.sortNumBigFirst=function(t,e){return parseFloat(e)-parseFloat(t)},MathUtil.sortNumSmallFirst=function(t,e){return parseFloat(t)-parseFloat(e)},MathUtil.sortByKey=function(t,e,i){var n;return void 0===e&&(e=!1),void 0===i&&(i=!0),n=e?i?MathUtil.sortNumBigFirst:MathUtil.sortBigFirst:i?MathUtil.sortNumSmallFirst:MathUtil.sortSmallFirst,function(e,i){return n(e[t],i[t])}},MathUtil}(),ne=function(){function RestoreCmd(){}r(RestoreCmd,"laya.display.cmd.RestoreCmd");var t=RestoreCmd.prototype;return t.recover=function(){re.recover("RestoreCmd",this)},t.run=function(t,e,i){t.restore()},s(0,t,"cmdID",function(){return"Restore"}),RestoreCmd.create=function(){return re.getItemByClass("RestoreCmd",RestoreCmd)},RestoreCmd.ID="Restore",RestoreCmd}(),re=function(){function Pool(){}return r(Pool,"laya.utils.Pool"),Pool.getPoolBySign=function(t){return Pool._poolDic[t]||(Pool._poolDic[t]=[])},Pool.clearBySign=function(t){Pool._poolDic[t]&&(Pool._poolDic[t].length=0)},Pool.recover=function(t,e){e.__InPool||(e.__InPool=!0,Pool.getPoolBySign(t).push(e))},Pool.recoverByClass=function(t){if(t){var e=t.__className||t.constructor._$gid;e&&Pool.recover(e,t)}},Pool._getClassSign=function(t){var e=t.__className||t._$gid;return e||(t._$gid=e=St.getGID()+""),e},Pool.createByClass=function(t){return Pool.getItemByClass(Pool._getClassSign(t),t)},Pool.getItemByClass=function(t,e){if(!Pool._poolDic[t])return new e;var i=Pool.getPoolBySign(t);if(i.length){var n=i.pop();n.__InPool=!1}else n=new e;return n},Pool.getItemByCreateFun=function(t,e,i){var n=Pool.getPoolBySign(t),r=n.length?n.pop():e.call(i);return r.__InPool=!1,r},Pool.getItem=function(t){var e=Pool.getPoolBySign(t),i=e.length?e.pop():null;return i&&(i.__InPool=!1),i},Pool.POOLSIGN="__InPool",Pool._poolDic={},Pool}(),se=function(){function FillBorderWordsCmd(){}r(FillBorderWordsCmd,"laya.display.cmd.FillBorderWordsCmd");var t=FillBorderWordsCmd.prototype;return t.recover=function(){this.words=null,re.recover("FillBorderWordsCmd",this)},t.run=function(t,e,i){t.fillBorderWords(this.words,this.x+e,this.y+i,this.font,this.fillColor,this.borderColor,this.lineWidth)},s(0,t,"cmdID",function(){return"FillBorderWords"}),FillBorderWordsCmd.create=function(t,e,i,n,r,s,a){var o=re.getItemByClass("FillBorderWordsCmd",FillBorderWordsCmd);return o.words=t,o.x=e,o.y=i,o.font=n,o.fillColor=r,o.borderColor=s,o.lineWidth=a,o},FillBorderWordsCmd.ID="FillBorderWords",FillBorderWordsCmd}(),ae=function(){function CacheManger(){}return r(CacheManger,"laya.utils.CacheManger"),CacheManger.regCacheByFunction=function(t,e){var i;CacheManger.unRegCacheByFunction(t,e),i={tryDispose:t,getCacheList:e},CacheManger._cacheList.push(i)},CacheManger.unRegCacheByFunction=function(t,e){var i,n=0;for(i=CacheManger._cacheList.length,n=0;n0&&(CacheManger._index++,CacheManger._index=CacheManger._index%e,t[CacheManger._index].tryDispose(!1),!(Y.now()-i>CacheManger.loopTimeLimit));)n--}},CacheManger.loopTimeLimit=2,CacheManger._cacheList=[],CacheManger._index=0,CacheManger}(),oe=function(){function TTFLoader(){this.fontName=null,this.complete=null,this.err=null,this._fontTxt=null,this._url=null,this._div=null,this._txtWidth=NaN,this._http=null}r(TTFLoader,"laya.net.TTFLoader");var t=TTFLoader.prototype;return t.load=function(t){this._url=t;var e=t.split(".ttf")[0].split("/");this.fontName=e[e.length-1],K.isConchApp?this._loadConch():Y.window.FontFace?this._loadWithFontFace():this._loadWithCSS()},t._loadConch=function(){this._http=new Ee,this._http.on("error",this,this._onErr),this._http.on("complete",this,this._onHttpLoaded),this._http.send(this._url,null,"get","arraybuffer")},t._onHttpLoaded=function(t){Y.window.conchTextCanvas.setFontFaceFromBuffer(this.fontName,t),this._clearHttp(),this._complete()},t._clearHttp=function(){this._http&&(this._http.off("error",this,this._onErr),this._http.off("complete",this,this._onHttpLoaded),this._http=null)},t._onErr=function(){this._clearHttp(),this.err&&(this.err.runWith("fail:"+this._url),this.err=null)},t._complete=function(){i.systemTimer.clear(this,this._complete),i.systemTimer.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)},t._checkComplete=function(){pe.measureText("LayaTTFFont",this._fontTxt).width!=this._txtWidth&&this._complete()},t._loadWithFontFace=function(){var t=new Y.window.FontFace(this.fontName,"url('"+this._url+"')");Y.window.document.fonts.add(t);var e=this;t.loaded.then(function(){e._complete()}),t.load()},t._createDiv=function(){this._div=Y.createElement("div"),this._div.innerHTML="laya";var t=this._div.style;t.fontFamily=this.fontName,t.position="absolute",t.left="-100px",t.top="-100px",Y.document.body.appendChild(this._div)},t._loadWithCSS=function(){var t=this,e=Y.createElement("style");e.type="text/css",Y.document.body.appendChild(e),e.textContent="@font-face { font-family:'"+this.fontName+"'; src:url('"+this._url+"');}",this._fontTxt="40px "+this.fontName,this._txtWidth=pe.measureText("LayaTTFFont",this._fontTxt).width;var n=this;e.onload=function(){i.systemTimer.once(1e4,n,t._complete)},i.systemTimer.loop(20,this,this._checkComplete),this._createDiv()},TTFLoader._testString="LayaTTFFont",TTFLoader}(),he=function(){function InlcudeFile(t){this.script=null,this.codes={},this.funs={},this.curUseID=-1,this.funnames="",this.script=t;for(var e=0,i=0,n=0;!((e=t.indexOf("#begin",e))<0);){for(n=e+5;!((n=t.indexOf("#end",n))<0)&&"i"===t.charAt(n+4);)n+=5;if(n<0)throw"add include err,no #end:"+t;i=t.indexOf("\n",e);var r=Jt.splitToWords(t.substr(e,i-e),null);"code"==r[1]?this.codes[r[2]]=t.substr(i+1,n-i-1):"function"==r[1]&&(i=t.indexOf("function",e),i+="function".length,this.funs[r[3]]=t.substr(i+1,n-i-1),this.funnames+=r[3]+";"),e=n+1}}r(InlcudeFile,"laya.webgl.utils.InlcudeFile");var t=InlcudeFile.prototype;return t.getWith=function(t){var e=t?this.codes[t]:this.script;if(!e)throw"get with error:"+t;return e},t.getFunsScript=function(t){var e="";for(var i in this.funs)t.indexOf(i+";")>=0&&(e+=this.funs[i]);return e},InlcudeFile}(),ue=(function(){function ResourceVersion(){}r(ResourceVersion,"laya.net.ResourceVersion"),ResourceVersion.enable=function(t,e,n){void 0===n&&(n=2),laya.net.ResourceVersion.type=n,i.loader.load(t,p.create(null,ResourceVersion.onManifestLoaded,[e]),null,"json"),Ut.customFormat=ResourceVersion.addVersionPrefix},ResourceVersion.onManifestLoaded=function(t,e){ResourceVersion.manifest=e,t.run(),e||console.warn("资源版本清单文件不存在,不使用资源版本管理。忽略ERR_FILE_NOT_FOUND错误。")},ResourceVersion.addVersionPrefix=function(t){return t=Ut.getAdptedFilePath(t),ResourceVersion.manifest&&ResourceVersion.manifest[t]?2==ResourceVersion.type?ResourceVersion.manifest[t]:ResourceVersion.manifest[t]+"/"+t:t},ResourceVersion.FOLDER_VERSION=1,ResourceVersion.FILENAME_VERSION=2,ResourceVersion.manifest=null,ResourceVersion.type=1}(),function(){function Event(){}r(Event,"laya.events.Event");var t=Event.prototype;return t.setTo=function(t,e,i){return this.type=t,this.currentTarget=e,this.target=i,this},t.stopPropagation=function(){this._stoped=!0},s(0,t,"stageY",function(){return i.stage.mouseY}),s(0,t,"charCode",function(){return this.nativeEvent.charCode}),s(0,t,"touches",function(){if(!this.nativeEvent)return null;var t=this.nativeEvent.touches;if(t)for(var e=i.stage,n=0,r=t.length;n=0;_--)c.set(o.subarray(f,f+l),d),d-=l,f+=l;var p=new hi(!0);return p.size(i,n),p.getContext("2d").putImageData(h,0,0),p},RunDriver.drawToTexture=function(t,e,i,n,r,s){r-=t.x,s-=t.y,r|=0,s|=0,i|=0,n|=0;var a=new me;a.size(i,n),a.asBitmap=!0,a._targets.start(),u.renders[e]._fun(t,a,r,s),a.flush(),a._targets.end(),a._targets.restore();var o=new Fe(a._targets,Fe.INV_UV);return a.destroy(!0),o},RunDriver.changeWebGLSize=function(t,e){j.onStageResize(t,e)},RunDriver.clear=function(t){me.set2DRenderConfig(),tt.worldScissorTest&&j.mainContext.disable(3089);var e=K.context,n=0==e._submits._length||Rt.preserveDrawingBuffer?o.create(t).arrColor:i.stage._wgColor;n?e.clearBG(n[0],n[1],n[2],n[3]):e.clearBG(0,0,0,0),tt.clear()},RunDriver.enableNative=null,n(RunDriver,["hanzi",function(){return this.hanzi=new RegExp("^[一-龥]$")}]),RunDriver}(),me=function(){var t;function Context(){if(this._drawTriUseAbsMatrix=!1,this._id=++Context._COUNT,this._other=null,this._renderNextSubmitIndex=0,this._path=null,this._drawCount=1,this._renderCount=0,this._isConvexCmd=!0,this._submits=null,this._curSubmit=null,this._mesh=null,this._pathMesh=null,this._triangleMesh=null,this.meshlist=[],this._clipInCache=!1,this._clipInfoID=0,this._curMat=null,this._lastMatScaleX=1,this._lastMatScaleY=1,this._lastMat_a=1,this._lastMat_b=0,this._lastMat_c=0,this._lastMat_d=1,this._nBlendType=0,this._save=null,this._targets=null,this._charSubmitCache=null,this._saveMark=null,this.sprite=null,this._italicDeg=0,this._lastTex=null,this._fillColor=0,this._flushCnt=0,this.defTexture=null,this._colorFiler=null,this.drawTexAlign=!1,this._incache=!1,this.isMain=!1,this._tmpMatrix=new U,this._drawTexToDrawTri_Vert=new Float32Array(8),this._drawTexToDrawTri_Index=new Uint16Array([0,1,2,0,2,3]),this._tempUV=new Float32Array(8),this._width=99999999,this._height=99999999,this._submitKey=new _e,this._transedPoints=new Array(8),this._temp4Points=new Array(8),this._clipRect=Context.MAXCLIPRECT,this._globalClipMatrix=new U(99999999,0,0,99999999,0,0),this._shader2D=new W,Context._contextcount++,!this.defTexture){var t=new _i(2,2);t.setPixels(new Uint8Array(16)),t.lock=!0,this.defTexture=new Fe(t)}this._lastTex=this.defTexture,this.clear()}r(Context,"laya.resource.Context");var e=Context.prototype;return e.drawImage=function(t){},e.getImageData=function(t){},e.measureText=function(t){return null},e.setTransform=function(t){},e.$transform=function(t,e,i,n,r,s){},e.clearRect=function(t,e,i,n){},e._drawRect=function(t,e,i,n,r){kt.renderBatches++,r&&(this.fillStyle=r),this.fillRect(t,e,i,n)},e.drawTexture2=function(t,e,i,n,r,s){},e.transformByMatrix=function(t,e,i){this.transform(t.a,t.b,t.c,t.d,t.tx+e,t.ty+i)},e.saveTransform=function(t){this.save()},e.restoreTransform=function(t){this.restore()},e.drawRect=function(t,e,i,n,r,s,a){null!=r&&(this.fillStyle=r,this.fillRect(t,e,i,n)),null!=s&&(this.strokeStyle=s,this.lineWidth=a,this.strokeRect(t,e,i,n))},e.alpha=function(t){this.globalAlpha*=t},e._transform=function(t,e,i){this.translate(e,i),this.transform(t.a,t.b,t.c,t.d,t.tx,t.ty),this.translate(-e,-i)},e._rotate=function(t,e,i){this.translate(e,i),this.rotate(t),this.translate(-e,-i)},e._scale=function(t,e,i,n){this.translate(i,n),this.scale(t,e),this.translate(-i,-n)},e._drawLine=function(t,e,i,n,r,s,a,o,h){this.beginPath(),this.strokeStyle=a,this.lineWidth=o,this.moveTo(t+i,e+n),this.lineTo(t+r,e+s),this.stroke()},e._drawLines=function(t,e,i,n,r,s){this.beginPath(),this.strokeStyle=n,this.lineWidth=r;i.length;this.addPath(i.slice(),!1,!1,t,e),this.stroke()},e.drawCurves=function(t,e,i,n,r){this.beginPath(),this.strokeStyle=n,this.lineWidth=r,this.moveTo(t+i[0],e+i[1]);for(var s=2,a=i.length;s0&&(this.strokeStyle=e,this.lineWidth=i,this.stroke())},e._drawCircle=function(t,e,i,n,r,s,a){kt.renderBatches++,this.beginPath(!0),this.arc(t,e,i,0,Context.PI2),this.closePath(),this._fillAndStroke(n,r,s)},e._drawPie=function(t,e,i,n,r,s,a,o,h){this.beginPath(),this.moveTo(t,e),this.arc(t,e,i,n,r),this.closePath(),this._fillAndStroke(s,a,o)},e._drawPoly=function(t,e,i,n,r,s,a,o){i.length;this.beginPath(),this.addPath(i.slice(),!0,a,t,e),this.closePath(),this._fillAndStroke(n,r,s,a)},e._drawPath=function(t,e,i,n,r){this.beginPath();for(var s=0,a=i.length;s=0;i--){var n=this._save[i];if(n.restore(this),n.isSaveMark())return void(this._save._length=i)}e!=this._nBlendType&&(this._curSubmit=V.RENDERBASE)}},e.fillText=function(t,e,i,n,r,s){this._fillText(t,null,e,i,n,r,null,0,null)},e._fillText=function(t,e,i,n,r,s,a,o,h,u){void 0===u&&(u=0),t?Context._textRender.filltext(this,t,i,n,r,s,a,o,h,u):e&&Context._textRender.fillWords(this,e,i,n,r,s,a,o)},e._fast_filltext=function(t,e,i,n,r,s,a,o,h){void 0===h&&(h=0),Context._textRender._fast_filltext(this,t,null,e,i,n,r,s,a,o,h)},e.fillWords=function(t,e,i,n,r){this._fillText(null,t,e,i,n,r,null,-1,null,0)},e.fillBorderWords=function(t,e,i,n,r,s,a){this._fillBorderText(null,t,e,i,n,r,s,a,null)},e.drawText=function(t,e,i,n,r,s){this._fillText(t,null,e,i,n,o.create(r).strColor,null,-1,s)},e.strokeWord=function(t,e,i,n,r,s,a){this._fillText(t,null,e,i,n,null,o.create(r).strColor,s||1,a)},e.fillBorderText=function(t,e,i,n,r,s,a,h){this._fillBorderText(t,null,e,i,n,o.create(r).strColor,o.create(s).strColor,a,h)},e._fillBorderText=function(t,e,i,n,r,s,a,o,h){this._fillText(t,e,i,n,r,s,a,o||1,h)},e._fillRect=function(t,e,i,n,r){var s=this._curSubmit,a=s&&2===s._key.submitType&&s._key.blendShader===this._nBlendType;this._mesh.vertNum+4>65535&&(this._mesh=Oe.getAMesh(this.isMain),this.meshlist.push(this._mesh),a=!1),a&&(a=a&&this.isSameClipInfo(s)),this.transformQuad(t,e,i,n,0,this._curMat,this._transedPoints),this.clipedOff(this._transedPoints)||(this._mesh.addQuad(this._transedPoints,Fe.NO_UV,r,!1),a||(s=this._curSubmit=Ie.create(this,this._mesh,st.create(1,0)),this._submits[this._submits._length++]=s,this._copyClipInfo(s,this._globalClipMatrix),s.shaderValue.textureHost=this._lastTex,s._key.other=this._lastTex&&this._lastTex.bitmap?this._lastTex.bitmap.id:-1,s._renderType=10016),this._curSubmit._numEle+=6,this._mesh.indexNum+=6,this._mesh.vertNum+=4)},e.fillRect=function(t,e,i,n,r){var s=r?O.create(r):this._shader2D.fillStyle,a=this.mixRGBandAlpha(s.toInt());this._fillRect(t,e,i,n,a)},e.fillTexture=function(t,e,n,r,s,a,o,h){t._getSource()?this._fillTexture(t,t.width,t.height,t.uvrect,e,n,r,s,a,o.x,o.y):this.sprite&&i.systemTimer.callLater(this,this._repaintSprite)},e._fillTexture=function(t,e,i,n,r,s,a,o,h,u,l){var c=this._curSubmit;this._mesh.vertNum+4>65535&&(this._mesh=Oe.getAMesh(this.isMain),this.meshlist.push(this._mesh));var _=!0,d=!0;switch(h){case"repeat":break;case"repeat-x":d=!1;break;case"repeat-y":_=!1;break;case"no-repeat":_=d=!1}var f=this._temp4Points,p=0,m=0,g=0,v=0,x=0,y=0;if(u<0?(g=r,p=-u%e/e):g=r+u,l<0?(v=s,m=-l%i/i):v=s+l,x=r+a,y=s+o,!_&&(x=Math.min(x,r+u+e)),!d&&(y=Math.min(y,s+l+i)),!(xx||v>y)){var T=(x-r-u)/e,b=(y-s-l)/i;if(this.transformQuad(g,v,x-g,y-v,0,this._curMat,this._transedPoints),f[0]=p,f[1]=m,f[2]=T,f[3]=m,f[4]=T,f[5]=b,f[6]=p,f[7]=b,!this.clipedOff(this._transedPoints)){var C=this._mixRGBandAlpha(4294967295,this._shader2D.ALPHA);this._mesh.addQuad(this._transedPoints,f,C,!0);var S=st.create(1,0);S.defines.add(256),S.u_TexRange=n,c=this._curSubmit=Ie.create(this,this._mesh,S),this._submits[this._submits._length++]=c,this._copyClipInfo(c,this._globalClipMatrix),c.shaderValue.textureHost=t,c._renderType=10016,this._curSubmit._numEle+=6,this._mesh.indexNum+=6,this._mesh.vertNum+=4}this.breakNextMerge()}},e.setColorFilter=function(t){h.save(this,8388608,this,!0),this._colorFiler=t,this._curSubmit=V.RENDERBASE},e.drawTexture=function(t,e,i,n,r){this._drawTextureM(t,e,i,n,r,null,1,null)},e.drawTextures=function(t,e,n,r){if(t._getSource())for(var s=e.length/2,a=0,o=t.bitmap.id,h=0;h65535&&(this._mesh=Oe.getAMesh(this.isMain),this.meshlist.push(this._mesh));var i=Ie.create(this,this._mesh,st.create(1,0));this._submits[this._submits._length++]=this._curSubmit=i,i.shaderValue.textureHost=t,this._copyClipInfo(i,this._globalClipMatrix)},e._drawTexRect=function(t,e,i,n,r){this.transformQuad(t,e,i,n,this._italicDeg,this._curMat,this._transedPoints);var s=this._transedPoints;s[0]=s[0]+.5|0,s[1]=s[1]+.5|0,s[2]=s[2]+.5|0,s[3]=s[3]+.5|0,s[4]=s[4]+.5|0,s[5]=s[5]+.5|0,s[6]=s[6]+.5|0,s[7]=s[7]+.5|0,this.clipedOff(this._transedPoints)||(this._mesh.addQuad(this._transedPoints,r,this._fillColor,!0),this._curSubmit._numEle+=6,this._mesh.indexNum+=6,this._mesh.vertNum+=4)},e.drawCallOptimize=function(t){return this._charSubmitCache.enable(t,this),t},e._inner_drawTexture=function(t,e,i,n,r,s,a,o,h,u){var l=this._curSubmit._key;if(o=o||t._uv,4===l.submitType&&l.other===e){var c=this._drawTexToDrawTri_Vert;c[0]=i,c[1]=n,c[2]=i+r,c[3]=n,c[4]=i+r,c[5]=n+s,c[6]=i,c[7]=n+s,this._drawTriUseAbsMatrix=!0;var _=this._tempUV;return _[0]=o[0],_[1]=o[1],_[2]=o[2],_[3]=o[3],_[4]=o[4],_[5]=o[5],_[6]=o[6],_[7]=o[7],this.drawTriangles(t,0,0,c,_,this._drawTexToDrawTri_Index,a,h,null,null),this._drawTriUseAbsMatrix=!1,!0}var d=this._mesh,f=this._curSubmit,p=u?this._charSubmitCache.getPos():this._transedPoints;if(this.transformQuad(i,n,r||t.width,s||t.height,this._italicDeg,a||this._curMat,p),this.drawTexAlign){var m=Math.round;p[0]=m(p[0]),p[1]=m(p[1]),p[2]=m(p[2]),p[3]=m(p[3]),p[4]=m(p[4]),p[5]=m(p[5]),p[6]=m(p[6]),p[7]=m(p[7]),this.drawTexAlign=!1}var g=this._mixRGBandAlpha(4294967295,this._shader2D.ALPHA*h);if(u)return this._charSubmitCache.add(this,t,e,p,o,g),!0;this._drawCount++;var v=e>=0&&2===l.submitType&&l.other===e;return v&&(v=v&&this.isSameClipInfo(f)),this._lastTex=t,d.vertNum+4>65535&&(d=this._mesh=Oe.getAMesh(this.isMain),this.meshlist.push(d),v=!1),d.addQuad(p,o,g,!0),v||(this._submits[this._submits._length++]=this._curSubmit=f=Ie.create(this,d,st.create(1,0)),f.shaderValue.textureHost=t,f._key.other=e,this._copyClipInfo(f,this._globalClipMatrix)),f._numEle+=6,d.indexNum+=6,d.vertNum+=4,!0},e.transform4Points=function(t,e,i){var n=e.tx,r=e.ty,s=e.a,a=e.b,o=e.c,h=e.d,u=t[0],l=t[1],c=t[2],_=t[3],d=t[4],f=t[5],p=t[6],m=t[7];e._bTransform?(i[0]=u*s+l*o+n,i[1]=u*a+l*h+r,i[2]=c*s+_*o+n,i[3]=c*a+_*h+r,i[4]=d*s+f*o+n,i[5]=d*a+f*h+r,i[6]=p*s+m*o+n,i[7]=p*a+m*h+r):(i[0]=u+n,i[1]=l+r,i[2]=c+n,i[3]=_+r,i[4]=d+n,i[5]=f+r,i[6]=p+n,i[7]=m+r)},e.clipedOff=function(t){return this._clipRect.width<=0||this._clipRect.height<=0},e.transformQuad=function(t,e,i,n,r,s,a){var o=0;0!=r&&(o=Math.tan(r*Math.PI/180)*n);var h=t+i,u=e+n,l=s.tx,c=s.ty,_=s.a,d=s.b,f=s.c,p=s.d,m=t+o,g=e,v=h+o,x=e,y=h,T=u,b=t,C=u;s._bTransform?(a[0]=m*_+g*f+l,a[1]=m*d+g*p+c,a[2]=v*_+x*f+l,a[3]=v*d+x*p+c,a[4]=y*_+T*f+l,a[5]=y*d+T*p+c,a[6]=b*_+C*f+l,a[7]=b*d+C*p+c):(a[0]=m+l,a[1]=g+c,a[2]=v+l,a[3]=x+c,a[4]=y+l,a[5]=T+c,a[6]=b+l,a[7]=C+c)},e.pushRT=function(){this.addRenderObject(l.create(null,ci.pushRT,this))},e.popRT=function(){this.addRenderObject(l.create(null,ci.popRT,this)),this.breakNextMerge()},e.useRT=function(t){this.addRenderObject(l.create([t],function(t){if(!t)throw"error useRT";t.start(),t.clear(0,0,0,0)},this)),this.breakNextMerge()},e.RTRestore=function(t){this.addRenderObject(l.create([t],function(t){t.restore()},this)),this.breakNextMerge()},e.breakNextMerge=function(){this._curSubmit=V.RENDERBASE},e._repaintSprite=function(){this.sprite&&this.sprite.repaint()},e.drawTextureWithTransform=function(t,e,i,n,r,s,a,o,h,u,l){var c=null,_=this._curMat;u&&(c=this.globalCompositeOperation,this.globalCompositeOperation=u);var d=this._colorFiler;if(l&&this.setColorFilter(l),!s)return this._drawTextureM(t,e+a,i+o,n,r,_,h,null),u&&(this.globalCompositeOperation=c),void(l&&this.setColorFilter(d));var f=this._tmpMatrix;f.a=s.a,f.b=s.b,f.c=s.c,f.d=s.d,f.tx=s.tx+a,f.ty=s.ty+o,f._bTransform=s._bTransform,s&&_._bTransform?(U.mul(f,_,f),(s=f)._bTransform=!0):(f.tx+=_.tx,f.ty+=_.ty,s=f),this._drawTextureM(t,e,i,n,r,s,h,null),u&&(this.globalCompositeOperation=c),l&&this.setColorFilter(d)},e._flushToTarget=function(t,e){tt.worldScissorTest=!1,j.mainContext.disable(3089);var i=tt.worldAlpha,n=tt.worldMatrix4,r=tt.worldMatrix;tt.worldShaderDefines;tt.worldMatrix=U.EMPTY,tt.restoreTempArray(),tt.worldMatrix4=tt.TEMPMAT4_ARRAY,tt.worldAlpha=1,$e.activeShader=null,e.start(),t._submits._length>0&&e.clear(0,0,0,0),t._curSubmit=V.RENDERBASE,t.flush(),t.clear(),e.restore(),t._curSubmit=V.RENDERBASE,$e.activeShader=null,tt.worldAlpha=i,tt.worldMatrix4=n,tt.worldMatrix=r},e.drawCanvas=function(t,e,i,n,r){if(t){var s,a=t.context;if(a._targets)a._submits._length>0&&(s=l.create([a,a._targets],this._flushToTarget,this),this._submits[this._submits._length++]=s),this._drawRenderTexture(a._targets,e,i,n,r,null,1,ci.flipyuv),this._curSubmit=V.RENDERBASE;else{var o=t;o.touches&&o.touches.forEach(function(t){t.touch()}),s=Ye.create(t,this._shader2D.ALPHA,this._shader2D.filters),this._submits[this._submits._length++]=s,s._key.clear();var h=s._matrix;this._curMat.copyTo(h);var u=h.tx,c=h.ty;h.tx=h.ty=0,h.transformPoint(ct.TEMP.setTo(e,i)),h.translate(ct.TEMP.x+u,ct.TEMP.y+c),U.mul(o.invMat,h,h),this._curSubmit=V.RENDERBASE}}},e.drawTarget=function(t,e,i,n,r,s,a,o,h){void 0===h&&(h=-1),this._drawCount++;if(this._mesh.vertNum+4>65535&&(this._mesh=Oe.getAMesh(this.isMain),this.meshlist.push(this._mesh)),this.transformQuad(e,i,n,r,0,s||this._curMat,this._transedPoints),!this.clipedOff(this._transedPoints)){this._mesh.addQuad(this._transedPoints,o||Fe.DEF_UV,4294967295,!0);var u=this._curSubmit=ce.create(this,this._mesh,a,t);return u.blendType=-1==h?this._nBlendType:h,this._copyClipInfo(u,this._globalClipMatrix),u._numEle=6,this._mesh.indexNum+=6,this._mesh.vertNum+=4,this._submits[this._submits._length++]=u,this._curSubmit=V.RENDERBASE,!0}return this._curSubmit=V.RENDERBASE,!1},e.drawTriangles=function(t,e,n,r,s,a,o,h,u,l){if(t._getSource()){this._drawCount++;var c=this._tmpMatrix,_=this._triangleMesh,d=null,f=!1;u&&(d=this._colorFiler,this._colorFiler=u,this._curSubmit=V.RENDERBASE,f=d!=u);var p=t.bitmap,m=this._curSubmit._key,g=4===m.submitType&&m.other===p.id&&m.blendShader==this._nBlendType;if(_.vertNum+r.length/2>65535&&(_=this._triangleMesh=Ne.getAMesh(this.isMain),this.meshlist.push(_),g=!1),!g){var v=this._curSubmit=Ie.create(this,_,st.create(1,0));v.shaderValue.textureHost=t,v._renderType=10016,v._key.submitType=4,v._key.other=p.id,this._copyClipInfo(v,this._globalClipMatrix),this._submits[this._submits._length++]=v}var x=this._mixRGBandAlpha(4294967295,this._shader2D.ALPHA*h);this._drawTriUseAbsMatrix?_.addData(r,s,a,o,x):(o?(c.a=o.a,c.b=o.b,c.c=o.c,c.d=o.d,c.tx=o.tx+e,c.ty=o.ty+n):(c.a=1,c.b=0,c.c=0,c.d=1,c.tx=e,c.ty=n),U.mul(c,this._curMat,c),_.addData(r,s,a,c,x)),this._curSubmit._numEle+=a.length,f&&(this._colorFiler=d,this._curSubmit=V.RENDERBASE)}else this.sprite&&i.systemTimer.callLater(this,this._repaintSprite)},e.transform=function(t,e,i,n,r,s){Zt.save(this),U.mul(U.TEMP.setTo(t,e,i,n,r,s),this._curMat,this._curMat),this._curMat._checkTransform()},e._transformByMatrix=function(t,e,i){t.setTranslate(e,i),U.mul(t,this._curMat,this._curMat),t.setTranslate(0,0),this._curMat._bTransform=!0},e.setTransformByMatrix=function(t){t.copyTo(this._curMat)},e.rotate=function(t){Zt.save(this),this._curMat.rotateEx(t)},e.scale=function(t,e){Zt.save(this),this._curMat.scaleEx(t,e)},e.clipRect=function(t,e,i,n){Kt.save(this),this._clipRect==Context.MAXCLIPRECT?this._clipRect=new mt(t,e,i,n):(this._clipRect.width=i,this._clipRect.height=n,this._clipRect.x=t,this._clipRect.y=e),Context._clipID_Gen++,Context._clipID_Gen%=1e4,this._clipInfoID=Context._clipID_Gen;var r=this._globalClipMatrix,s=r.tx,a=r.ty,o=s+r.a,h=a+r.d;if(this._clipRect.width>=99999999?(r.a=r.d=99999999,r.b=r.c=r.tx=r.ty=0):(this._curMat._bTransform?(r.tx=this._clipRect.x*this._curMat.a+this._clipRect.y*this._curMat.c+this._curMat.tx,r.ty=this._clipRect.x*this._curMat.b+this._clipRect.y*this._curMat.d+this._curMat.ty,r.a=this._clipRect.width*this._curMat.a,r.b=this._clipRect.width*this._curMat.b,r.c=this._clipRect.height*this._curMat.c,r.d=this._clipRect.height*this._curMat.d):(r.tx=this._clipRect.x+this._curMat.tx,r.ty=this._clipRect.y+this._curMat.ty,r.a=this._clipRect.width,r.b=r.c=0,r.d=this._clipRect.height),this._incache&&(this._clipInCache=!0)),r.a>0&&r.d>0){var u=r.tx+r.a,l=r.ty+r.d;u<=s||l<=a||r.tx>=o||r.ty>=h?(r.a=-.1,r.d=-.1):(r.txo&&(r.a-=u-o),r.tyh&&(r.d-=l-h),r.a<=0&&(r.a=-.1),r.d<=0&&(r.d=-.1))}},e.drawMesh=function(t,e,i,n,r,s,a,o,h){void 0===h&&(h=0)},e.addRenderObject=function(t){this._submits[this._submits._length++]=t},e.submitElement=function(t,e){K._context;var i=this._submits,n=i._length;e<0&&(e=i._length);for(var r=V.RENDERBASE;t65535&&(this._curSubmit._numEle+=a,a=0,this._pathMesh=Ve.getAMesh(this.isMain),this._curSubmit=this.addVGSubmit(this._pathMesh));var g=this._pathMesh.vertNum;if(u.convex){var v=l-2;r=new Array(3*v);for(var x=0,y=0;y0)for(var T=0;T0){var t=this.mixRGBandAlpha(this.strokeStyle._color.numColor),e=this._getPath(),i=this._curSubmit,n=3===i._key.submitType&&i._key.blendShader===this._nBlendType;n&&(n=n&&this.isSameClipInfo(i)),n||(this._curSubmit=this.addVGSubmit(this._pathMesh));for(var r=0,s=0,a=e.paths.length;s65535&&(this._curSubmit._numEle+=r,r=0,this._pathMesh=Ve.getAMesh(this.isMain),this.meshlist.push(this._pathMesh),this._curSubmit=this.addVGSubmit(this._pathMesh)),Nt.createLine2(o.path,h,this.lineWidth,this._pathMesh.vertNum,u,o.loop);var c=u.length/2,_=this._curMat,d=0,f=0,p=0,m=NaN,g=NaN;if(_._bTransform)for(d=0;d=0){var P=2*w/Context.SEGNUM;D=Math.sin(P),I=Math.cos(P)}else P=2*-w/Context.SEGNUM,D=Math.sin(P),I=Math.cos(P);var B=this._path._lastOriX,G=this._path._lastOriY,F=M,W=A;(Math.abs(F-this._path._lastOriX)>.1||Math.abs(W-this._path._lastOriY)>.1)&&(a=F,o=W,B=F,G=W,this._path.addPoint(a,o));var O=M-L,N=A-E;for(s=0;s.1||Math.abs(G-o)>.1)&&(this._path.addPoint(a,o),B=a,G=o),O=U,N=k}}}}},e.arc=function(t,e,i,n,r,s,a){void 0===s&&(s=!1),void 0===a&&(a=!0);var o,h,u=0,l=0,c=0,_=0,d=0,f=0,p=0;if(l=r-n,s)if(Math.abs(l)>=2*Math.PI)l=2*-Math.PI;else for(;l>0;)l-=2*Math.PI;else if(Math.abs(l)>=2*Math.PI)l=2*Math.PI;else for(;l<0;)l+=2*Math.PI;var m=this.getMatScaleX(),g=this.getMatScaleY(),v=i*(m>g?m:g),x=2*Math.PI*v;o=l/(h=0|Math.max(x/10,10))/2,c=Math.abs(4/3*(1-Math.cos(o))/Math.sin(o)),s&&(c=-c);var y=this._getPath();for(p=0;p<=h;p++)u=n+l*(p/h),_=Math.cos(u),f=e+Math.sin(u)*i,(d=t+_*i)==this._path._lastOriX&&f==this._path._lastOriY||y.addPoint(d,f);_=Math.cos(r),f=e+Math.sin(r)*i,(d=t+_*i)==this._path._lastOriX&&f==this._path._lastOriY||y.addPoint(d,f)},e.quadraticCurveTo=function(t,e,i,n){for(var r=ht.I.getBezierPoints([this._path._lastOriX,this._path._lastOriY,t,e,i,n],30,2),s=0,a=r.length/2;s=1)return t;var i=(4278190080&t)>>>24;return 0!=i?i*=e:i=255*e,16777215&t|i<<24},e.strokeRect=function(t,e,i,n,r){if(this.lineWidth>0){var s=this.mixRGBandAlpha(this.strokeStyle._color.numColor),a=this.lineWidth/2;this._fillRect(t-a,e-a,i+this.lineWidth,this.lineWidth,s),this._fillRect(t-a,e-a+n,i+this.lineWidth,this.lineWidth,s),this._fillRect(t-a,e+a,this.lineWidth,n-this.lineWidth,s),this._fillRect(t-a+i,e+a,this.lineWidth,n-this.lineWidth,s)}},e.clip=function(){},e.drawParticle=function(t,e,i){i.x=t,i.y=e,this._submits[this._submits._length++]=i},e._getPath=function(){return this._path||(this._path=new Ft)},e._fillTexture_h=function(t,e,i,n,r,s,a,o){for(var h=s,u=Math.floor(o/n),l=o%n,c=0;c0){var _=i[2]-i[0],d=i[0]+_*(l/n),f=Context.tmpuv1;f[0]=i[0],f[1]=i[1],f[2]=d,f[3]=i[3],f[4]=d,f[5]=i[5],f[6]=i[6],f[7]=i[7],this._inner_drawTexture(t,e,h,a,l,r,this._curMat,f,1,!1)}},e._fillTexture_v=function(t,e,i,n,r,s,a,o){for(var h=a,u=Math.floor(o/r),l=o%r,c=0;c0){var _=i[7]-i[1],d=i[1]+_*(l/r),f=Context.tmpuv1;f[0]=i[0],f[1]=i[1],f[2]=i[2],f[3]=i[3],f[4]=i[4],f[5]=d,f[6]=i[6],f[7]=d,this._inner_drawTexture(t,e,s,h,n,l,this._curMat,f,1,!1)}},e.drawTextureWithSizeGrid=function(t,e,i,n,r,s,a,o){if(t._getSource()){e+=a,i+=o;var h=t.uv,u=t.bitmap.width,l=t.bitmap.height,c=s[0],_=s[3],d=c/l,f=_/u,p=s[1],m=s[2],g=p/u,v=m/l,x=s[4],y=!1;if(n==u&&(_=p=0),r==l&&(c=m=0),_+p>n){var T=n;y=!0,n=_+p,this.save(),this.clipRect(0+e,0+i,T,r)}var b=t.bitmap.id,C=this._curMat,S=this._tempUV,w=h[0],M=h[1],A=h[4],R=h[5],L=w,E=M,D=A,I=R;if(_&&c&&(D=w+f,I=M+d,S[0]=w,S[1]=M,S[2]=D,S[3]=M,S[4]=D,S[5]=I,S[6]=w,S[7]=I,this._inner_drawTexture(t,b,e,i,_,c,C,S,1,!1)),p&&c&&(L=A-g,E=M,D=A,I=M+d,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,this._inner_drawTexture(t,b,n-p+e,0+i,p,c,C,S,1,!1)),_&&m&&(L=w,E=R-v,D=w+f,I=R,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,this._inner_drawTexture(t,b,0+e,r-m+i,_,m,C,S,1,!1)),p&&m&&(L=A-g,E=R-v,D=A,I=R,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,this._inner_drawTexture(t,b,n-p+e,r-m+i,p,m,C,S,1,!1)),c&&(L=w+f,E=M,D=A-g,I=M+d,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,x?this._fillTexture_h(t,b,S,t.width-_-p,c,_+e,i,n-_-p):this._inner_drawTexture(t,b,_+e,i,n-_-p,c,C,S,1,!1)),m&&(L=w+f,E=R-v,D=A-g,I=R,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,x?this._fillTexture_h(t,b,S,t.width-_-p,m,_+e,r-m+i,n-_-p):this._inner_drawTexture(t,b,_+e,r-m+i,n-_-p,m,C,S,1,!1)),_&&(L=w,E=M+d,D=w+f,I=R-v,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,x?this._fillTexture_v(t,b,S,_,t.height-c-m,e,c+i,r-c-m):this._inner_drawTexture(t,b,e,c+i,_,r-c-m,C,S,1,!1)),p&&(L=A-g,E=M+d,D=A,I=R-v,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,x?this._fillTexture_v(t,b,S,p,t.height-c-m,n-p+e,c+i,r-c-m):this._inner_drawTexture(t,b,n-p+e,c+i,p,r-c-m,C,S,1,!1)),L=w+f,E=M+d,D=A-g,I=R-v,S[0]=L,S[1]=E,S[2]=D,S[3]=E,S[4]=D,S[5]=I,S[6]=L,S[7]=I,x){var P=Context.tmpUVRect;P[0]=L,P[1]=E,P[2]=D-L,P[3]=I-E,this._fillTexture(t,t.width-_-p,t.height-c-m,P,_+e,c+i,n-_-p,r-c-m,"repeat",0,0)}else this._inner_drawTexture(t,b,_+e,c+i,n-_-p,r-c-m,C,S,1,!1);y&&this.restore()}},s(0,e,"textAlign",function(){return this._other.textAlign},function(t){this._other.textAlign===t||(this._other=this._other.make(),h.save(this,32768,this._other,!1),this._other.textAlign=t)}),s(0,e,"lineJoin",function(){return null},function(t){}),s(0,e,"fillStyle",function(){return this._shader2D.fillStyle},function(t){this._shader2D.fillStyle.equal(t)||(h.save(this,2,this._shader2D,!1),this._shader2D.fillStyle=O.create(t),this._submitKey.other=-this._shader2D.fillStyle.toInt())}),s(0,e,"lineCap",function(){return null},function(t){}),s(0,e,"miterLimit",function(){return null},function(t){}),s(0,e,"strokeStyle",function(){return this._shader2D.strokeStyle},function(t){this._shader2D.strokeStyle.equal(t)||(h.save(this,512,this._shader2D,!1),this._shader2D.strokeStyle=O.create(t),this._submitKey.other=-this._shader2D.strokeStyle.toInt())}),s(0,e,"globalCompositeOperation",function(){return Lt.NAMES[this._nBlendType]},function(t){var e=Lt.TOINT[t];null==e||this._nBlendType===e||(h.save(this,65536,this,!0),this._curSubmit=V.RENDERBASE,this._nBlendType=e)}),s(0,e,"globalAlpha",function(){return this._shader2D.ALPHA},function(t){(t=Math.floor(1e3*t)/1e3)!=this._shader2D.ALPHA&&(h.save(this,1,this._shader2D,!1),this._shader2D.ALPHA=t)}),s(0,e,"asBitmap",null,function(t){if(t){if(this._targets||(this._targets=new ci(this._width,this._height,1,-1)),!this._width||!this._height)throw Error("asBitmap no size!")}else this._targets&&this._targets.destroy(),this._targets=null}),s(0,e,"textBaseline",function(){return this._other.textBaseline},function(t){this._other.textBaseline===t||(this._other=this._other.make(),h.save(this,16384,this._other,!1),this._other.textBaseline=t)}),s(0,e,"lineWidth",function(){return this._other.lineWidth},function(t){this._other.lineWidth===t||(this._other=this._other.make(),h.save(this,256,this._other,!1),this._other.lineWidth=t)}),s(0,e,"font",null,function(t){this._other=this._other.make(),h.save(this,8,this._other,!1)}),s(0,e,"canvas",function(){return this._canvas}),Context.__init__=function(){Context.MAXCLIPRECT=new mt(0,0,99999999,99999999),t.DEFAULT=new t},Context.set2DRenderConfig=function(){var t=X.instance;jt.setBlend(t,!0),jt.setBlendFunc(t,1,771),jt.setDepthTest(t,!1),jt.setCullFace(t,!1),jt.setDepthMask(t,!0),jt.setFrontFace(t,2305),t.viewport(0,0,tt.width,tt.height)},Context.ENUM_TEXTALIGN_DEFAULT=0,Context.ENUM_TEXTALIGN_CENTER=1,Context.ENUM_TEXTALIGN_RIGHT=2,Context._SUBMITVBSIZE=32e3,Context._MAXSIZE=99999999,Context._MAXVERTNUM=65535,Context.MAXCLIPRECT=null,Context._COUNT=0,Context.SEGNUM=32,Context._contextcount=0,Context.PI2=2*Math.PI,Context._clipID_Gen=0,n(Context,["_textRender",function(){return this._textRender=new D},"tmpuv1",function(){return this.tmpuv1=[0,0,0,0,0,0,0,0]},"tmpUV",function(){return this.tmpUV=[0,0,0,0,0,0,0,0]},"tmpUVRect",function(){return this.tmpUVRect=[0,0,0,0]}]),Context.__init$=function(){t=function(){function ContextParams(){this.lineWidth=1,this.textAlign=null,this.textBaseline=null}r(ContextParams,"");var t=ContextParams.prototype;return t.clear=function(){this.lineWidth=1,this.textAlign=this.textBaseline=null},t.make=function(){return this===ContextParams.DEFAULT?new ContextParams:this},ContextParams.DEFAULT=null,ContextParams}()},Context}(),ge=function(){function RotateCmd(){}r(RotateCmd,"laya.display.cmd.RotateCmd");var t=RotateCmd.prototype;return t.recover=function(){re.recover("RotateCmd",this)},t.run=function(t,e,i){t._rotate(this.angle,this.pivotX+e,this.pivotY+i)},s(0,t,"cmdID",function(){return"Rotate"}),RotateCmd.create=function(t,e,i){var n=re.getItemByClass("RotateCmd",RotateCmd);return n.angle=t,n.pivotX=e,n.pivotY=i,n},RotateCmd.ID="Rotate",RotateCmd}(),ve=function(){function Draw9GridTexture(){}r(Draw9GridTexture,"laya.display.cmd.Draw9GridTexture");var t=Draw9GridTexture.prototype;return t.recover=function(){this.texture._removeReference(),re.recover("Draw9GridTexture",this)},t.run=function(t,e,i){t.drawTextureWithSizeGrid(this.texture,this.x,this.y,this.width,this.height,this.sizeGrid,e,i)},s(0,t,"cmdID",function(){return"Draw9GridTexture"}),Draw9GridTexture.create=function(t,e,i,n,r,s){var a=re.getItemByClass("Draw9GridTexture",Draw9GridTexture);return a.texture=t,t._addReference(),a.x=e,a.y=i,a.width=n,a.height=r,a.sizeGrid=s,a},Draw9GridTexture.ID="Draw9GridTexture",Draw9GridTexture}(),xe=function(){var t,e;function SceneUtils(){}return r(SceneUtils,"laya.utils.SceneUtils"),SceneUtils.getBindFun=function(t){var e=SceneUtils._funMap.get(t);if(null==e){var n='"'+t+'"',r="(function(data){if(data==null)return;with(data){try{\nreturn "+(n=n.replace(/^"\${|}"$/g,"").replace(/\${/g,'"+').replace(/}/g,'+"'))+"\n}catch(e){}}})";e=i._runScript(r),SceneUtils._funMap.set(t,e)}return e},SceneUtils.createByData=function(t,i){var n=e.create();if((t=SceneUtils.createComp(i,t,t,null,n))._setBit(8,!0),t.hasOwnProperty("_idMap")&&(t._idMap=n._idMap),i.animations){var r,s,a=[],o=i.animations,h=0,u=o.length;for(h=0;h0&&null==i.props.hitTestPrior&&!t.mouseThrough&&(t.hitTestPrior=!0),n.beginLoad(t),t},SceneUtils.createInitTool=function(){return e.create()},SceneUtils.createComp=function(t,e,n,r,s){if("Scene3D"==t.type||"Sprite3D"==t.type){var a=[],o=i.Utils3D._createSceneByJsonForMaker(t,a,s);return"Sprite3D"==t.type?i.StaticBatchManager.combine(o,a):i.StaticBatchManager.combine(null,a),o}if(!(e=e||SceneUtils.getCompInstance(t)))return t.props&&t.props.runtime?console.warn("runtime not found:"+t.props.runtime):console.warn("can not create:"+t.type),null;var h=t.child;if(h)for(var u="List"==e._$componentType,l=0,c=h.length;l=0||g.indexOf("@Prefab:")>=0)?s&&s.addNodeRef(e,m,g):SceneUtils.setCompValue(e,m,g,n,r)}return e._afterInited&&e._afterInited(),t.compId&&s&&s._idMap&&(s._idMap[t.compId]=e),e},SceneUtils.setCompValue=function(e,i,n,r,s){if("string"==typeof n&&n.indexOf("${")>-1){if(SceneUtils._sheet||(SceneUtils._sheet=S.getClass("laya.data.Table")),!SceneUtils._sheet)return void console.warn("Can not find class Sheet");if(s)s.push(e,i,n);else if(r){-1==n.indexOf("].")&&(n=n.replace(".","[0]."));var a,o,h=new t(e,i,n);h.exe(r);for(var u=n.replace(/\[.*?\]\./g,".");null!=(a=SceneUtils._parseWatchData.exec(u));){for(var l=a[1];null!=(o=SceneUtils._parseKeyWord.exec(l));){var c=o[0],_=r._watchMap[c]||(r._watchMap[c]=[]);_.push(h),SceneUtils._sheet.I.notifer.on(c,r,r.changeData,[c])}(_=r._watchMap[l]||(r._watchMap[l]=[])).push(h),SceneUtils._sheet.I.notifer.on(l,r,r.changeData,[l])}}}else"var"===i&&r?r[n]=e:e[i]="true"===n||"false"!==n&&n},SceneUtils.getCompInstance=function(t){if("UIView"==t.type&&t.props&&t.props.pageData)return SceneUtils.createByData(null,t.props.pageData);var e=t.props&&t.props.runtime||t.type,i=S.getClass(e);if(!i)throw"Can not find class "+e;if("Script"===t.type&&i.prototype._doAwake){var n=re.createByClass(i);return n._destroyed=!1,n}return t.props&&t.props.hasOwnProperty("renderType")&&"instance"==t.props.renderType?(i.instance||(i.instance=new i),i.instance):new i},SceneUtils._sheet=null,n(SceneUtils,["_funMap",function(){return this._funMap=new x},"_parseWatchData",function(){return this._parseWatchData=/\${(.*?)}/g},"_parseKeyWord",function(){return this._parseKeyWord=/[a-zA-Z_][a-zA-Z0-9_]*(?:(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+)/g}]),SceneUtils.__init$=function(){t=function(){function DataWatcher(t,e,i){this.comp=null,this.prop=null,this.value=null,this.comp=t,this.prop=e,this.value=i}return r(DataWatcher,""),DataWatcher.prototype.exe=function(t){var e=SceneUtils.getBindFun(this.value);this.comp[this.prop]=e.call(this,t)},DataWatcher}(),e=function(){function InitTool(){this._nodeRefList=null,this._initList=null,this._loadList=null,this._idMap=null,this._scene=null}r(InitTool,"");var t=InitTool.prototype;return t.reset=function(){this._nodeRefList=null,this._initList=null,this._idMap=null,this._loadList=null,this._scene=null},t.recover=function(){this.reset(),re.recover("InitTool",this)},t.addLoadRes=function(t,e){this._loadList||(this._loadList=[]),e?this._loadList.push({url:t,type:e}):this._loadList.push(t)},t.addNodeRef=function(t,e,i){this._nodeRefList||(this._nodeRefList=[]),this._nodeRefList.push([t,e,i]),i.indexOf("@Prefab:")>=0&&this.addLoadRes(i.replace("@Prefab:",""),"prefab")},t.setNodeRef=function(){if(this._nodeRefList)if(this._idMap){var t,e,i=0;for(t=this._nodeRefList.length,i=0;i=0)return Ce.getRes(t.replace("@Prefab:",""));if(t.indexOf("@arr:")>=0){var e,i,n,r=0;for(i=(e=(t=t.replace("@arr:","")).split(",")).length,r=0;r-1&&this._tweenDataList.splice(i,1)}delete this._labelDic[t]}},n.gotoTime=function(t){if(null!=this._tweenDataList&&0!=this._tweenDataList.length){var e,i,n,r;for(var s in this._firstTweenDic)if(i=this._firstTweenDic[s])for(var a in i)i.diyTarget.hasOwnProperty(a)&&(i.diyTarget[a]=i[a]);for(s in this._tweenDic)(e=this._tweenDic[s]).clear(),delete this._tweenDic[s];if(this._index=0,this._gidIndex=0,this._currTime=t,this._lastTime=Y.now(),null==this._endTweenDataList||this._endTimeSort){this._endTimeSort=!1,this._endTweenDataList=n=this._tweenDataList.concat(),n.sort(function(t,e){return t.endTime>e.endTime?1:t.endTime=r.endTime))break;this._index=Math.max(this._index,o+1);var u=r.data;if(r.isTo)for(var l in u)r.target[l]=u[l]}for(o=0,h=this._tweenDataList.length;o=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=Y.now(),n=i-this._lastTime,r=this._currTime+=n*this.scale;for(t in this._lastTime=i,this._tweenDic)(e=this._tweenDic[t])._updateEase(r);if(0!=this._tweenDataList.length&&this._index=s.startTime&&(this._index++,0==s.type?(this._gidIndex++,(e=re.getItemByClass("tween",w))._create(s.target,s.data,s.duration,s.ease,p.create(this,this._animComplete,[this._gidIndex]),0,!1,s.isTo,!0,!1),e.setStartTime(r),e.gid=this._gidIndex,this._tweenDic[this._gidIndex]=e,e._updateEase(r)):this.event("label",s.data))}},n._animComplete=function(t){this._tweenDic[t]&&delete this._tweenDic[t]},n._complete=function(){this.event("complete")},n.reset=function(){var t;if(this._labelDic)for(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){var e,n=0;for(e=this._tweenDataList.length,n=0;n=0?"/":"\\",a=this._url.lastIndexOf(s),o=a>=0?this._url.substr(0,a+1):"";Y.onAndroid&&t.meta.compressTextureAndroid&&(n=".ktx"),Y.onIOS&&t.meta.compressTextureIOS&&(n=".pvr");for(var h=0,u=r.length;h0)return this.event("progress",.3+1/this._data.toLoads.length*.6),this._loadImage(this._data.toLoads.pop());var l=this._data.frames,c=this._url.split("?")[0],_=this._data.meta&&this._data.meta.prefix?this._data.meta.prefix:c.substring(0,c.lastIndexOf("."))+"/",d=this._data.pics,f=Ut.formatURL(this._url),p=Loader.atlasMap[f]||(Loader.atlasMap[f]=[]);p.dir=_;var m=1;if(this._data.meta&&this._data.meta.scale&&1!=this._data.meta.scale)for(var g in m=parseFloat(this._data.meta.scale),l){var v,x=l[g],y=d[x.frame.idx?x.frame.idx:0],T=Ut.formatURL(_+g);y.scaleRate=m,v=Fe._create(y,x.frame.x,x.frame.y,x.frame.w,x.frame.h,x.spriteSourceSize.x,x.spriteSourceSize.y,x.sourceSize.w,x.sourceSize.h,laya.net.Loader.getRes(T)),Loader.cacheRes(T,v),v.url=T,p.push(T)}else for(g in l)y=d[(x=l[g]).frame.idx?x.frame.idx:0],T=Ut.formatURL(_+g),v=Fe._create(y,x.frame.x,x.frame.y,x.frame.w,x.frame.h,x.spriteSourceSize.x,x.spriteSourceSize.y,x.sourceSize.w,x.sourceSize.h,laya.net.Loader.getRes(T)),Loader.cacheRes(T,v),v.url=T,p.push(T);delete this._data.pics,this.complete(this._data)}else if("font"===e){if(!t._source)return this._data=t,this.event("progress",.5),this._loadImage(this._url.replace(".fnt",".png"));var b=new Mt;b.parseFont(this._data,new Fe(t));var C=this._url.split(".fnt")[0].split("/"),S=C[C.length-1];oi.registerBitmapFont(S,b),this._data=b,this.complete(this._data)}else if("prefab"===e){var w=new pt;w.json=t,this.complete(w)}else this.complete(t)},e.parsePLFData=function(t){var e,i,n;for(e in t)switch(n=t[e],e){case"json":case"text":for(i in n)Loader.preLoadedMap[Ut.formatURL(i)]=n[i];break;default:for(i in n)Loader.preLoadedMap[Ut.formatURL(i)]=n[i]}},e.parsePLFBData=function(t){var e,i,n=0;for(i=(e=new $(t)).getInt32(),n=0;nLoader.maxTimeOut)return console.warn("loader callback cost a long time:"+(Y.now()-t)+" url="+Loader._loaders[Loader._startIndex-1].url),void i.systemTimer.frameOnce(1,null,Loader.checkNext);Loader._loaders.length=0,Loader._startIndex=0,Loader._isWorking=!1},Loader.clearRes=function(t){t=Ut.formatURL(t);var e=Loader.getAtlas(t);if(e){for(var i=0,n=e.length;i0?laya.net.Loader.getRes(e[0]):laya.net.Loader.getRes(t);i instanceof laya.resource.Texture&&i.disposeBitmap()},Loader.getRes=function(t){return Loader.loadedMap[Ut.formatURL(t)]},Loader.getAtlas=function(t){return Loader.atlasMap[Ut.formatURL(t)]},Loader.cacheRes=function(t,e){t=Ut.formatURL(t),null!=Loader.loadedMap[t]?console.warn("Resources already exist,is repeated loading:",t):Loader.loadedMap[t]=e},Loader.setGroup=function(t,e){Loader.groupMap[e]||(Loader.groupMap[e]=[]),Loader.groupMap[e].push(t)},Loader.clearResByGroup=function(t){if(Loader.groupMap[t]){var e=Loader.groupMap[t],i=0,n=e.length;for(i=0;i=2)this.event("complete");else{e||(t==rt._bgMusic?(AudioSound._initMusicAudio(),e=AudioSound._musicAudio):e=Y.createElement("audio"),AudioSound._audioCache[t]=e,e.src=t),e.addEventListener("canplaythrough",onLoaded),e.addEventListener("error",onErr);var i=this;this.audio=e,e.load?e.load():onErr()}function onLoaded(){offs(),i.loaded=!0,i.event("complete")}function onErr(){e.load=null,offs(),i.event("error")}function offs(){e.removeEventListener("canplaythrough",onLoaded),e.removeEventListener("error",onErr)}},e.play=function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=0),!this.url)return null;var i,n;if(!(i=this.url==rt._bgMusic?AudioSound._musicAudio:AudioSound._audioCache[this.url]))return null;n=re.getItem("audio:"+this.url),K.isConchApp?n||((n=Y.createElement("audio")).src=this.url):this.url==rt._bgMusic?(AudioSound._initMusicAudio(),(n=AudioSound._musicAudio).src=this.url):n=n||i.cloneNode(!0);var r=new Ke(n);return r.url=this.url,r.loops=e,r.startTime=t,r.play(),rt.addChannel(r),r},s(0,e,"duration",function(){var t;return(t=AudioSound._audioCache[this.url])?t.duration:0}),AudioSound._initMusicAudio=function(){AudioSound._musicAudio||(AudioSound._musicAudio||(AudioSound._musicAudio=Y.createElement("audio")),K.isConchApp||Y.document.addEventListener("mousedown",AudioSound._makeMusicOK))},AudioSound._makeMusicOK=function(){Y.document.removeEventListener("mousedown",AudioSound._makeMusicOK),AudioSound._musicAudio.src?AudioSound._musicAudio.play():(AudioSound._musicAudio.src="",AudioSound._musicAudio.load())},AudioSound._audioCache={},AudioSound._musicAudio=null,AudioSound}(),we=(function(t){function Socket(t,e,i,n){this._endian=null,this._socket=null,this._connected=!1,this._addInputPosition=0,this._input=null,this._output=null,this.disableInput=!1,this._byteClass=null,this.protocols=[],Socket.__super.call(this),void 0===e&&(e=0),this._byteClass=i||$,this.protocols=n,this.endian="bigEndian",t&&e>0&&e<65535&&this.connect(t,e)}r(Socket,"laya.net.Socket",f);var e=Socket.prototype;e.connect=function(t,e){var i="ws://"+t+":"+e;this.connectByUrl(i)},e.connectByUrl=function(t){var e=this;null!=this._socket&&this.close(),this._socket&&this.cleanSocket(),this.protocols&&0!=this.protocols.length?this._socket=new Y.window.WebSocket(t,this.protocols):this._socket=new Y.window.WebSocket(t),this._socket.binaryType="arraybuffer",this._output=new this._byteClass,this._output.endian=this.endian,this._input=new this._byteClass,this._input.endian=this.endian,this._addInputPosition=0,this._socket.onopen=function(t){e._onOpen(t)},this._socket.onmessage=function(t){e._onMessage(t)},this._socket.onclose=function(t){e._onClose(t)},this._socket.onerror=function(t){e._onError(t)}},e.cleanSocket=function(){this.close(),this._connected=!1,this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=null,this._socket=null},e.close=function(){if(null!=this._socket)try{this._socket.close()}catch(t){}},e._onOpen=function(t){this._connected=!0,this.event("open",t)},e._onMessage=function(t){if(t&&t.data){var e=t.data;if(this.disableInput&&e)this.event("message",e);else{this._input.length>0&&this._input.bytesAvailable<1&&(this._input.clear(),this._addInputPosition=0);var i=this._input.pos;!this._addInputPosition&&(this._addInputPosition=0),this._input.pos=this._addInputPosition,e&&("string"==typeof e?this._input.writeUTFBytes(e):this._input.writeArrayBuffer(e),this._addInputPosition=this._input.pos,this._input.pos=i),this.event("message",e)}}},e._onClose=function(t){this._connected=!1,this.event("close",t)},e._onError=function(t){this.event("error",t)},e.send=function(t){this._socket.send(t)},e.flush=function(){if(this._output&&this._output.length>0){var t;try{this._socket&&this._socket.send(this._output.__getBuffer().slice(0,this._output.length))}catch(e){t=e}this._output.endian=this.endian,this._output.clear(),t&&this.event("error",t)}},s(0,e,"input",function(){return this._input}),s(0,e,"output",function(){return this._output}),s(0,e,"connected",function(){return this._connected}),s(0,e,"endian",function(){return this._endian},function(t){this._endian=t,null!=this._input&&(this._input.endian=t),null!=this._output&&(this._output.endian=t)}),Socket.LITTLE_ENDIAN="littleEndian",Socket.BIG_ENDIAN="bigEndian"}(),function(t){function Node(){this._bits=0,this._parent=null,this.name="",this.destroyed=!1,this._conchData=null,this._components=null,this._activeChangeScripts=null,this._scene=null,Node.__super.call(this),this._children=Node.ARRAY_EMPTY,this._extUIChild=Node.ARRAY_EMPTY,this.createGLBuffer()}r(Node,"laya.display.Node",f);var e=Node.prototype;return e.createGLBuffer=function(){},e._setBit=function(t,e){16===t&&(this._getBit(t)!=e&&this._updateDisplayedInstage());e?this._bits|=t:this._bits&=~t},e._getBit=function(t){return 0!=(this._bits&t)},e._setUpNoticeChain=function(){this._getBit(16)&&this._setBitUp(16)},e._setBitUp=function(t){var e=this;for(e._setBit(t,!0),e=e._parent;e;){if(e._getBit(t))return;e._setBit(t,!0),e=e._parent}},e.on=function(t,e,i,n){return"display"!==t&&"undisplay"!==t||this._getBit(16)||this._setBitUp(16),this._createListener(t,e,i,n,!1)},e.once=function(t,e,i,n){return"display"!==t&&"undisplay"!==t||this._getBit(16)||this._setBitUp(16),this._createListener(t,e,i,n,!0)},e.destroy=function(t){void 0===t&&(t=!0),this.destroyed=!0,this._destroyAllComponent(),this._parent&&this._parent.removeChild(this),this._children&&(t?this.destroyChildren():this.removeChildren()),this.onDestroy(),this._children=null,this.offAll()},e.onDestroy=function(){},e.destroyChildren=function(){if(this._children)for(var t=0,e=this._children.length;t=0)return null;this._extUIChild.push(t)}return null},e.removeInputChild=function(t){var e=this._extUIChild.indexOf(t);e>=0&&this._extUIChild.splice(e,1)},e.addChildren=function(t){for(var e=arguments,i=0,n=e.length;i=0&&e<=this._children.length){if(t._parent===this){var i=this.getChildIndex(t);this._children.splice(i,1),this._children.splice(e,0,t),this._childChanged()}else t._parent&&t._parent.removeChild(t),this._children===Node.ARRAY_EMPTY&&(this._children=[]),this._children.splice(e,0,t),t._setParent(this);return t}throw new Error("appendChildAt:The index is out of bounds")},e.getChildIndex=function(t){return this._children.indexOf(t)},e.getChildByName=function(t){var e=this._children;if(e)for(var i=0,n=e.length;i=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._childChanged(),t},e._childChanged=function(t){},e.removeChild=function(t){if(!this._children)return t;var e=this._children.indexOf(t);return this.removeChildAt(e)},e.removeSelf=function(){return this._parent&&this._parent.removeChild(this),this},e.removeChildByName=function(t){var e=this.getChildByName(t);return e&&this.removeChild(e),e},e.removeChildAt=function(t){var e=this.getChildAt(t);return e&&(this._children.splice(t,1),e._setParent(null)),e},e.removeChildren=function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=2147483647),this._children&&this._children.length>0){var i=this._children;if(0===t&&e>=i.length-1){var n=i;this._children=Node.ARRAY_EMPTY}else n=i.splice(t,e-t);for(var r=0,s=n.length;r-1?(this._children.splice(i,1,t),e._setParent(null),t._setParent(this),t):null},e._setParent=function(t){this._parent!==t&&(t?(this._parent=t,this._onAdded(),this.event("added"),this._getBit(16)&&(this._setUpNoticeChain(),t.displayedInStage&&this._displayChild(this,!0)),t._childChanged(this)):(this._onRemoved(),this.event("removed"),this._parent._childChanged(),this._getBit(16)&&this._displayChild(this,!1),this._parent=t))},e._updateDisplayedInstage=function(){var t;t=this;for(var e=i.stage,n=!1;t;){if(t._getBit(16)){n=t._getBit(128);break}if(t===e||t._getBit(128)){n=!0;break}t=t._parent}this._setBit(128,n)},e._setDisplay=function(t){this._getBit(128)!==t&&(this._setBit(128,t),t?this.event("display"):this.event("undisplay"))},e._displayChild=function(t,e){var i=t._children;if(i)for(var n=0,r=i.length;n0?this._displayChild(s,e):s._setDisplay(e))}t._setDisplay(e)},e.contains=function(t){if(t===this)return!0;for(;t;){if(t._parent===this)return!0;t=t._parent}return!1},e.timerLoop=function(t,e,n,r,s,a){void 0===s&&(s=!0),void 0===a&&(a=!1),(this.scene?this.scene.timer:i.timer).loop(t,e,n,r,s,a)},e.timerOnce=function(t,e,n,r,s){void 0===s&&(s=!0),(this.scene?this.scene.timer:i.timer)._create(!1,!1,t,e,n,r,s)},e.frameLoop=function(t,e,n,r,s){void 0===s&&(s=!0),(this.scene?this.scene.timer:i.timer)._create(!0,!0,t,e,n,r,s)},e.frameOnce=function(t,e,n,r,s){void 0===s&&(s=!0),(this.scene?this.scene.timer:i.timer)._create(!0,!1,t,e,n,r,s)},e.clearTimer=function(t,e){(this.scene?this.scene.timer:i.timer).clear(t,e)},e.callLater=function(t,e){(this.scene?this.scene.timer:i.timer).callLater(this,t,e)},e.runCallLater=function(t){(this.scene?this.scene.timer:i.timer).runCallLater(this,t)},e._onActive=function(){kt.spriteCount++},e._onInActive=function(){kt.spriteCount--},e._onActiveInScene=function(){},e._onInActiveInScene=function(){},e._parse=function(t,e){},e._setBelongScene=function(t){if(!this._scene){if(this._scene=t,this._components)for(var e=0,i=this._components.length;ethis._maxsize+64&&(this._buffer=this._buffer.slice(0,this._maxsize+64),this._bufferSize=this._buffer.byteLength,this._checkArrayUse()),this._maxsize=this._byteLength),this._uploadSizethis._maxsize+64&&(this._buffer=this._buffer.slice(0,this._maxsize+64),this._bufferSize=this._buffer.byteLength,this._checkArrayUse()),this._maxsize=this._byteLength),this._uploadSize0){var r=new ArrayBuffer(t),s=n&&n.buffer==i?n:new Uint8Array(i);(n=this._u8Array=new Uint8Array(r)).set(s,0),i=this._buffer=r}else i=this._buffer=new ArrayBuffer(t),this._u8Array=null;return this._checkArrayUse(),this._upload=!0,this._bufferSize=i.byteLength,this},e.append=function(t){this._upload=!0;var e,i;e=t.byteLength,t instanceof Uint8Array?(this._resizeBuffer(this._byteLength+e,!0),i=new Uint8Array(this._buffer,this._byteLength)):t instanceof Uint16Array?(this._resizeBuffer(this._byteLength+e,!0),i=new Uint16Array(this._buffer,this._byteLength)):t instanceof Float32Array&&(this._resizeBuffer(this._byteLength+e,!0),i=new Float32Array(this._buffer,this._byteLength)),i.set(t,0),this._byteLength+=e,this._checkArrayUse()},e.appendU16Array=function(t,e){this._resizeBuffer(this._byteLength+2*e,!0);var i=new Uint16Array(this._buffer,this._byteLength,e);if(6==e)i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5];else if(e>=100)i.set(new Uint16Array(t.buffer,0,e));else for(var n=0;n=this.maxLoader)){for(var t=0;t0;){var i=e.shift();if(i)return this._doLoad(i)}this._loaderCount||this.event("complete")}},s._doLoad=function(t){this._loaderCount++;var e=this._loaders.length?this._loaders.pop():new Ce;e.on("complete",null,onLoaded),e.on("progress",null,function(e){t.event("progress",e)}),e.on("error",null,function(t){onLoaded(null)});var i=this;function onLoaded(n){e.offAll(),e._data=null,e._customParse=!1,i._loaders.push(e),i._endLoad(t,n instanceof Array?[n]:n),i._loaderCount--,i._next()}e._constructParams=t.createConstructParams,e._propertyParams=t.createPropertyParams,e._createCache=t.createCache,e.load(t.url,t.type,t.cache,t.group,t.ignoreCache,t.useWorkerLoader)},s._endLoad=function(t,e){var n=t.url;if(null==e){var r=this._failRes[n]||0;if(r-1;i--){var n=e[i];n&&(n.offAll(),this._infoPool.push(n))}e.length=0}this._loaderCount=0,LoaderManager._resMap={}},s.cancelLoadByUrls=function(t){if(t)for(var e=0,i=t.length;e-1;n--){var r=i[n];r&&r.url===t&&(i[n]=null,r.offAll(),this._infoPool.push(r))}LoaderManager._resMap[t]&&delete LoaderManager._resMap[t]},s._loadAssets=function(t,e,i,n,r,s,a){void 0===r&&(r=1),void 0===s&&(s=!0);for(var o=t.length,h=0,u=0,l=[],c=!0,_=0;_0&&(c.strokeStyle=r,c.lineWidth=i,c.strokeText(t,a,o)),c.fillStyle=n,c.fillText(t,a,o),this.showDbgInfo&&(c.strokeStyle="#ff0000",c.strokeRect(0,0,_,d),c.strokeStyle="#00ff00",c.strokeRect(a,o,s.width,s.height)),l&&-1==l[2]&&(l[2]=Math.ceil((s.width+2*i)*this.lastScaleX));var m=l?c.getImageData(l[0],l[1],l[2],l[3]):c.getImageData(0,0,_,d);return c.restore(),s.bmpWidth=m.width,s.bmpHeight=m.height,m},n.getCharCanvas=function(t,e,i,n,r,s,a,o,h,u){var l=this.ctx;l.font!=e&&(l.font=e,l._lastFont=e),s.width=l.measureText(t).width;var c=s.width*this.lastScaleX,_=s.height*this.lastScaleY;return c+=(a+h)*this.lastScaleX,_+=(o+u)*this.lastScaleY+1,c=Math.min(c,this.maxTexW),_=Math.min(_,this.maxTexH),CharRender_Canvas.canvas.width=Math.min(c+1,this.maxTexW),CharRender_Canvas.canvas.height=Math.min(_+1,this.maxTexH),l.font=e,l.clearRect(0,0,c+1+i,_+1+i),this.settrans.call(l,1,0,0,1,0,0),l.save(),this.scaleFontSize&&l.scale(this.lastScaleX,this.lastScaleY),l.translate(a,o),l.textAlign="left",l.textBaseline="top",i>0?(l.strokeStyle=r,l.fillStyle=n,l.lineWidth=i,l.fillAndStrokeText?l.fillAndStrokeText(t,0,0):(l.strokeText(t,0,0),l.fillText(t,0,0))):(l.fillStyle=n,l.fillText(t,0,0)),this.showDbgInfo&&(l.strokeStyle="#ff0000",l.strokeRect(0,0,c,_),l.strokeStyle="#00ff00",l.strokeRect(0,0,s.width,s.height)),l.restore(),s.bmpWidth=CharRender_Canvas.canvas.width,s.bmpHeight=CharRender_Canvas.canvas.height,CharRender_Canvas.canvas},s(0,n,"canvasWidth",function(){return CharRender_Canvas.canvas.width},function(t){CharRender_Canvas.canvas.width!=t&&(CharRender_Canvas.canvas.width=t,t>2048&&console.warn("画文字设置的宽度太大,超过2048了"),this.settrans.call(this.ctx,1,0,0,1,0,0),this.ctx.scale(this.lastScaleX,this.lastScaleY))}),CharRender_Canvas.canvas=null,CharRender_Canvas}(),Ie=function(t){function SubmitTexture(t){void 0===t&&(t=1e4),SubmitTexture.__super.call(this,t)}r(SubmitTexture,"laya.webgl.submit.SubmitTexture",V);var e=SubmitTexture.prototype;return e.clone=function(t,e,i){var n=SubmitTexture._poolSize?SubmitTexture.POOL[--SubmitTexture._poolSize]:new SubmitTexture;return this._cloneInit(n,t,e,i),n},e.releaseRender=function(){--this._ref<1&&(SubmitTexture.POOL[SubmitTexture._poolSize++]=this,this.shaderValue.release(),this._mesh=null,this._parent&&(this._parent.releaseRender(),this._parent=null))},e.renderSubmit=function(){if(0===this._numEle)return 1;var t=this.shaderValue.textureHost;if(t){var e=t?t._getSource():null;if(!e)return 1}var i=j.mainContext;this._mesh.useMesh(i);var n=V.preRender,r=V.preRender._key;return 0===this._key.blendShader&&this._key.submitType===r.submitType&&this._key.blendShader===r.blendShader&&$e.activeShader&&V.preRender.clipInfoID==this.clipInfoID&&n.shaderValue.defines._value===this.shaderValue.defines._value&&0==(this.shaderValue.defines._value&Pe.NOOPTMASK)?$e.activeShader.uploadTexture2D(e):(Lt.activeBlendFunction!==this._blendFn&&(jt.setBlend(i,!0),this._blendFn(i),Lt.activeBlendFunction=this._blendFn),this.shaderValue.texture=e,this.shaderValue.upload()),i.drawElements(4,this._numEle,5123,this._startIdx),kt.renderBatches++,kt.trianglesFaces+=this._numEle/3,1},SubmitTexture.create=function(t,e,i){var n=SubmitTexture._poolSize?SubmitTexture.POOL[--SubmitTexture._poolSize]:new SubmitTexture(10016);n._mesh=e,n._key.clear(),n._key.submitType=2,n._ref=1,n._startIdx=e.indexNum*ft.BYTES_PIDX,n._numEle=0;var r=t._nBlendType;if(n._key.blendShader=r,n._blendFn=t._targets?Lt.targetFns[r]:Lt.fns[r],n.shaderValue=i,t._colorFiler){var s=t._colorFiler;i.defines.add(s.type),i.colorMat=s._mat,i.colorAlpha=s._alpha}return n},SubmitTexture._poolSize=0,SubmitTexture.POOL=[],SubmitTexture}(),Pe=function(t){function ShaderDefines2D(){ShaderDefines2D.__super.call(this,ShaderDefines2D.__name2int,ShaderDefines2D.__int2name,ShaderDefines2D.__int2nameMap)}return r(ShaderDefines2D,"laya.webgl.shader.d2.ShaderDefines2D",M),ShaderDefines2D.__init__=function(){ShaderDefines2D.reg("TEXTURE2D",1),ShaderDefines2D.reg("PRIMITIVE",4),ShaderDefines2D.reg("GLOW_FILTER",8),ShaderDefines2D.reg("BLUR_FILTER",16),ShaderDefines2D.reg("COLOR_FILTER",32),ShaderDefines2D.reg("COLOR_ADD",64),ShaderDefines2D.reg("WORLDMAT",128),ShaderDefines2D.reg("FILLTEXTURE",256),ShaderDefines2D.reg("FSHIGHPRECISION",1024),ShaderDefines2D.reg("MVP3D",2048)},ShaderDefines2D.reg=function(t,e){M._reg(t,e,ShaderDefines2D.__name2int,ShaderDefines2D.__int2name)},ShaderDefines2D.toText=function(t,e,i){return M._toText(t,e,i)},ShaderDefines2D.toInt=function(t){return M._toInt(t,ShaderDefines2D.__name2int)},ShaderDefines2D.TEXTURE2D=1,ShaderDefines2D.PRIMITIVE=4,ShaderDefines2D.FILTERGLOW=8,ShaderDefines2D.FILTERBLUR=16,ShaderDefines2D.FILTERCOLOR=32,ShaderDefines2D.COLORADD=64,ShaderDefines2D.WORLDMAT=128,ShaderDefines2D.FILLTEXTURE=256,ShaderDefines2D.SKINMESH=512,ShaderDefines2D.SHADERDEFINE_FSHIGHPRECISION=1024,ShaderDefines2D.MVP3D=2048,ShaderDefines2D.NOOPTMASK=312,ShaderDefines2D.__name2int={},ShaderDefines2D.__int2name=[],ShaderDefines2D.__int2nameMap=[],ShaderDefines2D}(),Be=function(e){function CharRender_Native(){this.lastFont="",CharRender_Native.__super.call(this)}r(CharRender_Native,"laya.webgl.text.CharRender_Native",N);var i=CharRender_Native.prototype;return i.getWidth=function(e,i){return t.conchTextCanvas?(t.conchTextCanvas.font=e,this.lastFont=e,t.conchTextCanvas.measureText(i).width):0},i.scale=function(t,e){},i.getCharBmp=function(e,i,n,r,s,a,h,u,l,c,_){if(!t.conchTextCanvas)return null;t.conchTextCanvas.font=i,this.lastFont=i;a.width=t.conchTextCanvas.measureText(e).width,a.height;var d=o.create(s).numColor,f=o.create(r).numColor,p=t.conchTextCanvas.getTextBitmapData(e,f,n>2?2:n,d);return a.bmpWidth=p.width,a.bmpHeight=p.height,p},CharRender_Native}(),Ge=(function(t){function Script(){Script.__super.call(this)}r(Script,"laya.components.Script",v);var e=Script.prototype;e._onAwake=function(){this.onAwake(),this.onStart!==laya.components.Script.prototype.onStart&&i.startTimer.callLater(this,this.onStart)},e._onEnable=function(){var t=laya.components.Script.prototype;this.onTriggerEnter!==t.onTriggerEnter&&this.owner.on("triggerenter",this,this.onTriggerEnter),this.onTriggerStay!==t.onTriggerStay&&this.owner.on("triggerstay",this,this.onTriggerStay),this.onTriggerExit!==t.onTriggerExit&&this.owner.on("triggerexit",this,this.onTriggerExit),this.onMouseDown!==t.onMouseDown&&this.owner.on("mousedown",this,this.onMouseDown),this.onMouseUp!==t.onMouseUp&&this.owner.on("mouseup",this,this.onMouseUp),this.onClick!==t.onClick&&this.owner.on("click",this,this.onClick),this.onStageMouseDown!==t.onStageMouseDown&&i.stage.on("mousedown",this,this.onStageMouseDown),this.onStageMouseUp!==t.onStageMouseUp&&i.stage.on("mouseup",this,this.onStageMouseUp),this.onStageClick!==t.onStageClick&&i.stage.on("click",this,this.onStageClick),this.onStageMouseMove!==t.onStageMouseMove&&i.stage.on("mousemove",this,this.onStageMouseMove),this.onDoubleClick!==t.onDoubleClick&&this.owner.on("doubleclick",this,this.onDoubleClick),this.onRightClick!==t.onRightClick&&this.owner.on("rightclick",this,this.onRightClick),this.onMouseMove!==t.onMouseMove&&this.owner.on("mousemove",this,this.onMouseMove),this.onMouseOver!==t.onMouseOver&&this.owner.on("mouseover",this,this.onMouseOver),this.onMouseOut!==t.onMouseOut&&this.owner.on("mouseout",this,this.onMouseOut),this.onKeyDown!==t.onKeyDown&&i.stage.on("keydown",this,this.onKeyDown),this.onKeyPress!==t.onKeyPress&&i.stage.on("keypress",this,this.onKeyPress),this.onKeyUp!==t.onKeyUp&&i.stage.on("keyup",this,this.onKeyUp),this.onUpdate!==t.onUpdate&&i.updateTimer.frameLoop(1,this,this.onUpdate),this.onLateUpdate!==t.onLateUpdate&&i.lateTimer.frameLoop(1,this,this.onLateUpdate),this.onPreRender!==t.onPreRender&&i.lateTimer.frameLoop(1,this,this.onPreRender)},e._onDisable=function(){this.owner.offAllCaller(this),i.stage.offAllCaller(this),i.startTimer.clearAll(this),i.updateTimer.clearAll(this),i.lateTimer.clearAll(this)},e._isScript=function(){return!0},e._onDestroy=function(){this.onDestroy()},e.onAwake=function(){},e.onEnable=function(){},e.onStart=function(){},e.onTriggerEnter=function(t,e,i){},e.onTriggerStay=function(t,e,i){},e.onTriggerExit=function(t,e,i){},e.onMouseDown=function(t){},e.onMouseUp=function(t){},e.onClick=function(t){},e.onStageMouseDown=function(t){},e.onStageMouseUp=function(t){},e.onStageClick=function(t){},e.onStageMouseMove=function(t){},e.onDoubleClick=function(t){},e.onRightClick=function(t){},e.onMouseMove=function(t){},e.onMouseOver=function(t){},e.onMouseOut=function(t){},e.onKeyDown=function(t){},e.onKeyPress=function(t){},e.onKeyUp=function(t){},e.onUpdate=function(){},e.onLateUpdate=function(){},e.onPreRender=function(){},e.onPostRender=function(){},e.onDisable=function(){},e.onDestroy=function(){},s(0,e,"isSingleton",function(){return!1})}(),function(t){function WebAudioSound(){this.url=null,this.loaded=!1,this.data=null,this.audioBuffer=null,this.__toPlays=null,this._disposed=!1,WebAudioSound.__super.call(this)}r(WebAudioSound,"laya.media.webaudio.WebAudioSound",f);var e=WebAudioSound.prototype;return e.load=function(t){var e=this;if(t=Ut.formatURL(t),this.url=t,this.audioBuffer=WebAudioSound._dataCache[t],this.audioBuffer)this._loaded(this.audioBuffer);else if(WebAudioSound.e.on("loaded:"+t,this,this._loaded),WebAudioSound.e.on("err:"+t,this,this._err),!WebAudioSound.__loadingSound[t]){WebAudioSound.__loadingSound[t]=!0;var i=new Y.window.XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){e._disposed?e._removeLoadEvents():(e.data=i.response,WebAudioSound.buffs.push({buffer:e.data,url:e.url}),WebAudioSound.decode())},i.onerror=function(t){e._err()},i.send()}},e._err=function(){this._removeLoadEvents(),WebAudioSound.__loadingSound[this.url]=!1,this.event("error")},e._loaded=function(t){this._removeLoadEvents(),this._disposed||(this.audioBuffer=t,WebAudioSound._dataCache[this.url]=this.audioBuffer,this.loaded=!0,this.event("complete"))},e._removeLoadEvents=function(){WebAudioSound.e.off("loaded:"+this.url,this,this._loaded),WebAudioSound.e.off("err:"+this.url,this,this._err)},e.__playAfterLoaded=function(){if(this.__toPlays){var t,e,i,n=0;for(t=(e=this.__toPlays).length,n=0;nh&&(i-=t+i-h),e+n>u&&(n-=e+n-u),i<=0||n<=0)return null;var l=4*i,c=null;try{c=o.getPixels()}catch(t){}if(c){if(0==t&&0==e&&i==h&&n==u)return c;var _=new Uint8Array(i*n*4);for(r=4*t,s=(e+n-1)*(l=4*h)+4*t,a=n-1;a>=0;a--)_.set(x.slice(s,s+4*i),r),r+=l,s-=l;return _}var d=new me;d.size(i,n),d.asBitmap=!0;var f=null;if(0!=t||0!=e||i!=h||n!=u){var p=(f=f.concat())[0],m=f[1],g=(f[2]-p)/h,v=(f[7]-m)/u;f=[p+t*g,m+e*v,p+(t+i)*g,m+e*v,p+(t+i)*g,m+(e+n)*v,p+t*g,m+(e+n)*v]}d._drawTextureM(this,0,0,i,n,null,1,f),d._targets.start(),d.flush(),d._targets.end(),d._targets.restore();var x=d._targets.getData(0,0,i,n);for(d.destroy(),_=new Uint8Array(i*n*4),r=0,s=(n-1)*l,a=n-1;a>=0;a--)_.set(x.slice(s,s+l),r),r+=l,s-=l;return _},e.getPixels=function(t,e,i,n){return K.isConchApp?this._nativeObj.getImageData(t,e,i,n):this.getTexturePixels(t,e,i,n)},e.recoverBitmap=function(t){var e=this,n=this._bitmap.url;this._destroyed||this._bitmap&&!this._bitmap.destroyed||!n||i.loader.load(n,p.create(this,function(i){e.bitmap=i,t&&t()}),null,"htmlimage",1,!1,null,!0)},e.disposeBitmap=function(){!this._destroyed&&this._bitmap&&this._bitmap.destroy()},e.destroy=function(t){if(void 0===t&&(t=!1),!this._destroyed){this._destroyed=!0;var e=this._bitmap;e&&(e._removeReference(this._referenceCount),(0===e.referenceCount||t)&&e.destroy(),e=null),this.url&&this===i.loader.getRes(this.url)&&i.loader.clearRes(this.url)}},s(0,e,"height",function(){return this._h?this._h:this.bitmap?this.uv&&this.uv!==Texture.DEF_UV?(this.uv[5]-this.uv[1])*this.bitmap.height:this.bitmap.height:0},function(t){this._h=t,this.sourceHeight||(this.sourceHeight=t)}),s(0,e,"uv",function(){return this._uv},function(t){this.uvrect[0]=Math.min(t[0],t[2],t[4],t[6]),this.uvrect[1]=Math.min(t[1],t[3],t[5],t[7]),this.uvrect[2]=Math.max(t[0],t[2],t[4],t[6])-this.uvrect[0],this.uvrect[3]=Math.max(t[1],t[3],t[5],t[7])-this.uvrect[1],this._uv=t}),s(0,e,"width",function(){return this._w?this._w:this.bitmap?this.uv&&this.uv!==Texture.DEF_UV?(this.uv[2]-this.uv[0])*this.bitmap.width:this.bitmap.width:0},function(t){this._w=t,this.sourceWidth||(this.sourceWidth=t)}),s(0,e,"bitmap",function(){return this._bitmap},function(t){this._bitmap&&this._bitmap._removeReference(this._referenceCount),this._bitmap=t,t&&t._addReference(this._referenceCount)}),s(0,e,"destroyed",function(){return this._destroyed}),Texture.moveUV=function(t,e,i){for(var n=0;n<8;n+=2)i[n]+=t,i[n+1]+=e;return i},Texture.create=function(t,e,i,n,r,s,a,o,h){return void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0),Texture._create(t,e,i,n,r,s,a,o,h)},Texture._create=function(t,e,i,n,r,s,a,o,h,u){void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=0),void 0===h&&(h=0);var l,c=t instanceof laya.resource.Texture,_=c?t.uv:Texture.DEF_UV,d=c?t.bitmap:t;d.width&&e+n>d.width&&(n=d.width-e),d.height&&i+r>d.height&&(r=d.height-i),u?(l=u).setTo(d,null,o||n,h||r):l=new Texture(d,null,o||n,h||r),l.width=n,l.height=r,l.offsetX=s,l.offsetY=a;var f=1/d.width,p=1/d.height;e*=f,i*=p,n*=f,r*=p;var m=l.uv[0],g=l.uv[1],v=l.uv[4],x=l.uv[5],y=v-m,T=x-g,b=Texture.moveUV(_[0],_[1],[e,i,e+n,i,e+n,i+r,e,i+r]);l.uv=new Float32Array([m+b[0]*y,g+b[1]*T,v-(1-b[2])*y,g+b[3]*T,v-(1-b[4])*y,x-(1-b[5])*T,m+b[6]*y,x-(1-b[7])*T]);var C=d.scaleRate;return C&&1!=C?(l.sourceWidth/=C,l.sourceHeight/=C,l.width/=C,l.height/=C,l.scaleRate=C):l.scaleRate=1,l},Texture.createFromTexture=function(t,e,i,n,r){var s=t.scaleRate;1!=s&&(e*=s,i*=s,n*=s,r*=s);var a=mt.TEMP.setTo(e-t.offsetX,i-t.offsetY,n,r),o=a.intersection(Texture._rect1.setTo(0,0,t.width,t.height),Texture._rect2);return o?Texture.create(t,o.x,o.y,o.width,o.height,o.x-a.x,o.y-a.y,n,r):null},Texture.DEF_UV=new Float32Array([0,0,1,0,1,1,0,1]),Texture.NO_UV=new Float32Array([0,0,0,0,0,0,0,0]),Texture.INV_UV=new Float32Array([0,1,1,1,1,0,0,0]),Texture._rect1=new mt,Texture._rect2=new mt,Texture}()),We=function(t){function SkinSV(t){this.texcoord=null,this.position=null,this.offsetX=300,this.offsetY=0,SkinSV.__super.call(this,512,0);var e=8*ft.BYTES_PE;this.position=[2,5126,!1,e,0],this.texcoord=[2,5126,!1,e,2*ft.BYTES_PE],this.color=[4,5126,!1,e,4*ft.BYTES_PE]}return r(SkinSV,"laya.webgl.shader.d2.skinAnishader.SkinSV",st),SkinSV}(),Oe=(function(t){function Sound(){Sound.__super.call(this)}r(Sound,"laya.media.Sound",f);var e=Sound.prototype;e.load=function(t){},e.play=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),null},e.dispose=function(){},s(0,e,"duration",function(){return 0})}(),function(t){function MeshQuadTexture(){MeshQuadTexture.__super.call(this,24,4,4),this.canReuse=!0,this.setAttributes(laya.webgl.utils.MeshQuadTexture._fixattriInfo),laya.webgl.utils.MeshQuadTexture._fixib?(this._ib=laya.webgl.utils.MeshQuadTexture._fixib,this._quadNum=MeshQuadTexture._maxIB):(this.createQuadIB(MeshQuadTexture._maxIB),laya.webgl.utils.MeshQuadTexture._fixib=this._ib)}r(MeshQuadTexture,"laya.webgl.utils.MeshQuadTexture",et);var e=MeshQuadTexture.prototype;return e.releaseMesh=function(){this._vb.setByteLength(0),this.vertNum=0,this.indexNum=0,laya.webgl.utils.MeshQuadTexture._POOL.push(this)},e.destroy=function(){this._vb.destroy(),this._vb.deleteBuffer()},e.addQuad=function(t,e,i,n){var r=this._vb,s=r._byteLength>>2;r.setByteLength(s+24<<2);var a=r._floatArray32||r.getFloat32Array(),o=r._uint32Array,h=s,u=n?255:0;a[h++]=t[0],a[h++]=t[1],a[h++]=e[0],a[h++]=e[1],o[h++]=i,o[h++]=u,a[h++]=t[2],a[h++]=t[3],a[h++]=e[2],a[h++]=e[3],o[h++]=i,o[h++]=u,a[h++]=t[4],a[h++]=t[5],a[h++]=e[4],a[h++]=e[5],o[h++]=i,o[h++]=u,a[h++]=t[6],a[h++]=t[7],a[h++]=e[6],a[h++]=e[7],o[h++]=i,o[h++]=u,r._upload=!0},MeshQuadTexture.getAMesh=function(t){var e=null;return e=laya.webgl.utils.MeshQuadTexture._POOL.length?laya.webgl.utils.MeshQuadTexture._POOL.pop():new MeshQuadTexture,t&&e._vb._resizeBuffer(1572864,!1),e},MeshQuadTexture.const_stride=24,MeshQuadTexture._fixib=null,MeshQuadTexture._maxIB=16384,MeshQuadTexture._POOL=[],n(MeshQuadTexture,["_fixattriInfo",function(){return this._fixattriInfo=[5126,4,0,5121,4,16,5121,4,20]}]),MeshQuadTexture}()),Ne=function(t){function MeshTexture(){MeshTexture.__super.call(this,24,4,4),this.canReuse=!0,this.setAttributes(laya.webgl.utils.MeshTexture._fixattriInfo)}r(MeshTexture,"laya.webgl.utils.MeshTexture",et);var e=MeshTexture.prototype;return e.addData=function(t,e,i,n,r){var s=this._vb,a=this._ib,o=t.length>>1,h=s.needSize(24*o)>>2,u=s._floatArray32||s.getFloat32Array(),l=s._uint32Array,c=0,_=n.a,d=n.b,f=n.c,p=n.d,m=n.tx,g=n.ty,v=0;for(v=0;v>1;if(T>0){var M=w+b,A=0;for(v=w;v=0||Ce.getRes(t)||(e?this._toLoadList.push({url:t}):this._toLoadList.push(t),this.totalCount++)},e._checkNext=function(){if(!this._isLoading){if(0==this._toLoadList.length)return void this.event("complete");var t;"string"==typeof(t=this._toLoadList.pop())?this.loadOne(t):this.loadOne(t.url,!0)}},e.loadOne=function(t,e){void 0===e&&(e=!1),this._curUrl=t;var n=St.getFileExtension(this._curUrl);e?i.loader.create(t,this._completeHandler):SceneLoader.LoadableExtensions[n]?i.loader.load(t,this._completeHandler,null,SceneLoader.LoadableExtensions[n]):t!=Ht.getFileLoadPath(t)||SceneLoader.No3dLoadTypes[n]||!Re.createMap[n]?i.loader.load(t,this._completeHandler):i.loader.create(t,this._completeHandler)},e.onOneLoadComplete=function(){this._isLoading=!1,Ce.getRes(this._curUrl)||console.log("Fail to load:",this._curUrl);var t,e=St.getFileExtension(this._curUrl);SceneLoader.LoadableExtensions[e]&&((t=Ce.getRes(this._curUrl))&&t instanceof laya.components.Prefab&&(t=t.json),t&&(t.loadList&&this.load(t.loadList,!1,!1),t.loadList3D&&this.load(t.loadList3D,!0,!1)));"sk"==e&&this.load(this._curUrl.replace(".sk",".png"),!1,!1),this.event("progress",this.getProgress()),this._checkNext()},e.getProgress=function(){return this.loadedCount/this.totalCount},s(0,e,"loadedCount",function(){return this.totalCount-this.leftCount}),s(0,e,"leftCount",function(){return this._isLoading?this._toLoadList.length+1:this._toLoadList.length}),n(SceneLoader,["LoadableExtensions",function(){return this.LoadableExtensions={scene:"json",scene3d:"json",ani:"json",ui:"json",prefab:"prefab"}},"No3dLoadTypes",function(){return this.No3dLoadTypes={png:!0,jpg:!0,txt:!0}}]),SceneLoader}(),ke=function(t){function TextureSV(t){this.u_colorMatrix=null,this.strength=0,this.blurInfo=null,this.colorMat=null,this.colorAlpha=null,void 0===t&&(t=0),TextureSV.__super.call(this,1,t),this._attribLocation=["posuv",0,"attribColor",1,"attribFlags",2]}return r(TextureSV,"laya.webgl.shader.d2.value.TextureSV",st),TextureSV.prototype.clear=function(){this.texture=null,this.shader=null,this.defines._value=this.subID+(j.shaderHighPrecision?1024:0)},TextureSV}(),Ve=function(t){function MeshVG(){MeshVG.__super.call(this,12,4,4),this.canReuse=!0,this.setAttributes(laya.webgl.utils.MeshVG._fixattriInfo)}r(MeshVG,"laya.webgl.utils.MeshVG",et);var e=MeshVG.prototype;return e.addVertAndIBToMesh=function(t,e,i,n){for(var r=this._vb.needSize(e.length/2*12)>>2,s=this._vb._floatArray32||this._vb.getFloat32Array(),a=this._vb._uint32Array,o=0,h=e.length/2,u=0;u0?3*t/100:t/100),i=1-e,n=.3086*i,r=.6094*i,s=.082*i;return this._multiplyMatrix([n+e,r,s,0,0,n,r+e,s,0,0,n,r,s+e,0,0,0,0,0,1,0,0,0,0,0,1])},e.adjustHue=function(t){if(0==(t=this._clampValue(t,180)/180*Math.PI)||isNaN(t))return this;var e=Math.cos(t),i=Math.sin(t),n=.213,r=.715,s=.072;return this._multiplyMatrix([n+e*(1-n)+i*-n,r+e*-r+i*-r,s+e*-s+i*(1-s),0,0,n+e*-n+.143*i,r+e*(1-r)+.14*i,s+e*-s+-.283*i,0,0,n+e*-n+-.787*i,r+e*-r+i*r,s+e*(1-s)+i*s,0,0,0,0,0,1,0,0,0,0,0,1])},e.reset=function(){return this.setByMatrix(this._copyMatrix(ColorFilter.IDENTITY_MATRIX))},e._multiplyMatrix=function(t){var e=[];this._matrix=this._fixMatrix(this._matrix);for(var i=0;i<5;i++){for(var n=0;n<5;n++)e[n]=this._matrix[n+5*i];for(n=0;n<5;n++){for(var r=0,s=0;s<5;s++)r+=t[n+5*s]*e[s];this._matrix[n+5*i]=r}}return this.setByMatrix(this._matrix)},e._clampValue=function(t,e){return Math.min(e,Math.max(-e,t))},e._fixMatrix=function(t){return null==t?ColorFilter.IDENTITY_MATRIX:(t.length<25?t=t.slice(0,t.length).concat(ColorFilter.IDENTITY_MATRIX.slice(t.length,25)):t.length>25&&(t=t.slice(0,25)),t)},e._copyMatrix=function(t){this._matrix||(this._matrix=[]);for(var e=0;e<25;e++)this._matrix[e]=t[e];return this._matrix},s(0,e,"type",function(){return 32}),ColorFilter.LENGTH=25,n(ColorFilter,["DELTA_INDEX",function(){return this.DELTA_INDEX=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10]},"GRAY_MATRIX",function(){return this.GRAY_MATRIX=[.3086,.6094,.082,0,0,.3086,.6094,.082,0,0,.3086,.6094,.082,0,0,0,0,0,1,0]},"IDENTITY_MATRIX",function(){return this.IDENTITY_MATRIX=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}]),ColorFilter}(),Xe=function(t){function TextStyle(){this.italic=!1,TextStyle.__super.call(this)}r(TextStyle,"laya.display.css.TextStyle",t);var e=TextStyle.prototype;return e.reset=function(){return t.prototype.reset.call(this),this.italic=!1,this.align="left",this.wordWrap=!1,this.leading=0,this.padding=[0,0,0,0],this.bgColor=null,this.borderColor=null,this.asPassword=!1,this.stroke=0,this.strokeColor="#000000",this.bold=!1,this.underline=!1,this.underlineColor=null,this.currBitmapFont=null,this},e.recover=function(){this!==TextStyle.EMPTY&&re.recover("TextStyle",this.reset())},e.render=function(t,e,i,n){(this.bgColor||this.borderColor)&&e.drawRect(i,n,t.width,t.height,this.bgColor,this.borderColor,1)},TextStyle.create=function(){return re.getItemByClass("TextStyle",TextStyle)},TextStyle.EMPTY=new TextStyle,TextStyle}(Ct),Ye=function(t){function SubmitCanvas(){this._matrix=new U,this._matrix4=ft.defaultMatrix4.concat(),SubmitCanvas.__super.call(this,1e4),this.shaderValue=new st(0,0)}r(SubmitCanvas,"laya.webgl.submit.SubmitCanvas",V);var e=SubmitCanvas.prototype;return e.renderSubmit=function(){var t=tt.worldAlpha,e=tt.worldMatrix4,i=tt.worldMatrix,n=tt.worldFilters,r=tt.worldShaderDefines,s=this.shaderValue,a=this._matrix,o=this._matrix4,h=U.TEMP;return U.mul(a,i,h),o[0]=h.a,o[1]=h.b,o[4]=h.c,o[5]=h.d,o[12]=h.tx,o[13]=h.ty,tt.worldMatrix=h.clone(),tt.worldMatrix4=o,tt.worldAlpha=tt.worldAlpha*s.alpha,s.filters&&s.filters.length&&(tt.worldFilters=s.filters,tt.worldShaderDefines=s.defines),this.canv.flushsubmit(),tt.worldAlpha=t,tt.worldMatrix4=e,tt.worldMatrix.destroy(),tt.worldMatrix=i,tt.worldFilters=n,tt.worldShaderDefines=r,1},e.releaseRender=function(){if(--this._ref<1){var t=SubmitCanvas.POOL;this._mesh=null,t[t._length++]=this}},e.clone=function(t,e,i){return null},e.getRenderType=function(){return 10003},SubmitCanvas.create=function(t,e,i){var n=SubmitCanvas.POOL._length?SubmitCanvas.POOL[--SubmitCanvas.POOL._length]:new SubmitCanvas;n.canv=t,n._ref=1,n._numEle=0;var r=n.shaderValue;return r.alpha=e,r.defines.setValue(0),i&&i.length&&r.setFilters(i),n},SubmitCanvas.POOL=[],SubmitCanvas.__init$=function(){SubmitCanvas.POOL._length=0},SubmitCanvas}(),ze=function(t){function PrimitiveSV(t){PrimitiveSV.__super.call(this,4,0),this._attribLocation=["position",0,"attribColor",1]}return r(PrimitiveSV,"laya.webgl.shader.d2.value.PrimitiveSV",st),PrimitiveSV}(),Ke=(function(t){function BlurFilter(t){this.strength=NaN,this.strength_sig2_2sig2_gauss1=[],this.strength_sig2_native=null,this.renderFunc=null,BlurFilter.__super.call(this),void 0===t&&(t=4),this.strength=t,this._glRender=new Wt}r(BlurFilter,"laya.filters.BlurFilter",vt);var e=BlurFilter.prototype;e.getStrenth_sig2_2sig2_native=function(){this.strength_sig2_native||(this.strength_sig2_native=new Float32Array(4));var t=this.strength/3,e=t*t;return this.strength_sig2_native[0]=this.strength,this.strength_sig2_native[1]=e,this.strength_sig2_native[2]=2*e,this.strength_sig2_native[3]=1/(2*Math.PI*e),this.strength_sig2_native},s(0,e,"type",function(){return 16})}(),function(t){function GlowFilter(t,e,i,n){this._sv_blurInfo2=[0,0,1,0],this._color=null,this._color_native=null,this._blurInof1_native=null,this._blurInof2_native=null,GlowFilter.__super.call(this),this._elements=new Float32Array(9),this._sv_blurInfo1=new Array(4),void 0===e&&(e=4),void 0===i&&(i=6),void 0===n&&(n=6),this._color=new o(t),this.blur=Math.min(e,20),this.offX=i,this.offY=n,this._sv_blurInfo1[0]=this._sv_blurInfo1[1]=this.blur,this._sv_blurInfo1[2]=i,this._sv_blurInfo1[3]=-n,this._glRender=new L}r(GlowFilter,"laya.filters.GlowFilter",vt);var e=GlowFilter.prototype;e.getColor=function(){return this._color.arrColor},e.getColorNative=function(){this._color_native||(this._color_native=new Float32Array(4));var t=this.getColor();return this._color_native[0]=t[0],this._color_native[1]=t[1],this._color_native[2]=t[2],this._color_native[3]=t[3],this._color_native},e.getBlurInfo1Native=function(){return this._blurInof1_native||(this._blurInof1_native=new Float32Array(4)),this._blurInof1_native[0]=this._blurInof1_native[1]=this.blur,this._blurInof1_native[2]=this.offX,this._blurInof1_native[3]=this.offY,this._blurInof1_native},e.getBlurInfo2Native=function(){return this._blurInof2_native||(this._blurInof2_native=new Float32Array(4)),this._blurInof2_native[2]=1,this._blurInof2_native},s(0,e,"type",function(){return 8}),s(0,e,"offY",function(){return this._elements[6]},function(t){this._elements[6]=t,this._sv_blurInfo1[3]=-t}),s(0,e,"offX",function(){return this._elements[5]},function(t){this._elements[5]=t,this._sv_blurInfo1[2]=t}),s(0,e,"blur",function(){return this._elements[4]},function(t){this._elements[4]=t,this._sv_blurInfo1[0]=this._sv_blurInfo1[1]=t})}(),function(t){function AudioSoundChannel(t){this._audio=null,this._onEnd=null,this._resumePlay=null,AudioSoundChannel.__super.call(this),this._onEnd=St.bind(this.__onEnd,this),this._resumePlay=St.bind(this.__resumePlay,this),t.addEventListener("ended",this._onEnd),this._audio=t}r(AudioSoundChannel,"laya.media.h5audio.AudioSoundChannel",t);var e=AudioSoundChannel.prototype;return e.__onEnd=function(){if(1==this.loops)return this.completeHandler&&(i.systemTimer.once(10,this,this.__runComplete,[this.completeHandler],!1),this.completeHandler=null),this.stop(),void this.event("complete");this.loops>0&&this.loops--,this.startTime=0,this.play()},e.__resumePlay=function(){if(this._audio&&this._audio.removeEventListener("canplay",this._resumePlay),!this.isStopped)try{this._audio.currentTime=this.startTime,Y.container.appendChild(this._audio),this._audio.play()}catch(t){this.event("error")}},e.play=function(){this.isStopped=!1;try{this._audio.playbackRate=rt.playbackRate,this._audio.currentTime=this.startTime}catch(t){return void this._audio.addEventListener("canplay",this._resumePlay)}rt.addChannel(this),Y.container.appendChild(this._audio),"play"in this._audio&&this._audio.play()},e.stop=function(){t.prototype.stop.call(this),this.isStopped=!0,rt.removeChannel(this),this.completeHandler=null,this._audio&&("pause"in this._audio&&K.isConchApp&&this._audio.stop(),this._audio.pause(),this._audio.removeEventListener("ended",this._onEnd),this._audio.removeEventListener("canplay",this._resumePlay),Y.onIE||this._audio!=Se._musicAudio&&re.recover("audio:"+this.url,this._audio),Y.removeElement(this._audio),this._audio=null)},e.pause=function(){this.isStopped=!0,rt.removeChannel(this),"pause"in this._audio&&this._audio.pause()},e.resume=function(){this._audio&&(this.isStopped=!1,rt.addChannel(this),"play"in this._audio&&this._audio.play())},s(0,e,"position",function(){return this._audio?this._audio.currentTime:0}),s(0,e,"duration",function(){return this._audio?this._audio.duration:0}),s(0,e,"volume",function(){return this._audio?this._audio.volume:1},function(t){this._audio&&(this._audio.volume=t)}),AudioSoundChannel}(Te)),je=function(t){function Sprite(){this._x=0,this._y=0,this._width=0,this._height=0,this._visible=!0,this._mouseState=0,this._zOrder=0,this._renderType=0,this._transform=null,this._tfChanged=!1,this._texture=null,this._boundStyle=null,this._graphics=null,this.mouseThrough=!1,this.autoSize=!1,this.hitTestPrior=!1,Sprite.__super.call(this),this._repaint=0,this._style=Ct.EMPTY,this._cacheStyle=y.EMPTY}r(Sprite,"laya.display.Sprite",t);var e=Sprite.prototype;return e.destroy=function(e){void 0===e&&(e=!0),t.prototype.destroy.call(this,e),this._style&&this._style.recover(),this._cacheStyle&&this._cacheStyle.recover(),this._boundStyle&&this._boundStyle.recover(),this._style=null,this._cacheStyle=null,this._boundStyle=null,this._transform=null,this._graphics&&this._graphics.autoDestroy&&this._graphics.destroy(),this._graphics=null,this.texture=null},e.updateZOrder=function(){St.updateOrder(this._children)&&this.repaint()},e._getBoundsStyle=function(){return this._boundStyle||(this._boundStyle=G.create()),this._boundStyle},e._setCustomRender=function(){},e._setCacheAs=function(t){},e._checkCanvasEnable=function(){var t=this._cacheStyle.needEnableCanvasRender();this._getCacheStyle().enableCanvasRender=t,t?(this._cacheStyle.needBitmapCache()?this._cacheStyle.cacheAs="bitmap":this._cacheStyle.cacheAs=this._cacheStyle.userSetCache,this._cacheStyle.reCache=!0,this._renderType|=8):(this._cacheStyle.cacheAs="none",this._cacheStyle.releaseContext(),this._renderType&=-9),this._setCacheAs(this._cacheStyle.cacheAs),this._setRenderType(this._renderType)},e.reCache=function(){this._cacheStyle.reCache=!0,this._repaint|=2},e.getRepaint=function(){return this._repaint},e._setX=function(t){this._x=t},e._setY=function(t){this._y=t},e._setWidth=function(t,e){},e._setHeight=function(t,e){},e.setSelfBounds=function(t){this._getBoundsStyle().userBounds=t},e.getBounds=function(){return this._getBoundsStyle().bounds=mt._getWrapRec(this._boundPointsToParent())},e.getSelfBounds=function(){return this._boundStyle&&this._boundStyle.userBounds?this._boundStyle.userBounds:this._graphics||0!==this._children.length||this._texture?this._getBoundsStyle().bounds=mt._getWrapRec(this._getBoundPointsM(!1)):mt.TEMP.setTo(0,0,0,0)},e._boundPointsToParent=function(t){void 0===t&&(t=!1);var e=0,i=0;this._style&&(e=this.pivotX,i=this.pivotY,t=t||0!==this._style.rotation,this._style.scrollRect&&(e+=this._style.scrollRect.x,i+=this._style.scrollRect.y));var n=this._getBoundPointsM(t);if(!n||n.length<1)return n;if(8!=n.length&&(n=t?$t.scanPList(n):mt._getWrapRec(n,mt.TEMP)._getBoundPoints()),!this.transform)return St.transPointList(n,this._x-e,this._y-i),n;var r=ct.TEMP,s=0,a=n.length;for(s=0;s=0;)t=(r=s[a]).fromParentPoint(t),a--;return t},e.toParentPoint=function(t){if(!t)return t;t.x-=this.pivotX,t.y-=this.pivotY,this.transform&&this._transform.transformPoint(t),t.x+=this._x,t.y+=this._y;var e=this._style.scrollRect;return e&&(t.x-=e.x,t.y-=e.y),t},e.fromParentPoint=function(t){if(!t)return t;t.x-=this._x,t.y-=this._y;var e=this._style.scrollRect;return e&&(t.x+=e.x,t.y+=e.y),this.transform&&this._transform.invertTransformPoint(t),t.x+=this.pivotX,t.y+=this.pivotY,t},e.fromStagePoint=function(t){return t},e.on=function(e,i,n,r){return 1!==this._mouseState&&this.isMouseEvent(e)?(this.mouseEnabled=!0,this._setBit(64,!0),this._parent&&this._$2__onDisplay(),this._createListener(e,i,n,r,!1)):t.prototype.on.call(this,e,i,n,r)},e.once=function(e,i,n,r){return 1!==this._mouseState&&this.isMouseEvent(e)?(this.mouseEnabled=!0,this._setBit(64,!0),this._parent&&this._$2__onDisplay(),this._createListener(e,i,n,r,!0)):t.prototype.once.call(this,e,i,n,r)},e._$2__onDisplay=function(){if(1!==this._mouseState){var t=this;for(t=t.parent;t&&1!==t._mouseState&&!t._getBit(64);)t.mouseEnabled=!0,t._setBit(64,!0),t=t.parent}},e._setParent=function(e){t.prototype._setParent.call(this,e),e&&this._getBit(64)&&this._$2__onDisplay()},e.loadImage=function(t,e){var i=this;if(null==t)this.texture=null,loaded();else{var n=Ce.getRes(t);n||((n=new Fe).load(t),Ce.cacheRes(t,n)),this.texture=n,n.getIsReady()?loaded():n.once("ready",null,loaded)}function loaded(){i.repaint(3),e&&e.run()}return this},e.repaint=function(t){void 0===t&&(t=2),this._repaint&t||(this._repaint|=t,this.parentRepaint(t)),this._cacheStyle&&this._cacheStyle.maskParent&&this._cacheStyle.maskParent.repaint(t)},e._needRepaint=function(){return 2&this._repaint&&this._cacheStyle.enableCanvasRender&&this._cacheStyle.reCache},e._childChanged=function(t){this._children.length?this._renderType|=8192:this._renderType&=-8193,this._setRenderType(this._renderType),t&&this._getBit(32)&&i.systemTimer.callLater(this,this.updateZOrder),this.repaint(3)},e.parentRepaint=function(t){void 0===t&&(t=2);var e=this._parent;!e||e._repaint&t||(e._repaint|=t,e.parentRepaint(t))},e._setMask=function(t){},e.startDrag=function(t,e,i,n,r,s,a){void 0===e&&(e=!1),void 0===i&&(i=0),void 0===n&&(n=300),void 0===s&&(s=!1),void 0===a&&(a=.92),this._style.dragging||(this.getStyle().dragging=new it),this._style.dragging.start(this,t,e,i,n,r,s,a)},e.stopDrag=function(){this._style.dragging&&this._style.dragging.stop()},e._setDisplay=function(e){e||this._cacheStyle&&(this._cacheStyle.releaseContext(),this._cacheStyle.releaseFilterCache(),this._cacheStyle.hasGlowFilter&&(this._cacheStyle.hasGlowFilter=!1)),t.prototype._setDisplay.call(this,e)},e.hitTestPoint=function(t,e){var i=this.globalToLocal(ct.TEMP.setTo(t,e));return t=i.x,e=i.y,(this._style.hitArea?this._style.hitArea:this._width>0&&this._height>0?mt.TEMP.setTo(0,0,this._width,this._height):this.getSelfBounds()).contains(t,e)},e.getMousePoint=function(){return this.globalToLocal(ct.TEMP.setTo(i.stage.mouseX,i.stage.mouseY))},e._setTexture=function(t){},e._setRenderType=function(t){},e._setTranformChange=function(){this._tfChanged=!0,this._renderType|=2,this.parentRepaint(2)},e._setBgStyleColor=function(t,e,i,n,r){},e._setBorderStyleColor=function(t,e,i,n,r,s){},e.captureMouseEvent=function(t){Et.instance.setCapture(this,t)},e.releaseMouseEvent=function(){Et.instance.releaseCapture()},s(0,e,"customRenderEnable",null,function(t){t&&(this._renderType|=2048,this._setRenderType(this._renderType),this._setCustomRender())}),s(0,e,"cacheAs",function(){return this._cacheStyle.cacheAs},function(t){t!==this._cacheStyle.userSetCache&&(this.mask&&"normal"===t||(this._setCacheAs(t),this._getCacheStyle().userSetCache=t,this._checkCanvasEnable(),this.repaint()))}),s(0,e,"globalScaleY",function(){for(var t=1,e=this;e&&e!==i.stage;)t*=e.scaleY,e=e.parent;return t}),s(0,e,"hitArea",function(){return this._style.hitArea},function(t){this.getStyle().hitArea=t}),s(0,e,"staticCache",function(){return this._cacheStyle.staticCache},function(t){this._getCacheStyle().staticCache=t,t||this.reCache()}),s(0,e,"displayWidth",function(){return this.width*this.scaleX}),s(0,e,"zOrder",function(){return this._zOrder},function(t){this._zOrder!=t&&(this._zOrder=t,this._parent&&(t&&this._parent._setBit(32,!0),i.systemTimer.callLater(this._parent,this.updateZOrder)))}),s(0,e,"rotation",function(){return this._style.rotation},function(t){this.getStyle().rotation!==t&&(this._setRotation(t),this._setTranformChange())}),s(0,e,"width",function(){return this.autoSize?this.texture?this.texture.width:this._graphics||0!==this._children.length?this.getSelfBounds().width:0:this._width||(this.texture?this.texture.width:0)},function(t){this._width!==t&&(this._width=t,this._setWidth(this.texture,t),this._setTranformChange())}),s(0,e,"x",function(){return this._x},function(t){if(!this.destroyed&&this._x!==t){this._setX(t),this.parentRepaint(2);var e=this._cacheStyle.maskParent;e&&e.repaint(2)}}),s(0,e,"drawCallOptimize",function(){return this._getBit(256)},function(t){this._setBit(256,t)}),s(0,e,"texture",function(){return this._texture},function(t){"string"==typeof t?this.loadImage(t):this._texture!=t&&(this._texture&&this._texture._removeReference(),this._texture=t,t&&t._addReference(),this._setTexture(t),this._setWidth(this._texture,this.width),this._setHeight(this._texture,this.height),t?this._renderType|=256:this._renderType&=-257,this._setRenderType(this._renderType),this.repaint())}),s(0,e,"globalRotation",function(){for(var t=0,e=this;e&&e!==i.stage;)t+=e.rotation,e=e.parent;return t}),s(0,e,"y",function(){return this._y},function(t){if(!this.destroyed&&this._y!==t){this._setY(t),this.parentRepaint(2);var e=this._cacheStyle.maskParent;e&&e.repaint(2)}}),s(0,e,"displayHeight",function(){return this.height*this.scaleY}),s(0,e,"height",function(){return this.autoSize?this.texture?this.texture.height:this._graphics||0!==this._children.length?this.getSelfBounds().height:0:this._height||(this.texture?this.texture.height:0)},function(t){this._height!==t&&(this._height=t,this._setHeight(this.texture,t),this._setTranformChange())}),s(0,e,"blendMode",function(){return this._style.blendMode},function(t){this._setBlendMode(t),this.getStyle().blendMode=t,t&&"source-over"!=t?this._renderType|=4:this._renderType&=-5,this._setRenderType(this._renderType),this.parentRepaint()}),s(0,e,"scaleX",function(){return this._style.scaleX},function(t){this.getStyle().scaleX!==t&&(this._setScaleX(t),this._setTranformChange())}),s(0,e,"scaleY",function(){return this._style.scaleY},function(t){this.getStyle().scaleY!==t&&(this._setScaleY(t),this._setTranformChange())}),s(0,e,"stage",function(){return i.stage}),s(0,e,"skewX",function(){return this._style.skewX},function(t){this.getStyle().skewX!==t&&(this._setSkewX(t),this._setTranformChange())}),s(0,e,"scrollRect",function(){return this._style.scrollRect},function(t){this.getStyle().scrollRect=t,this._setScrollRect(t),this.repaint(),t?this._renderType|=64:this._renderType&=-65,this._setRenderType(this._renderType)}),s(0,e,"skewY",function(){return this._style.skewY},function(t){this.getStyle().skewY!==t&&(this._setSkewY(t),this._setTranformChange())}),s(0,e,"transform",function(){return this._tfChanged?this._adjustTransform():this._transform},function(t){this._tfChanged=!1;var e=this._transform||(this._transform=this._createTransform());t.copyTo(e),this._setTransform(e),t&&(this._x=e.tx,this._y=e.ty,e.tx=e.ty=0),t?this._renderType|=2:this._renderType&=-3,this._setRenderType(this._renderType),this.parentRepaint()}),s(0,e,"pivotX",function(){return this._getPivotX()},function(t){this._setPivotX(t),this.repaint()}),s(0,e,"pivotY",function(){return this._getPivotY()},function(t){this._setPivotY(t),this.repaint()}),s(0,e,"alpha",function(){return this._getAlpha()},function(t){t=t<0?0:t>1?1:t,this._setAlpha(t)}),s(0,e,"visible",function(){return this._visible},function(t){this._visible!==t&&(this._visible=t,this.parentRepaint(3))}),s(0,e,"graphics",function(){return this._graphics||(this.graphics=new k,this._graphics.autoDestroy=!0),this._graphics},function(t){this._graphics&&(this._graphics._sp=null),this._graphics=t,t?(this._setGraphics(t),this._renderType|=512,t._sp=this):this._renderType&=-513,this._setRenderType(this._renderType),this.repaint()}),s(0,e,"filters",function(){return this._cacheStyle.filters},function(t){t&&0===t.length&&(t=null),this._cacheStyle.filters!=t&&(this._getCacheStyle().filters=t?t.slice():null,t&&t.length?(this._setColorFilter(t[0]),this._renderType|=16):(this._setColorFilter(null),this._renderType&=-17),this._setRenderType(this._renderType),t&&t.length>0?(this._getBit(16)||this._setBitUp(16),1==t.length&&t[0]instanceof laya.filters.ColorFilter||(this._getCacheStyle().cacheForFilters=!0,this._checkCanvasEnable())):this._cacheStyle.cacheForFilters&&(this._cacheStyle.cacheForFilters=!1,this._checkCanvasEnable()),this._getCacheStyle().hasGlowFilter=this._isHaveGlowFilter(),this.repaint())}),s(0,e,"mask",function(){return this._cacheStyle.mask},function(t){t&&this.mask&&this.mask._cacheStyle.maskParent||(this._getCacheStyle().mask=t,this._setMask(t),this._checkCanvasEnable(),t?t._getCacheStyle().maskParent=this:this.mask&&(this.mask._getCacheStyle().maskParent=null),this._renderType|=32,this._setRenderType(this._renderType),this.parentRepaint(3))}),s(0,e,"mouseEnabled",function(){return this._mouseState>1},function(t){this._mouseState=t?2:1}),s(0,e,"globalScaleX",function(){for(var t=1,e=this;e&&e!==i.stage;)t*=e.scaleX,e=e.parent;return t}),s(0,e,"mouseX",function(){return this.getMousePoint().x}),s(0,e,"mouseY",function(){return this.getMousePoint().y}),s(0,e,"viewport",function(){return this._style.viewport},function(t){var e;"string"==typeof t&&((e=t.split(",")).length>3&&(t=new mt(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]))));this.getStyle().viewport=t}),Sprite.fromImage=function(t){return(new Sprite).loadImage(t)},Sprite}(we),Qe=function(t){function WebAudioSoundChannel(){this.audioBuffer=null,this.gain=null,this.bufferSource=null,this._currentTime=0,this._volume=1,this._startTime=0,this._pauseTime=0,this._onPlayEnd=null,this.context=Ge.ctx,WebAudioSoundChannel.__super.call(this),this._onPlayEnd=St.bind(this.__onPlayEnd,this),this.context.createGain?this.gain=this.context.createGain():this.gain=this.context.createGainNode()}r(WebAudioSoundChannel,"laya.media.webaudio.WebAudioSoundChannel",t);var e=WebAudioSoundChannel.prototype;return e.play=function(){if(rt.addChannel(this),this.isStopped=!1,this._clearBufferSource(),this.audioBuffer){if(this.startTime>=this.duration)return this.stop();var t=this.context,e=this.gain,i=t.createBufferSource();this.bufferSource=i,i.buffer=this.audioBuffer,i.connect(e),e&&e.disconnect(),e.connect(t.destination),i.onended=this._onPlayEnd,this._startTime=Y.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(rt.playbackRate,this.context.currentTime,.001):i.playbackRate.value=rt.playbackRate,i.start(0,this.startTime),this._currentTime=0}},e.__onPlayEnd=function(){if(1==this.loops)return this.completeHandler&&(i.timer.once(10,this,this.__runComplete,[this.completeHandler],!1),this.completeHandler=null),this.stop(),void this.event("complete");this.loops>0&&this.loops--,this.startTime=0,this.play()},e._clearBufferSource=function(){if(this.bufferSource){var t=this.bufferSource;t.stop?t.stop(0):t.noteOff(0),t.disconnect(0),t.onended=null,WebAudioSoundChannel._tryCleanFailed||this._tryClearBuffer(t),this.bufferSource=null}},e._tryClearBuffer=function(t){if(Y.onMac)try{t.buffer=Ge._miniBuffer}catch(t){WebAudioSoundChannel._tryCleanFailed=!0}else try{t.buffer=null}catch(t){WebAudioSoundChannel._tryCleanFailed=!0}},e.stop=function(){t.prototype.stop.call(this),this._clearBufferSource(),this.audioBuffer=null,this.gain&&this.gain.disconnect(),this.isStopped=!0,rt.removeChannel(this),this.completeHandler=null,rt.autoReleaseSound&&rt.disposeSoundLater(this.url)},e.pause=function(){this.isStopped||(this._pauseTime=this.position),this._clearBufferSource(),this.gain&&this.gain.disconnect(),this.isStopped=!0,rt.removeChannel(this),rt.autoReleaseSound&&rt.disposeSoundLater(this.url)},e.resume=function(){this.startTime=this._pauseTime,this.play()},s(0,e,"position",function(){return this.bufferSource?(Y.now()-this._startTime)/1e3+this.startTime:0}),s(0,e,"duration",function(){return this.audioBuffer?this.audioBuffer.duration:0}),s(0,e,"volume",function(){return this._volume},function(t){this._volume=t,this.isStopped||(this.gain.gain.setTargetAtTime?this.gain.gain.setTargetAtTime(t,this.context.currentTime,.001):this.gain.gain.value=t)}),WebAudioSoundChannel._tryCleanFailed=!1,WebAudioSoundChannel.SetTargetDelay=.001,WebAudioSoundChannel}(Te),$e=function(t){function BaseShader(){BaseShader.__super.call(this)}return r(BaseShader,"laya.webgl.shader.BaseShader",Me),BaseShader.activeShader=null,BaseShader.bindShader=null,BaseShader}(),qe=function(t){function IndexBuffer2D(t){this._uint16Array=null,void 0===t&&(t=35044),IndexBuffer2D.__super.call(this),this._bufferUsage=t,this._bufferType=34963,this._buffer=new ArrayBuffer(8)}r(IndexBuffer2D,"laya.webgl.utils.IndexBuffer2D",Ae);var e=IndexBuffer2D.prototype;return e._checkArrayUse=function(){this._uint16Array&&(this._uint16Array=new Uint16Array(this._buffer))},e.getUint16Array=function(){return this._uint16Array||(this._uint16Array=new Uint16Array(this._buffer))},e._bindForVAO=function(){X.instance.bindBuffer(34963,this._glBuffer)},e.bind=function(){return b._bindedIndexBuffer!==this._glBuffer&&(X.instance.bindBuffer(34963,this._glBuffer),b._bindedIndexBuffer=this._glBuffer,!0)},e.destory=function(){this._uint16Array=null,this._buffer=null},e.disposeResource=function(){this._disposeResource()},IndexBuffer2D.create=function(t){return void 0===t&&(t=35044),new IndexBuffer2D(t)},IndexBuffer2D}(),Ze=function(t){function VertexBuffer2D(t,e){this._floatArray32=null,this._uint32Array=null,this._vertexStride=0,VertexBuffer2D.__super.call(this),this._vertexStride=t,this._bufferUsage=e,this._bufferType=34962,this._buffer=new ArrayBuffer(8),this._floatArray32=new Float32Array(this._buffer),this._uint32Array=new Uint32Array(this._buffer)}r(VertexBuffer2D,"laya.webgl.utils.VertexBuffer2D",Ae);var e=VertexBuffer2D.prototype;return e.getFloat32Array=function(){return this._floatArray32},e.appendArray=function(t){var e=this._byteLength>>2;this.setByteLength(this._byteLength+4*t.length),this.getFloat32Array().set(t,e),this._upload=!0},e._checkArrayUse=function(){this._floatArray32&&(this._floatArray32=new Float32Array(this._buffer)),this._uint32Array&&(this._uint32Array=new Uint32Array(this._buffer))},e.deleteBuffer=function(){this._disposeResource()},e._bindForVAO=function(){X.instance.bindBuffer(34962,this._glBuffer)},e.bind=function(){return b._bindedVertexBuffer!==this._glBuffer&&(X.instance.bindBuffer(34962,this._glBuffer),b._bindedVertexBuffer=this._glBuffer,!0)},e.destroy=function(){laya.webgl.utils.Buffer.prototype.destroy.call(this),this._byteLength=0,this._upload=!0,this._buffer=null,this._floatArray32=null},s(0,e,"vertexStride",function(){return this._vertexStride}),VertexBuffer2D.create=function(t,e){return void 0===e&&(e=35048),new VertexBuffer2D(t,e)},VertexBuffer2D}(),Je=function(t){function Bitmap(){Bitmap.__super.call(this),this._width=-1,this._height=-1}r(Bitmap,"laya.resource.Bitmap",Me);var e=Bitmap.prototype;return e._getSource=function(){throw"Bitmap: must override it."},s(0,e,"width",function(){return this._width},function(t){this._width=t}),s(0,e,"height",function(){return this._height},function(t){this._height=t}),Bitmap}(),ti=function(t){function TextTexture(t,e){this._source=null,this._texW=0,this._texH=0,this.__destroyed=!1,this._discardTm=0,this.genID=0,this.bitmap={id:0,_glTexture:null},this.curUsedCovRate=0,this.curUsedCovRateAtlas=0,this.lastTouchTm=0,this.ri=null,TextTexture.__super.call(this),this._texW=t||D.atlasWidth,this._texH=e||D.atlasWidth,this.bitmap.id=this.id,this.lock=!0}r(TextTexture,"laya.webgl.text.TextTexture",Me);var e=TextTexture.prototype;return e.recreateResource=function(){if(!this._source){var t=K.isConchApp?X.instance.getDefaultCommandEncoder():j.mainContext,e=this._source=t.createTexture();this.bitmap._glTexture=e,jt.bindTexture(t,3553,e),t.texImage2D(3553,0,6408,this._texW,this._texH,0,6408,5121,null),t.texParameteri(3553,10241,9729),t.texParameteri(3553,10240,9729),t.texParameteri(3553,10242,33071),t.texParameteri(3553,10243,33071),D.debugUV&&this.fillWhite()}},e.addChar=function(t,e,i,n){if(D.isWan1Wan)return this.addCharCanvas(t,e,i,n);!this._source&&this.recreateResource();var r=K.isConchApp?X.instance.getDefaultCommandEncoder():j.mainContext;jt.bindTexture(r,3553,this._source),!K.isConchApp&&r.pixelStorei(37441,!0);var s=t.data;t.data instanceof Uint8ClampedArray&&(s=new Uint8Array(s.buffer)),r.texSubImage2D(3553,0,e,i,t.width,t.height,6408,5121,s),!K.isConchApp&&r.pixelStorei(37441,!1);var a=NaN,o=NaN,h=NaN,u=NaN;return K.isConchApp?(a=e/this._texW,o=i/this._texH,h=(e+t.width)/this._texW,u=(i+t.height)/this._texH):(a=(e+1)/this._texW,o=i/this._texH,h=(e+t.width-1)/this._texW,u=(i+t.height-1)/this._texH),(n=n||new Array(8))[0]=a,n[1]=o,n[2]=h,n[3]=o,n[4]=h,n[5]=u,n[6]=a,n[7]=u,n},e.addCharCanvas=function(t,e,i,n){!this._source&&this.recreateResource();var r=K.isConchApp?X.instance.getDefaultCommandEncoder():j.mainContext;jt.bindTexture(r,3553,this._source),!K.isConchApp&&r.pixelStorei(37441,!0),r.texSubImage2D(3553,0,e,i,6408,5121,t),!K.isConchApp&&r.pixelStorei(37441,!1);var s=NaN,a=NaN,o=NaN,h=NaN;return K.isConchApp?(s=e/this._texW,a=i/this._texH,o=(e+t.width)/this._texW,h=(i+t.height)/this._texH):(s=(e+1)/this._texW,a=(i+1)/this._texH,o=(e+t.width-1)/this._texW,h=(i+t.height-1)/this._texH),(n=n||new Array(8))[0]=s,n[1]=a,n[2]=o,n[3]=a,n[4]=o,n[5]=h,n[6]=s,n[7]=h,n},e.fillWhite=function(){!this._source&&this.recreateResource();var t=K.isConchApp?X.instance.getDefaultCommandEncoder():j.mainContext,e=new Uint8Array(this._texW*this._texH*4);e.fill(255),t.texSubImage2D(3553,0,0,0,this._texW,this._texH,6408,5121,e)},e.discard=function(){this._texW==D.atlasWidth&&this._texH==D.atlasWidth?(this.genID++,TextTexture.poolLen>=TextTexture.pool.length&&(TextTexture.pool=TextTexture.pool.concat(new Array(10))),this._discardTm=i.stage.getFrameTm(),TextTexture.pool[TextTexture.poolLen++]=this):this.destroy()},e.destroy=function(){this.__destroyed=!0;var t=K.isConchApp?X.instance.getDefaultCommandEncoder():j.mainContext;this._source&&t.deleteTexture(this._source),this._source=null},e.touchRect=function(t,e){this.lastTouchTm!=e&&(this.curUsedCovRate=0,this.curUsedCovRateAtlas=0,this.lastTouchTm=e);var i=D.atlasWidth*D.atlasWidth,n=dt.atlasGridW*dt.atlasGridW;this.curUsedCovRate+=t.bmpWidth*t.bmpHeight/i,this.curUsedCovRateAtlas+=Math.ceil(t.bmpWidth/dt.atlasGridW)*Math.ceil(t.bmpHeight/dt.atlasGridW)/(i/n)},e._getSource=function(){return this._source},e.drawOnScreen=function(t,e){},s(0,e,"texture",function(){return this}),TextTexture.getTextTexture=function(t,e){if(t!=D.atlasWidth||t!=D.atlasWidth)return new TextTexture(t,e);if(TextTexture.poolLen>0){var i=TextTexture.pool[--TextTexture.poolLen];return TextTexture.poolLen>0&&TextTexture.clean(),i}return new TextTexture(t,e)},TextTexture.clean=function(){var t=i.stage.getFrameTm();if(0===TextTexture.cleanTm&&(TextTexture.cleanTm=t),t-TextTexture.cleanTm>=D.checkCleanTextureDt){for(var e=0;e=D.destroyUnusedTextureDt&&(n.destroy(),TextTexture.pool[e]=TextTexture.pool[TextTexture.poolLen-1],TextTexture.poolLen--,e--)}TextTexture.cleanTm=t}},TextTexture.poolLen=0,TextTexture.cleanTm=0,n(TextTexture,["pool",function(){return this.pool=new Array(10)}]),TextTexture}(),ei=function(t){function AnimationBase(){this.loop=!1,this.wrapMode=0,this._index=0,this._count=0,this._isPlaying=!1,this._labels=null,this._isReverse=!1,this._frameRateChanged=!1,this._actionName=null,this._controlNode=null,AnimationBase.__super.call(this),this._interval=Rt.animationInterval,this._setBitUp(16)}r(AnimationBase,"laya.display.AnimationBase",t);var e=AnimationBase.prototype;return e.play=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=!0),void 0===i&&(i=""),this._isPlaying=!0,this._actionName=i,this.index="string"==typeof t?this._getFrameByLabel(t):t,this.loop=e,this._isReverse=1===this.wrapMode,0==this.index&&this._isReverse&&(this.index=this.count-1),this.interval>0&&this.timerLoop(this.interval,this,this._frameLoop,null,!0,!0)},e._getFrameByLabel=function(t){for(var e=0;e-1)return e}return 0},e._frameLoop=function(){if(this._isReverse){if(this._index--,this._index<0){if(!this.loop)return this._index=0,this.stop(),void this.event("complete");2==this.wrapMode?(this._index=this._count>0?1:0,this._isReverse=!1):this._index=this._count-1,this.event("complete")}}else if(this._index++,this._index>=this._count){if(!this.loop)return this._index--,this.stop(),void this.event("complete");2==this.wrapMode?(this._index=this._count-2>=0?this._count-2:0,this._isReverse=!0):this._index=0,this.event("complete")}this.index=this._index},e._setControlNode=function(t){this._controlNode&&(this._controlNode.off("display",this,this._resumePlay),this._controlNode.off("undisplay",this,this._resumePlay)),this._controlNode=t,t&&t!=this&&(t.on("display",this,this._resumePlay),t.on("undisplay",this,this._resumePlay))},e._setDisplay=function(e){t.prototype._setDisplay.call(this,e),this._resumePlay()},e._resumePlay=function(){this._isPlaying&&(this._controlNode.displayedInStage?this.play(this._index,this.loop,this._actionName):this.clearTimer(this,this._frameLoop))},e.stop=function(){this._isPlaying=!1,this.clearTimer(this,this._frameLoop)},e.addLabel=function(t,e){this._labels||(this._labels={}),this._labels[e]||(this._labels[e]=[]),this._labels[e].push(t)},e.removeLabel=function(t){if(t){if(this._labels)for(var e in this._labels)this._removeLabelFromList(this._labels[e],t)}else this._labels=null},e._removeLabelFromList=function(t,e){if(t)for(var i=t.length-1;i>=0;i--)t[i]==e&&t.splice(i,1)},e.gotoAndStop=function(t){this.index="string"==typeof t?this._getFrameByLabel(t):t,this.stop()},e._displayToIndex=function(t){},e.clear=function(){return this.stop(),this._labels=null,this},s(0,e,"interval",function(){return this._interval},function(t){this._interval!=t&&(this._frameRateChanged=!0,this._interval=t,this._isPlaying&&t>0&&this.timerLoop(t,this,this._frameLoop,null,!0,!0))}),s(0,e,"isPlaying",function(){return this._isPlaying}),s(0,e,"index",function(){return this._index},function(t){if(this._index=t,this._displayToIndex(t),this._labels&&this._labels[t])for(var e=this._labels[t],i=0,n=e.length;i0&&(i.name=i.name.substr(0,i.name.length-3),i.isArray=!0,i.location=e.getUniformLocation(this._program,i.name)),this._params.push(i)}for(r=0,n=this._params.length;r=0;a-=2)(r=this._paramsMap[t[a]])&&null!=(n=t[a+1])&&(i&&i[r.name]&&i[r.name].bind(),s+=r.fun.call(this,r,n));kt.shaderCall+=s},e.getParams=function(){return this._params},e.setAttributesLocation=function(t){this._attribInfo=t},Shader.getShader=function(t){return Shader.sharders[t]},Shader.create=function(t,e,i,n,r){return new Shader(t,e,i,n,r)},Shader.withCompile=function(t,e,i,n){if(i&&Shader.sharders[i])return Shader.sharders[i];var r=Shader._preCompileShader[2e-4*t];if(!r)throw new Error("withCompile shader err!"+t);return r.createShader(e,i,n,null)},Shader.withCompile2D=function(t,e,i,n,r,s){if(n&&Shader.sharders[n])return Shader.sharders[n];var a=Shader._preCompileShader[2e-4*t+e];if(!a)throw new Error("withCompile shader err!"+t+" "+e);return a.createShader(i,n,r,s)},Shader.addInclude=function(t,e){Jt.addInclude(t,e)},Shader.preCompile=function(t,e,i,n){var r=2e-4*t;Shader._preCompileShader[r]=new Jt(e,i,n)},Shader.preCompile2D=function(t,e,i,n,r){var s=2e-4*t+e;Shader._preCompileShader[s]=new Jt(i,n,r)},Shader._createShader=function(t,e,i){var n=t.createShader(i);return t.shaderSource(n,e),t.compileShader(n),t.getShaderParameter(n,35713)?n:(console.log(t.getShaderInfoLog(n)),null)},Shader._count=0,Shader._preCompileShader={},Shader.SHADERNAME2ID=2e-4,Shader.sharders=new Array(32),n(Shader,["nameKey",function(){return this.nameKey=new Ot}]),Shader}(),ni=(function(t){function SoundNode(){this.url=null,this._channel=null,this._tar=null,this._playEvents=null,this._stopEvents=null,SoundNode.__super.call(this),this.visible=!1,this.on("added",this,this._onParentChange),this.on("removed",this,this._onParentChange)}r(SoundNode,"laya.media.SoundNode",je);var e=SoundNode.prototype;e._onParentChange=function(){this.target=this.parent},e.play=function(t,e){void 0===t&&(t=1),isNaN(t)&&(t=1),this.url&&(this.stop(),this._channel=rt.playSound(this.url,t,e))},e.stop=function(){this._channel&&!this._channel.isStopped&&this._channel.stop(),this._channel=null},e._setPlayAction=function(t,e,i,n){void 0===n&&(n=!0),this[i]&&t&&(n?t.on(e,this,this[i]):t.off(e,this,this[i]))},e._setPlayActions=function(t,e,i,n){if(void 0===n&&(n=!0),t&&e){var r,s=e.split(","),a=0;for(r=s.length,a=0;a0?1:-1:t},a.getMousePoint=function(){return ct.TEMP.setTo(this.mouseX,this.mouseY)},a.repaint=function(t){void 0===t&&(t=2),this._repaint|=t},a.parentRepaint=function(t){void 0===t&&(t=2)},a._loop=function(){return this._globalRepaintGet=this._globalRepaintSet,this._globalRepaintSet=!1,this.render(K._context,0,0),!0},a.getFrameTm=function(){return this._frameStartTime},a._onmouseMove=function(t){this._mouseMoveTime=Y.now()},a.getTimeFromFrameStart=function(){return Y.now()-this._frameStartTime},a.render=function(t,i,n){if(Stage._dbgSprite.graphics.clear(),"sleep"===this._frameRate){var r=Y.now();if(!(r-this._frameStartTime>=1e3))return;this._frameStartTime=r}else{if(!this._visible)return this._renderCount++,void(this._renderCount%5==0&&(zt.I._update(),kt.loopCount++,this._updateTimers()));this._frameStartTime=Y.now()}this._renderCount++;var s="slow"!==("mouse"===this._frameRate?this._frameStartTime-this._mouseMoveTime<2e3?"fast":"slow":this._frameRate),a=this._renderCount%2==0;if(kt.renderSlow=!s,(s||a)&&(zt.I._update(),kt.loopCount++,this.renderingEnabled)){for(var o=0,h=this._scene3Ds.length;o=0||this._3dUI.push(e)},a.remove3DUI=function(t){var e=t.rootView,i=this._3dUI.indexOf(e);return i>=0&&(this._3dUI.splice(i,1),!0)},s(0,a,"clientScaleY",function(){return this._transform?this._transform.getScaleY():1}),s(0,a,"width",e.prototype._$get_width,function(t){this.designWidth=t,i.superSet(je,this,"width",t),i.systemTimer.callLater(this,this._changeCanvasSize)}),s(0,a,"isFocused",function(){return this._isFocused}),s(0,a,"alignH",function(){return this._alignH},function(t){this._alignH=t,i.systemTimer.callLater(this,this._changeCanvasSize)}),s(0,a,"height",e.prototype._$get_height,function(t){this.designHeight=t,i.superSet(je,this,"height",t),i.systemTimer.callLater(this,this._changeCanvasSize)}),s(0,a,"transform",function(){return this._tfChanged&&this._adjustTransform(),this._transform=this._transform||this._createTransform()},e.prototype._$set_transform),s(0,a,"isVisibility",function(){return this._isVisibility}),s(0,a,"scaleMode",function(){return this._scaleMode},function(t){this._scaleMode=t,i.systemTimer.callLater(this,this._changeCanvasSize)}),s(0,a,"alignV",function(){return this._alignV},function(t){this._alignV=t,i.systemTimer.callLater(this,this._changeCanvasSize)}),s(0,a,"bgColor",function(){return this._bgColor},function(t){this._bgColor=t,this._wgColor=t?o.create(t).arrColor:null,Y.onLimixiu?this._wgColor=o.create(t).arrColor:K.canvas.style.background=t||"none"}),s(0,a,"mouseX",function(){return Math.round(Et.instance.mouseX/this.clientScaleX)}),s(0,a,"mouseY",function(){return Math.round(Et.instance.mouseY/this.clientScaleY)}),s(0,a,"clientScaleX",function(){return this._transform?this._transform.getScaleX():1}),s(0,a,"screenMode",function(){return this._screenMode},function(t){this._screenMode=t}),s(0,a,"visible",e.prototype._$get_visible,function(t){this.visible!==t&&(i.superSet(je,this,"visible",t),K._mainCanvas.source.style.visibility=t?"visible":"hidden")}),s(0,a,"fullScreenEnabled",null,function(t){var e=Y.document,i=K.canvas;t?(i.addEventListener("mousedown",this._requestFullscreen),i.addEventListener("touchstart",this._requestFullscreen),e.addEventListener("fullscreenchange",this._fullScreenChanged),e.addEventListener("mozfullscreenchange",this._fullScreenChanged),e.addEventListener("webkitfullscreenchange",this._fullScreenChanged),e.addEventListener("msfullscreenchange",this._fullScreenChanged)):(i.removeEventListener("mousedown",this._requestFullscreen),i.removeEventListener("touchstart",this._requestFullscreen),e.removeEventListener("fullscreenchange",this._fullScreenChanged),e.removeEventListener("mozfullscreenchange",this._fullScreenChanged),e.removeEventListener("webkitfullscreenchange",this._fullScreenChanged),e.removeEventListener("msfullscreenchange",this._fullScreenChanged))}),s(0,a,"frameRate",function(){return K.isConchApp?this._frameRateNative:this._frameRate},function(e){if(K.isConchApp){switch(e){case"fast":t.conch.config.setLimitFPS(60);break;case"mouse":t.conch.config.setMouseFrame(2e3);break;case"slow":t.conch.config.setSlowFrame(!0);break;case"sleep":t.conch.config.setLimitFPS(1)}this._frameRateNative=e}else this._frameRate=e}),Stage.SCALE_NOSCALE="noscale",Stage.SCALE_EXACTFIT="exactfit",Stage.SCALE_SHOWALL="showall",Stage.SCALE_NOBORDER="noborder",Stage.SCALE_FULL="full",Stage.SCALE_FIXED_WIDTH="fixedwidth",Stage.SCALE_FIXED_HEIGHT="fixedheight",Stage.SCALE_FIXED_AUTO="fixedauto",Stage.ALIGN_LEFT="left",Stage.ALIGN_RIGHT="right",Stage.ALIGN_CENTER="center",Stage.ALIGN_TOP="top",Stage.ALIGN_MIDDLE="middle",Stage.ALIGN_BOTTOM="bottom",Stage.SCREEN_NONE="none",Stage.SCREEN_HORIZONTAL="horizontal",Stage.SCREEN_VERTICAL="vertical",Stage.FRAME_FAST="fast",Stage.FRAME_SLOW="slow",Stage.FRAME_MOUSE="mouse",Stage.FRAME_SLEEP="sleep",n(Stage,["_dbgSprite",function(){return this._dbgSprite=new je}]),Stage}(je)),ri=function(t){function BaseTexture(t,e){BaseTexture.__super.call(this),this._wrapModeU=0,this._wrapModeV=0,this._filterMode=1,this._readyed=!1,this._width=-1,this._height=-1,this._format=t,this._mipmap=e,this._anisoLevel=1,this._glTexture=X.instance.createTexture()}r(BaseTexture,"laya.resource.BaseTexture",Je);var e=BaseTexture.prototype;return e._isPot=function(t){return 0==(t&t-1)},e._getGLFormat=function(){var t=0;switch(this._format){case 0:t=6407;break;case 1:t=6408;break;case 2:t=6406;break;case 3:if(!jt._compressedTextureS3tc)throw"BaseTexture: not support DXT1 format.";t=jt._compressedTextureS3tc.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case 4:if(!jt._compressedTextureS3tc)throw"BaseTexture: not support DXT5 format.";t=jt._compressedTextureS3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;case 5:if(!jt._compressedTextureEtc1)throw"BaseTexture: not support ETC1RGB format.";t=jt._compressedTextureEtc1.COMPRESSED_RGB_ETC1_WEBGL;break;case 9:if(!jt._compressedTexturePvrtc)throw"BaseTexture: not support PVRTCRGB_2BPPV format.";t=jt._compressedTexturePvrtc.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;break;case 10:if(!jt._compressedTexturePvrtc)throw"BaseTexture: not support PVRTCRGBA_2BPPV format.";t=jt._compressedTexturePvrtc.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;break;case 11:if(!jt._compressedTexturePvrtc)throw"BaseTexture: not support PVRTCRGB_4BPPV format.";t=jt._compressedTexturePvrtc.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;break;case 12:if(!jt._compressedTexturePvrtc)throw"BaseTexture: not support PVRTCRGBA_4BPPV format.";t=jt._compressedTexturePvrtc.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;break;default:throw"BaseTexture: unknown texture format."}return t},e._setFilterMode=function(t){var e=X.instance;switch(jt.bindTexture(e,this._glTextureType,this._glTexture),t){case 0:this._mipmap?e.texParameteri(this._glTextureType,10241,9984):e.texParameteri(this._glTextureType,10241,9728),e.texParameteri(this._glTextureType,10240,9728);break;case 1:this._mipmap?e.texParameteri(this._glTextureType,10241,9985):e.texParameteri(this._glTextureType,10241,9729),e.texParameteri(this._glTextureType,10240,9729);break;case 2:this._mipmap?e.texParameteri(this._glTextureType,10241,9987):e.texParameteri(this._glTextureType,10241,9729),e.texParameteri(this._glTextureType,10240,9729);break;default:throw new Error("BaseTexture:unknown filterMode value.")}},e._setWarpMode=function(t,e){var i=X.instance;if(jt.bindTexture(i,this._glTextureType,this._glTexture),this._isPot(this._width)&&this._isPot(this._height))switch(e){case 0:i.texParameteri(this._glTextureType,t,10497);break;case 1:i.texParameteri(this._glTextureType,t,33071)}else i.texParameteri(this._glTextureType,t,33071)},e._setAnisotropy=function(t){var e=jt._extTextureFilterAnisotropic;if(e&&!Y.onLimixiu){t=Math.max(t,1);var i=X.instance;jt.bindTexture(i,this._glTextureType,this._glTexture),t=Math.min(i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT),t),i.texParameterf(this._glTextureType,e.TEXTURE_MAX_ANISOTROPY_EXT,t)}},e._disposeResource=function(){this._glTexture&&(X.instance.deleteTexture(this._glTexture),this._glTexture=null,this._setGPUMemory(0))},e._getSource=function(){return this._readyed?this._glTexture:null},e.generateMipmap=function(){this._isPot(this.width)&&this._isPot(this.height)&&X.instance.generateMipmap(this._glTextureType)},s(0,e,"wrapModeU",function(){return this._wrapModeU},function(t){this._wrapModeU!==t&&(this._wrapModeU=t,-1!==this._width&&this._setWarpMode(10242,t))}),s(0,e,"mipmap",function(){return this._mipmap}),s(0,e,"format",function(){return this._format}),s(0,e,"wrapModeV",function(){return this._wrapModeV},function(t){this._wrapModeV!==t&&(this._wrapModeV=t,-1!==this._height&&this._setWarpMode(10243,t))}),s(0,e,"defaulteTexture",function(){throw"BaseTexture:must override it."}),s(0,e,"filterMode",function(){return this._filterMode},function(t){t!==this._filterMode&&(this._filterMode=t,-1!==this._width&&-1!==this._height&&this._setFilterMode(t))}),s(0,e,"anisoLevel",function(){return this._anisoLevel},function(t){t!==this._anisoLevel&&(this._anisoLevel=Math.max(1,Math.min(16,t)),-1!==this._width&&-1!==this._height&&this._setAnisotropy(t))}),BaseTexture.WARPMODE_REPEAT=0,BaseTexture.WARPMODE_CLAMP=1,BaseTexture.FILTERMODE_POINT=0,BaseTexture.FILTERMODE_BILINEAR=1,BaseTexture.FILTERMODE_TRILINEAR=2,BaseTexture.FORMAT_R8G8B8=0,BaseTexture.FORMAT_R8G8B8A8=1,BaseTexture.FORMAT_ALPHA8=2,BaseTexture.FORMAT_DXT1=3,BaseTexture.FORMAT_DXT5=4,BaseTexture.FORMAT_ETC1RGB=5,BaseTexture.FORMAT_PVRTCRGB_2BPPV=9,BaseTexture.FORMAT_PVRTCRGBA_2BPPV=10,BaseTexture.FORMAT_PVRTCRGB_4BPPV=11,BaseTexture.FORMAT_PVRTCRGBA_4BPPV=12,BaseTexture.FORMAT_DEPTH_16=0,BaseTexture.FORMAT_STENCIL_8=1,BaseTexture.FORMAT_DEPTHSTENCIL_16_8=2,BaseTexture.FORMAT_DEPTHSTENCIL_NONE=3,BaseTexture}(),si=function(t){function PerfHUD(){this.datas=[],this.hud_width=800,this.hud_height=200,this.gMinV=0,this.gMaxV=100,this.textSpace=40,this._now=null,this.sttm=0,PerfHUD.__super.call(this),this.xdata=new Array(PerfHUD.DATANUM),this.ydata=new Array(PerfHUD.DATANUM),PerfHUD.inst=this,this._renderType|=2048,this._setRenderType(this._renderType),this._setCustomRender(),this.addDataDef(0,16777215,"frame",1),this.addDataDef(1,65280,"update",1),this.addDataDef(2,16711680,"flush",1),this._now=performance?performance.now.bind(performance):Date.now}r(PerfHUD,"laya.utils.PerfHUD",je);var e=PerfHUD.prototype;return e.now=function(){return this._now()},e.start=function(){this.sttm=this._now()},e.end=function(t){var e=this._now()-this.sttm;this.updateValue(t,e)},e.config=function(t,e){this.hud_width=t,this.hud_height=e},e.addDataDef=function(t,e,i,n){this.datas[t]=new I(t,e,i,n)},e.updateValue=function(t,e){this.datas[t].addData(e)},e.v2y=function(t){this._y,this.hud_height,this.gMinV,this.gMaxV;return this._y+this.hud_height*(1-(t-this.gMinV)/this.gMaxV)},e.drawHLine=function(t,e,i,n){var r=this._x,s=(this._x,this.hud_width,this.v2y(e));t.fillText(n,r,s-6,null,"green",null),r+=this.textSpace,t.fillStyle=i,t.fillRect(r,s,this._x+this.hud_width,1,null)},e.customRender=function(t,e,i){var n=performance.now();PerfHUD._lastTm<=0&&(PerfHUD._lastTm=n),this.updateValue(0,n-PerfHUD._lastTm),PerfHUD._lastTm=n,t.save(),t.fillRect(this._x,this._y,this.hud_width,this.hud_height+4,"#000000cc"),t.globalAlpha=.9,this.drawHLine(t,0,"green"," 0"),this.drawHLine(t,10,"green"," 10"),this.drawHLine(t,16.667,"red"," "),this.drawHLine(t,20,"green","50|20"),this.drawHLine(t,33.334,"yellow",""),this.drawHLine(t,16.667*3,"yellow",""),this.drawHLine(t,66.668,"yellow",""),this.drawHLine(t,50,"green","20|50"),this.drawHLine(t,100,"green","10|100");for(var r=0,s=this.datas.length;r-1?t:t+".scene",n=i.loader.getRes(e);if(n)this.createView(n);else{i.loader.resetProgress();var r=new Ue;r.on("complete",this,this._onSceneLoaded,[e]),r.load(e)}},e._onSceneLoaded=function(t){this.createView(Ce.getRes(t))},e.createView=function(t){t&&!this._viewCreated&&(this._viewCreated=!0,xe.createByData(this,t))},e.getNodeByID=function(t){return this._idMap?this._idMap[t]:null},e.open=function(t,e){void 0===t&&(t=!0),t&&Scene.closeAll(),Scene.root.addChild(this),this.onOpened(e)},e.onOpened=function(t){},e.close=function(t){this.onClosed(t),this.autoDestroyAtClosed?this.destroy():this.removeSelf()},e.onClosed=function(t){},e.destroy=function(e){void 0===e&&(e=!0),this._idMap=null,t.prototype.destroy.call(this,e);for(var i=laya.display.Scene.unDestroyedScenes,n=i.length-1;n>-1;n--)if(i[n]===this)return void i.splice(n,1)},e._sizeChanged=function(){this.event("resize")},s(0,e,"scaleX",t.prototype._$get_scaleX,function(t){i.superGet(je,this,"scaleX")!=t&&(i.superSet(je,this,"scaleX",t),this.event("resize"))}),s(0,e,"scaleY",t.prototype._$get_scaleY,function(t){i.superGet(je,this,"scaleY")!=t&&(i.superSet(je,this,"scaleY",t),this.event("resize"))}),s(0,e,"width",function(){if(this._width)return this._width;for(var t=0,e=this.numChildren-1;e>-1;e--){var i=this.getChildAt(e);i._visible&&(t=Math.max(i._x+i.width*i.scaleX,t))}return t},function(t){i.superGet(je,this,"width")!=t&&(i.superSet(je,this,"width",t),this.callLater(this._sizeChanged))}),s(0,e,"timer",function(){return this._timer||i.timer},function(t){this._timer=t}),s(0,e,"height",function(){if(this._height)return this._height;for(var t=0,e=this.numChildren-1;e>-1;e--){var i=this.getChildAt(e);i._visible&&(t=Math.max(i._y+i.height*i.scaleY,t))}return t},function(t){i.superGet(je,this,"height")!=t&&(i.superSet(je,this,"height",t),this.callLater(this._sizeChanged))}),s(1,Scene,"root",function(){if(!Scene._root){function resize(){Scene._root.size(i.stage.width,i.stage.height),Scene._root.event("resize")}Scene._root=i.stage.addChild(new je),Scene._root.name="root",i.stage.on("resize",null,resize),resize()}return Scene._root},laya.display.Sprite._$SET_root),Scene.load=function(t,e,n){i.loader.resetProgress();var r=new Ue;function onProgress(t){Scene._loadPage&&Scene._loadPage.event("progress",t),n&&n.runWith(t)}r.on("progress",null,onProgress),r.once("complete",null,function(){r.off("progress",null,onProgress);var i=Ce.getRes(t);if(!i)throw"Can not find scene:"+t;if(!i.props)throw"Scene data is error:"+t;var n=i.props.runtime?i.props.runtime:i.type,s=S.getClass(n);if("instance"==i.props.renderType)var a=s.instance||(s.instance=new s);else a=new s;if(!(a&&a instanceof laya.display.Node))throw"Can not find scene:"+n;a.url=t,a._getBit(8)?(a.on("onViewCreated",null,function(){e&&e.runWith(a)}),a.createView(i)):e&&e.runWith(a),Scene.hideLoadingPage()}),r.load(t)},Scene.open=function(t,e,i,n,r){if(void 0===e&&(e=!0),i instanceof laya.utils.Handler){var s=n;n=i,i=s}Scene.showLoadingPage(),Scene.load(t,p.create(null,this._onSceneLoaded,[e,n,i]),r)},Scene._onSceneLoaded=function(t,e,i,n){n.open(t,i),e&&e.runWith(n)},Scene.close=function(t,e){void 0===e&&(e="");for(var i=!1,n=laya.display.Scene.unDestroyedScenes,r=0,s=n.length;r0;i--)e+="●";return e},a._renderText=function(){var t=this.padding,e=this._lines.length;"visible"!=this.overflow&&(e=Math.min(e,Math.floor((this.height-t[0]-t[2])/(this.leading+this._charSize.height))+1));var i=this.scrollY/(this._charSize.height+this.leading)|0,n=this.graphics;n.clear(!0);var r=this._getContextFont();Y.context.font=r;var s=t[3],a="left",o=this._lines,h=this.leading+this._charSize.height,u=this._style.currBitmapFont;u&&(h=this.leading+u.getMaxHeight());var l=t[0];if(!u&&this._width>0&&this._textWidth<=this._width&&("right"==this.align?(a="right",s=this._width-t[1]):"center"==this.align&&(a="center",s=.5*this._width+t[3]-t[1])),this._height>0){var c=this._textHeight>this._height?"top":this.valign;"middle"===c?l=.5*(this._height-e*h)+t[0]-t[2]:"bottom"===c&&(l=this._height-e*h-t[2])}var _=this._style;if(u&&u.autoScaleSize)var d=u.fontSize/this.fontSize;if(this._clipPoint){if(n.save(),u&&u.autoScaleSize){var f=0,p=0;f=this._width?this._width-t[3]-t[1]:this._textWidth,p=this._height?this._height-t[0]-t[2]:this._textHeight,f*=d,p*=d,n.clipRect(t[3],t[0],f,p)}else n.clipRect(t[3],t[0],this._width?this._width-t[3]-t[1]:this._textWidth,this._height?this._height-t[0]-t[2]:this._textHeight);this.repaint()}var m=_.asPassword;"prompt"in this&&this.prompt==this._text&&(m=!1);for(var g=0,v=0,x=Math.min(this._lines.length,e+i)||1,y=i;y0;S--)b+="●"}if(null==b&&(b=""),g=s-(this._clipPoint?this._clipPoint.x:0),v=l+h*y-(this._clipPoint?this._clipPoint.y:0),this.underline&&this._drawUnderline(a,g,v,y),u){var w=this.width;u.autoScaleSize&&(w=this.width*d),u._drawText(b,this,g,v,this.align,w)}else this._words||(this._words=[]),this._words.length>y-i?T=this._words[y-i]:(T=new qt,this._words.push(T)),T.setText(b),T.splitRender=this._singleCharRender,_.stroke?n.fillBorderText(T,g,v,r,this.color,_.strokeColor,_.stroke,a):n.fillText(T,g,v,r,this.color,a)}if(u&&u.autoScaleSize){var M=1/d;this.scale(M,M)}this._clipPoint&&n.restore(),this._startX=s,this._startY=l},a._drawUnderline=function(t,e,i,n){var r=this._lineWidths[n];switch(t){case"center":e-=r/2;break;case"right":e-=r}i+=this._charSize.height,this._graphics.drawLine(e,i,e+r,i,this.underlineColor||this.color,1)},a.typeset=function(){if(this._isChanged=!1,!this._text)return this._clipPoint=null,this._textWidth=this._textHeight=0,void this.graphics.clear(!0);K.isConchApp?t.conchTextCanvas.font=this._getContextFont():Y.context.font=this._getContextFont(),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 ct(0,0)):this._clipPoint=null,this._renderText()},a._evalTextSize=function(){var t,e=NaN;t=Math.max.apply(this,this._lineWidths),e=this._style.currBitmapFont?this._lines.length*(this._style.currBitmapFont.getMaxHeight()+this.leading)+this.padding[0]+this.padding[2]:this._lines.length*(this._charSize.height+this.leading)+this.padding[0]+this.padding[2],t==this._textWidth&&e==this._textHeight||(this._textWidth=t,this._textHeight=e)},a._checkEnabledViewportOrNot=function(){return"scroll"==this.overflow&&(this._width>0&&this._textWidth>this._width||this._height>0&&this._textHeight>this._height)},a.changeText=function(t){this._text!==t&&(this.lang(t+""),this._graphics&&this._graphics.replaceText(this._text)||this.typeset())},a._parseLines=function(e){var i=this.wordWrap||"hidden"==this.overflow;if(i)var n=this._getWordWrapWidth();var r=this._style.currBitmapFont;if(r)this._charSize.width=r.getMaxWidth(),this._charSize.height=r.getMaxHeight();else{var s=null;(s=K.isConchApp?t.conchTextCanvas.measureText(this._testWord):Y.context.measureText(Text._testWord))||(s={width:100}),this._charSize.width=s.width,this._charSize.height=s.height||this.fontSize}for(var a=e.replace(/\r\n/g,"\n").split("\n"),o=0,h=a.length;oe)if(this.wordWrap){var l=t.substring(o,h);if(l.charCodeAt(l.length-1)<255&&(i=/(?:\w|-)+$/.exec(l))&&(h=i.index+o,0==i.index?h+=l.length:l=t.substring(o,h)),n.push(l),this._lineWidths.push(a-s),o=h,!(h+re?e:t,this._clipPoint.x=t,this._renderText()}}),s(0,a,"scrollY",function(){return this._clipPoint?this._clipPoint.y:0},function(t){if(!("scroll"!=this.overflow||this.textHeighte?e:t,this._clipPoint.y=t,this._renderText()}}),s(0,a,"maxScrollX",function(){return this.textWidththis._count&&(t=this._count);var e=this._animationData.nodes,i=0,n=e.length;for(i=0;ie?s[e]:s[s.length-1],n[r]=a;var c,_=t.funkeys;if(0!=(l=_.length))for(u=0;uthis._count&&(this._count=h.index)}}else this._targetDic&&this._targetDic[r]&&(t.initValues[e]=this._targetDic[r][e]),i.sort(FrameAnimation._sortIndexFun),t.keys.push(e),this._calculateNodePropFrames(i,t.frames[e],e,r)}},e.resetNodes=function(){if(this._targetDic&&this._animationData){var t,e,i=this._animationData.nodes,n=0,r=i.length;for(n=0;nthis._count&&(this._count=a),t.tween)for(null==(n=nt[t.tweenMethod])&&(n=nt.linearNone),r=s;r.01&&this._frames&&t.prototype._frameLoop.call(this)},e._displayToIndex=function(t){this._frames&&(this.graphics=this._frames[t])},e.clear=function(){return t.prototype.clear.call(this),this.stop(),this.graphics=null,this._frames=null,this._labels=null,this},e.loadImages=function(t,e){return void 0===e&&(e=""),this._url="",this._setFramesFromCache(e)||(this.frames=Animation.framesMap[e]?Animation.framesMap[e]:Animation.createFrames(t,e)),this},e.loadAtlas=function(t,e,n){void 0===n&&(n=""),this._url="";var r=this;if(!r._setFramesFromCache(n)){function onLoaded(i){t===i&&(r.frames=Animation.framesMap[n]?Animation.framesMap[n]:Animation.createFrames(t,n),e&&e.run())}Ce.getAtlas(t)?onLoaded(t):i.loader.load(t,p.create(null,onLoaded,[t]),null,"atlas")}return this},e.loadAnimation=function(t,e,n){this._url=t;return this._actionName||(this._actionName=""),this._setFramesFromCache(this._actionName)?(this._setFramesFromCache(this._actionName,!0),this.index=0,e&&e.run()):!n||Ce.getAtlas(n)?this._loadAnimationData(t,e,n):i.loader.load(n,p.create(this,this._loadAnimationData,[t,e,n]),null,"atlas"),this},e._loadAnimationData=function(t,e,n){var r=this;if(!n||Ce.getAtlas(n)){var s=this;Ce.getRes(t)?onLoaded(t):i.loader.load(t,p.create(null,onLoaded,[t]),null,"json")}else console.warn("atlas load fail:"+n);function onLoaded(i){if(Ce.getRes(i)){if(t===i){var n;if(Animation.framesMap[t+"#"])s._setFramesFromCache(r._actionName,!0),r.index=0,r._resumePlay();else{var a=fi.parseAnimationData(Ce.getRes(t));if(!a)return;var o,h=a.animationList,u=0,l=h.length;for(u=0;u-1?this.loadAnimation(t):t.indexOf(".json")>-1||t.indexOf("als")>-1||t.indexOf("atlas")>-1?this.loadAtlas(t):this.loadImages(t.split(","))}),s(0,e,"autoAnimation",null,function(t){this.play(0,!0,t)}),Animation.createFrames=function(t,e){var i;if("string"==typeof t){var n=Ce.getAtlas(t);if(n&&n.length){i=[];for(var r=0,s=n.length;r>s,1),Math.max(e>>s,1));this._setGPUMemory(t*e*4*(1+1/3))}else this._mipmapCount=1,this._setGPUMemory(t*e*4)}r(Texture2D,"laya.resource.Texture2D",ri);var e=Texture2D.prototype;return e._getFormatByteCount=function(){switch(this._format){case 0:return 3;case 1:return 4;case 2:return 1;default:throw"Texture2D: unknown format."}},e._setPixels=function(t,e,i,n){var r=X.instance,s=this._glTextureType,a=this._getGLFormat();jt.bindTexture(r,s,this._glTexture),0===this.format?(r.pixelStorei(3317,1),r.texImage2D(s,e,a,i,n,0,a,5121,t),r.pixelStorei(3317,4)):r.texImage2D(s,e,a,i,n,0,a,5121,t)},e._calcualatesCompressedDataSize=function(t,e,i){switch(t){case 3:case 5:return(e+3>>2)*(i+3>>2)*8;case 4:return(e+3>>2)*(i+3>>2)*16;case 11:case 12:return Math.floor((Math.max(e,8)*Math.max(i,8)*4+7)/8);case 9:case 10:return Math.floor((Math.max(e,16)*Math.max(i,8)*2+7)/8);default:return 0}},e._pharseDDS=function(t){var e=new Int32Array(t,0,31);if(542327876!=e[0])throw"Invalid magic number in DDS header";if(!(4&e[20]))throw"Unsupported format, must contain a FourCC code";var i=e[21];switch(this._format){case 3:if(827611204!==i)throw"the FourCC code is not same with texture format.";break;case 4:if(894720068!==i)throw"the FourCC code is not same with texture format.";break;default:throw"unknown texture format."}var n=1;if(131072&e[2]){if(n=Math.max(1,e[7]),!this._mipmap)throw"the mipmap is not same with Texture2D."}else if(this._mipmap)throw"the mipmap is not same with Texture2D.";var r=e[4],s=e[3];this._width=r,this._height=s;var a=e[1]+4;this._upLoadCompressedTexImage2D(t,r,s,n,a,0)},e._pharseKTX=function(t){var e=new Uint8Array(t,0,12);if(171!=e[0]||75!=e[1]||84!=e[2]||88!=e[3]||32!=e[4]||49!=e[5]||49!=e[6]||187!=e[7]||13!=e[8]||10!=e[9]||26!=e[10]||10!=e[11])throw"Invalid fileIdentifier in KTX header";var i=new Int32Array(e.buffer,e.length,13);switch(i[4]){case jt._compressedTextureEtc1.COMPRESSED_RGB_ETC1_WEBGL:this._format=5;break;default:throw"unknown texture format."}var n=i[11],r=i[6],s=i[7];this._width=r,this._height=s;var a=64+i[12];this._upLoadCompressedTexImage2D(t,r,s,n,a,4)},e._pharsePVR=function(t){var e=new Int32Array(t,0,13);if(55727696!=e[0])throw"Invalid magic number in PVR header";switch(e[2]){case 0:this._format=9;break;case 2:this._format=11;break;case 1:this._format=10;break;case 3:this._format=12;break;default:throw"Texture2D:unknown PVR format."}var i=e[11],n=e[7],r=e[6];this._width=n,this._height=r;var s=e[12]+52;this._upLoadCompressedTexImage2D(t,n,r,i,s,0)},e._upLoadCompressedTexImage2D=function(t,e,i,n,r,s){var a=X.instance,o=this._glTextureType;jt.bindTexture(a,o,this._glTexture);for(var h=this._getGLFormat(),u=r,l=0;l>1,1),i=Math.max(i>>1,1),u+=c}var d=u;this._setGPUMemory(d),this._readyed=!0,this._activeResource()},e.loadImageSource=function(t,e){void 0===e&&(e=!1);var i=t.width,n=t.height;this._width=i,this._height=n,this._isPot(i)&&this._isPot(n)||(this._mipmap=!1),this._setWarpMode(10242,this._wrapModeU),this._setWarpMode(10243,this._wrapModeV),this._setFilterMode(this._filterMode);var r=X.instance;jt.bindTexture(r,this._glTextureType,this._glTexture);var s=this._getGLFormat();K.isConchApp?t instanceof laya.resource.HTMLCanvas?r.texImage2D(this._glTextureType,0,6408,6408,5121,t):(t.setPremultiplyAlpha(e),r.texImage2D(this._glTextureType,0,6408,6408,5121,t)):(e&&r.pixelStorei(37441,!0),r.texImage2D(this._glTextureType,0,s,s,5121,t),e&&r.pixelStorei(37441,!1)),this._mipmap?(r.generateMipmap(this._glTextureType),this._setGPUMemory(i*n*4*(1+1/3))):this._setGPUMemory(i*n*4),this._canRead&&(K.isConchApp?this._pixels=new Uint8Array(t._nativeObj.getImageData(0,0,i,n)):(Y.canvas.size(i,n),Y.canvas.clear(),Y.context.drawImage(t,0,0,i,n),this._pixels=new Uint8Array(Y.context.getImageData(0,0,i,n).data.buffer))),this._readyed=!0,this._activeResource()},e.setPixels=function(t,e){if(void 0===e&&(e=0),!t)throw"Texture2D:pixels can't be null.";var i=Math.max(this._width>>e,1),n=Math.max(this._height>>e,1),r=i*n*this._getFormatByteCount();if(t.length-1&&(t=t.replace("^^","")),this._restrictPattern=new RegExp(t,"g")):this._restrictPattern=null}),s(0,e,"prompt",function(){return this._prompt},function(t){!this._text&&t&&i.superSet(oi,this,"color",this._promptColor),this.promptColor=this._promptColor,this._text?i.superSet(oi,this,"text",this._text==this._prompt?t:this._text):i.superSet(oi,this,"text",t),this._prompt=oi.langPacks&&oi.langPacks[t]?oi.langPacks[t]:t}),s(0,e,"promptColor",function(){return this._promptColor},function(t){this._promptColor=t,this._content||i.superSet(oi,this,"color",t)}),s(0,e,"type",function(){return this._type},function(t){this._getTextStyle().asPassword="password"===t,this._type=t}),Input.__init__=function(){if(Input._createInputElement(),Y.onMobile){var t=!1;(Y.onMiniGame||Y.onBDMiniGame||Y.onQGMiniGame||Y.onKGMiniGame||Y.onVVMiniGame||Y.onAlipayMiniGame||Y.onBLMiniGame||Y.onQQMiniGame)&&(t=!0),K.canvas.addEventListener(Input.IOS_IFRAME?t?"touchend":"click":"touchend",Input._popupInputMethod)}},Input._popupInputMethod=function(t){laya.display.Input.isInputting&&laya.display.Input.inputElement.focus()},Input._createInputElement=function(){Input._initInput(Input.area=Y.createElement("textarea")),Input._initInput(Input.input=Y.createElement("input")),Input.inputContainer=Y.createElement("div"),Input.inputContainer.style.position="absolute",Input.inputContainer.style.zIndex=1e5,Y.container.appendChild(Input.inputContainer),Input.inputContainer.setPos=function(t,e){Input.inputContainer.style.left=t+"px",Input.inputContainer.style.top=e+"px"}},Input._initInput=function(t){var e=t.style;e.cssText="position:absolute;overflow:hidden;resize:none;transform-origin:0 0;-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-o-transform-origin:0 0;",e.resize="none",e.backgroundColor="transparent",e.border="none",e.outline="none",e.zIndex=1,t.addEventListener("input",Input._processInputting),t.addEventListener("mousemove",Input._stopEvent),t.addEventListener("mousedown",Input._stopEvent),t.addEventListener("touchmove",Input._stopEvent),t.setFontFace=function(e){t.style.fontFamily=e},K.isConchApp||(t.setColor=function(e){t.style.color=e},t.setFontSize=function(e){t.style.fontSize=e+"px"})},Input._processInputting=function(t){var e=laya.display.Input.inputElement.target;if(e){var i=laya.display.Input.inputElement.value;e._restrictPattern&&(i=i.replace(/\u2006|\x27/g,""),e._restrictPattern.test(i)&&(i=i.replace(e._restrictPattern,""),laya.display.Input.inputElement.value=i)),e._text=i,e.event("input")}},Input._stopEvent=function(t){"touchmove"==t.type&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},Input.TYPE_TEXT="text",Input.TYPE_PASSWORD="password",Input.TYPE_EMAIL="email",Input.TYPE_URL="url",Input.TYPE_NUMBER="number",Input.TYPE_RANGE="range",Input.TYPE_DATE="date",Input.TYPE_MONTH="month",Input.TYPE_WEEK="week",Input.TYPE_TIME="time",Input.TYPE_DATE_TIME="datetime",Input.TYPE_DATE_TIME_LOCAL="datetime-local",Input.TYPE_SEARCH="search",Input.input=null,Input.area=null,Input.inputElement=null,Input.inputContainer=null,Input.confirmButton=null,Input.promptStyleDOM=null,Input.inputHeight=45,Input.isInputting=!1,Input.stageMatrix=null,n(Input,["IOS_IFRAME",function(){return this.IOS_IFRAME=Y.onIOS&&Y.window.top!=Y.window.self}]),Input}(oi),fi=function(t){var e;function GraphicAnimation(){this.animationList=null,this.animationDic=null,this._nodeList=null,this._nodeDefaultProps=null,this._gList=null,this._nodeIDAniDic={},this._rootNode=null,this._nodeGDic=null,GraphicAnimation.__super.call(this)}r(GraphicAnimation,"laya.utils.GraphicAnimation",t);var i=GraphicAnimation.prototype;return i._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){var i=0,n=e.length;for(i=0;i=s.length&&(i=s.length-1),t[e][i]}return r.hasOwnProperty(e)?r[e]:n},i._getNodeGraphicData=function(t,i,n){n||(n=new e),n.transform?n.transform.identity():n.transform=new U;var r=this.getNodeDataByID(t);if(!r)return n;var s,a=r.frames,o=this._getParams(a,GraphicAnimation._drawTextureCmd,i,this._nodeDefaultProps[t]),h=o[0],u=NaN,l=NaN,c=o[5],_=o[6],d=o[13],f=o[14],p=o[7],m=o[8],g=o[9],v=o[11],x=o[12];u=o[3],l=o[4],0!=u&&0!=l||(h=null),-1==u&&(u=0),-1==l&&(l=0),n.skin=h,n.width=u,n.height=l,h&&((s=this._getTextureByUrl(h))?(u||(u=s.sourceWidth),l||(l=s.sourceHeight)):console.warn("lost skin:",h,",you may load pics first")),n.alpha=o[10];var y=n.transform;0!=d&&(c=d*u),0!=f&&(_=f*l),0==c&&0==_||y.translate(-c,-_);var T=null;if(g||1!==p||1!==m||v||x){(T=GraphicAnimation._tempMt).identity(),T._bTransform=!0;var b=.0174532922222222*(g-v),C=.0174532922222222*(g+x),S=Math.cos(C),w=Math.sin(C),M=Math.sin(b),A=Math.cos(b);T.a=p*S,T.b=p*w,T.c=-m*M,T.d=m*A,T.tx=T.ty=0}return T&&(y=U.mul(y,T,y)),y.translate(o[1],o[2]),n},i._getTextureByUrl=function(t){return Ce.getRes(t)},i.setAniData=function(t,e){if(t.animations){this._nodeDefaultProps={},this._nodeGDic={},this._nodeList&&(this._nodeList.length=0),this._rootNode=t,this._parseNodeList(t);var i,n={},r=[],s=t.animations,a=0,o=s.length;for(a=0;athis._count&&(t=this._count);var e=this._animationData.nodes,i=0,n=e.length;for(n=n>1?1:n,i=0;ie?r[e]:r[r.length-1],l[n]=s}},e._calculateKeyFrames=function(e){t.prototype._calculateKeyFrames.call(this,e);var i,n,r=e.keyframes,s=(e.target,{});for(i in e.secondFrames=s,r)(n=r[i]).length<=1?s[i]=-1:s[i]=n[1].index},s(0,e,"target",function(){return this._target},function(t){this._target&&this._target.off("effectbegin",this,this._onOtherBegin),this._target=t,this._target&&this._target.on("effectbegin",this,this._onOtherBegin),this._addEvent()}),s(0,e,"playEvent",null,function(t){this._playEvent=t,t&&this._addEvent()}),s(0,e,"effectData",null,function(t){if(t){var e=t.animations;if(e&&e[0]){var i=e[0];this._setUp({},i),i.nodes&&i.nodes[0]&&(this._aniKeys=i.nodes[0].keys)}}}),s(0,e,"effectClass",null,function(t){if(this._effectClass=S.getClass(t),this._effectClass){var e=this._effectClass.uiView;if(e){var i=e.animations;if(i&&i[0]){var n=i[0];this._setUp({},n),n.nodes&&n.nodes[0]&&(this._aniKeys=n.nodes[0].keys)}}}}),EffectAnimation.EFFECT_BEGIN="effectbegin"}(ui);i.__init([Re,f,me,Ft,fi,xe,K,l,E,zt,m,Ye,ce,be])}(window,document,Laya),function(t,e,i){i.un,i.uns,i.static;var n=i.class;i.getset,i.__newvec;new(function(){function LayaMain(){}return n(LayaMain,"LayaMain"),LayaMain}())}(window,document,Laya);