0% found this document useful (0 votes)
660 views459 pages

Cocos2d Js Min

The document defines several easing functions for animations in Cocos2d-js, including easeIn, easeOut, easeInOut, easeExponentialIn, easeExponentialOut, easeExponentialInOut, easeSineIn, easeSineOut, easeSineInOut, and easeElasticIn. It defines them as classes with easing and reverse functions to calculate the progress and reverse progress of animations over time.

Uploaded by

Rahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
660 views459 pages

Cocos2d Js Min

The document defines several easing functions for animations in Cocos2d-js, including easeIn, easeOut, easeInOut, easeExponentialIn, easeExponentialOut, easeExponentialInOut, easeSineIn, easeSineOut, easeSineInOut, and easeElasticIn. It defines them as classes with easing and reverse functions to calculate the progress and reverse progress of animations over time.

Uploaded by

Rahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 459

(function(t,e,i){function n(i,r){var s=e[i];if(!s){var a=t[i];if(!

a)return;var
o={};s=e[i]={exports:o},a[0]((function(t){return n(a[1][t]||t)}),s,o)}return
s.exports}for(var r=0;r<i.length;r++)n(i[r])})({1:[(function(t,e,i){"use
strict";t("../core/platform/CCClass");var
n=t("../core/utils/misc");cc.Action=cc.Class({name:"cc.Action",ctor:function()
{this.originalTarget=null,this.target=null,this.tag=cc.Action.TAG_INVALID},clone:fu
nction(){var t=new cc.Action;return
t.originalTarget=null,t.target=null,t.tag=this.tag,t},isDone:function(){return!
0},startWithTarget:function(t){this.originalTarget=t,this.target=t},stop:function()
{this.target=null},step:function(t){cc.logID(1006)},update:function(t)
{cc.logID(1007)},getTarget:function(){return this.target},setTarget:function(t)
{this.target=t},getOriginalTarget:function(){return
this.originalTarget},setOriginalTarget:function(t)
{this.originalTarget=t},getTag:function(){return this.tag},setTag:function(t)
{this.tag=t},retain:function(){},release:function(){}}),cc.Action.TAG_INVALID=-
1,cc.FiniteTimeAction=cc.Class({name:"cc.FiniteTimeAction",extends:cc.Action,ctor:f
unction(){this._duration=0},getDuration:function(){return
this._duration*(this._timesForRepeat||1)},setDuration:function(t)
{this._duration=t},reverse:function(){return cc.logID(1008),null},clone:function()
{return new
cc.FiniteTimeAction}}),cc.Speed=cc.Class({name:"cc.Speed",extends:cc.Action,ctor:fu
nction(t,e)
{this._speed=0,this._innerAction=null,t&&this.initWithAction(t,e)},getSpeed:functio
n(){return this._speed},setSpeed:function(t)
{this._speed=t},initWithAction:function(t,e){return t?
(this._innerAction=t,this._speed=e,!0):(cc.errorID(1021),!1)},clone:function(){var
t=new cc.Speed;return
t.initWithAction(this._innerAction.clone(),this._speed),t},startWithTarget:function
(t)
{cc.Action.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget
(t)},stop:function()
{this._innerAction.stop(),cc.Action.prototype.stop.call(this)},step:function(t)
{this._innerAction.step(t*this._speed)},isDone:function(){return
this._innerAction.isDone()},reverse:function(){return new
cc.Speed(this._innerAction.reverse(),this._speed)},setInnerAction:function(t)
{this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return
this._innerAction}}),cc.speed=function(t,e){return new
cc.Speed(t,e)},cc.Follow=cc.Class({name:"cc.Follow",extends:cc.Action,ctor:function
(t,e){this._followedNode=null,this._boundarySet=!1,this._boundaryFullyCovered=!
1,this._halfScreenSize=null,this._fullScreenSize=null,this.leftBoundary=0,this.righ
tBoundary=0,this.topBoundary=0,this.bottomBoundary=0,this._worldRect=cc.rect(0,0,0,
0),t&&(e?this.initWithTarget(t,e):this.initWithTarget(t))},clone:function(){var
t=new cc.Follow,e=this._worldRect,i=new cc.Rect(e.x,e.y,e.width,e.height);return
t.initWithTarget(this._followedNode,i),t},isBoundarySet:function(){return
this._boundarySet},setBoudarySet:function(t)
{this._boundarySet=t},initWithTarget:function(t,e){if(!t)return cc.errorID(1022),!
1;e=e||cc.rect(0,0,0,0),this._followedNode=t,this._worldRect=e,this._boundarySet=!
(0===e.width&&0===e.height),this._boundaryFullyCovered=!1;var i=cc.winSize;return
this._fullScreenSize=cc.v2(i.width,i.height),this._halfScreenSize=this._fullScreenS
ize.mul(.5),this._boundarySet&&(this.leftBoundary=-(e.x+e.width-
this._fullScreenSize.x),this.rightBoundary=-e.x,this.topBoundary=-
e.y,this.bottomBoundary=-(e.y+e.height-
this._fullScreenSize.y),this.rightBoundary<this.leftBoundary&&(this.rightBoundary=t
his.leftBoundary=(this.leftBoundary+this.rightBoundary)/2),this.topBoundary<this.bo
ttomBoundary&&(this.topBoundary=this.bottomBoundary=(this.topBoundary+this.bottomBo
undary)/2),this.topBoundary===this.bottomBoundary&&this.leftBoundary===this.rightBo
undary&&(this._boundaryFullyCovered=!0)),!0},step:function(t){var
e=this.target.convertToWorldSpaceAR(cc.Vec2.ZERO),i=this._followedNode.convertToWor
ldSpaceAR(cc.Vec2.ZERO),r=e.sub(i),s=this.target.parent.convertToNodeSpaceAR(r.add(
this._halfScreenSize));if(this._boundarySet)
{if(this._boundaryFullyCovered)return;this.target.setPosition(n.clampf(s.x,this.lef
tBoundary,this.rightBoundary),n.clampf(s.y,this.bottomBoundary,this.topBoundary))}e
lse this.target.setPosition(s.x,s.y)},isDone:function(){return!
this._followedNode.activeInHierarchy},stop:function()
{this.target=null,cc.Action.prototype.stop.call(this)}}),cc.follow=function(t,e)
{return new cc.Follow(t,e)}}),
{"../core/platform/CCClass":200,"../core/utils/misc":295}],2:[(function(t,e,i){"use
strict";function n(t,e,i,n,r,s){var a=s*s,o=a*s,l=(1-r)/2,h=l*(2*a-o-s),c=l*(-o+a)
+(2*o-3*a+1),u=l*(o-2*a+s)+(-2*o+3*a),_=l*(o-
a),f=t.x*h+e.x*c+i.x*u+n.x*_,d=t.y*h+e.y*c+i.y*u+n.y*_;return cc.v2(f,d)}function
r(t,e){return t[Math.min(t.length-1,Math.max(e,0))]}function s(t){for(var
e=[],i=t.length-1;i>=0;i--)e.push(cc.v2(t[i].x,t[i].y));return e}function a(t)
{for(var e=[],i=0;i<t.length;i++)e.push(cc.v2(t[i].x,t[i].y));return
e}cc.CardinalSplineTo=cc.Class({name:"cc.CardinalSplineTo",extends:cc.ActionInterva
l,ctor:function(t,e,i)
{this._points=[],this._deltaT=0,this._tension=0,this._previousPosition=null,this._a
ccumulatedDiff=null,void 0!
==i&&cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,i)},initWithDurat
ion:function(t,e,i){return e&&0!==e.length?!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this.setPoints(e),this.
_tension=i,!0):(cc.errorID(1024),!1)},clone:function(){var t=new
cc.CardinalSplineTo;return
t.initWithDuration(this._duration,a(this._points),this._tension),t},startWithTarget
:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._deltaT=1/
(this._points.length-
1),this._previousPosition=cc.v2(this.target.x,this.target.y),this._accumulatedDiff=
cc.v2(0,0)},update:function(t){var e,i;t=this._computeEaseTime(t);var
s=this._points;if(1===t)e=s.length-1,i=1;else{var a=this._deltaT;i=(t-a*(e=0|
t/a))/a}var o,l,h=n(r(s,e-1),r(s,e-
0),r(s,e+1),r(s,e+2),this._tension,i);if(cc.macro.ENABLE_STACKABLE_ACTIONS&&(o=this
.target.x-this._previousPosition.x,l=this.target.y-this._previousPosition.y,0!==o||
0!==l)){var
c=this._accumulatedDiff;o=c.x+o,l=c.y+l,c.x=o,c.y=l,h.x+=o,h.y+=l}this.updatePositi
on(h)},reverse:function(){var t=s(this._points);return
cc.cardinalSplineTo(this._duration,t,this._tension)},updatePosition:function(t)
{this.target.setPosition(t),this._previousPosition=t},getPoints:function(){return
this._points},setPoints:function(t)
{this._points=t}}),cc.cardinalSplineTo=function(t,e,i){return new
cc.CardinalSplineTo(t,e,i)},cc.CardinalSplineBy=cc.Class({name:"cc.CardinalSplineBy
",extends:cc.CardinalSplineTo,ctor:function(t,e,i)
{this._startPosition=cc.v2(0,0),void 0!
==i&&this.initWithDuration(t,e,i)},startWithTarget:function(t)
{cc.CardinalSplineTo.prototype.startWithTarget.call(this,t),this._startPosition.x=t
.x,this._startPosition.y=t.y},reverse:function(){for(var
t,e=this._points.slice(),i=e[0],n=1;n<e.length;++n)t=e[n],e[n]=t.sub(i),i=t;var
r=s(e);i=r[r.length-1],r.pop(),i.x=-i.x,i.y=-i.y,r.unshift(i);for(n=1;n<r.length;+
+n)(t=r[n]).x=-t.x,t.y=-t.y,t.x+=i.x,t.y+=i.y,r[n]=t,i=t;return
cc.cardinalSplineBy(this._duration,r,this._tension)},updatePosition:function(t){var
e=this._startPosition,i=t.x+e.x,n=t.y+e.y;this._previousPosition.x=i,this._previous
Position.y=n,this.target.setPosition(i,n)},clone:function(){var t=new
cc.CardinalSplineBy;return
t.initWithDuration(this._duration,a(this._points),this._tension),t}}),cc.cardinalSp
lineBy=function(t,e,i){return new
cc.CardinalSplineBy(t,e,i)},cc.CatmullRomTo=cc.Class({name:"cc.CatmullRomTo",extend
s:cc.CardinalSplineTo,ctor:function(t,e)
{e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return
cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,.5)},clone:function()
{var t=new cc.CatmullRomTo;return
t.initWithDuration(this._duration,a(this._points)),t}}),cc.catmullRomTo=function(t,
e){return new
cc.CatmullRomTo(t,e)},cc.CatmullRomBy=cc.Class({name:"cc.CatmullRomBy",extends:cc.C
ardinalSplineBy,ctor:function(t,e)
{e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return
cc.CardinalSplineTo.prototype.initWithDuration.call(this,t,e,.5)},clone:function()
{var t=new cc.CatmullRomBy;return
t.initWithDuration(this._duration,a(this._points)),t}}),cc.catmullRomBy=function(t,
e){return new cc.CatmullRomBy(t,e)}}),{}],3:[(function(t,e,i){"use
strict";cc.easeIn=function(t){return{_rate:t,easing:function(t){return
Math.pow(t,this._rate)},reverse:function(){return
cc.easeIn(1/this._rate)}}},cc.easeOut=function(t){return{_rate:t,easing:function(t)
{return Math.pow(t,1/this._rate)},reverse:function(){return
cc.easeOut(1/this._rate)}}},cc.easeInOut=function(t)
{return{_rate:t,easing:function(t)
{return(t*=2)<1?.5*Math.pow(t,this._rate):1-.5*Math.pow(2-
t,this._rate)},reverse:function(){return cc.easeInOut(this._rate)}}};var
n={easing:function(t){return 0===t?0:Math.pow(2,10*(t-1))},reverse:function()
{return r}};cc.easeExponentialIn=function(){return n};var r={easing:function(t)
{return 1===t?1:1-Math.pow(2,-10*t)},reverse:function(){return
n}};cc.easeExponentialOut=function(){return r};var s={easing:function(t){return 1!
==t&&0!==t?(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-
1))):t},reverse:function(){return s}};cc.easeExponentialInOut=function(){return
s};var a={easing:function(t){return 0===t||1===t?t:-
1*Math.cos(t*Math.PI/2)+1},reverse:function(){return o}};cc.easeSineIn=function()
{return a};var o={easing:function(t){return 0===t||1===t?
t:Math.sin(t*Math.PI/2)},reverse:function(){return a}};cc.easeSineOut=function()
{return o};var l={easing:function(t){return 0===t||1===t?
t:-.5*(Math.cos(Math.PI*t)-1)},reverse:function(){return
l}};cc.easeSineInOut=function(){return l};var h={easing:function(t){return 0===t||
1===t?t:(t-=1,-
Math.pow(2,10*t)*Math.sin((t-.075)*Math.PI*2/.3))},reverse:function(){return
c}};cc.easeElasticIn=function(t){return t&&.3!==t?{_period:t,easing:function(t)
{return
0===t||1===t?t:(t-=1,-Math.pow(2,10*t)*Math.sin((t-
this._period/4)*Math.PI*2/this._period))},reverse:function(){return
cc.easeElasticOut(this._period)}}:h};var c={easing:function(t){return 0===t||1===t?
t:Math.pow(2,-10*t)*Math.sin((t-.075)*Math.PI*2/.3)+1},reverse:function(){return
h}};function u(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-
=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-
=2.625/2.75)*t+.984375}cc.easeElasticOut=function(t){return t&&.3!==t?
{_period:t,easing:function(t){return 0===t||1===t?t:Math.pow(2,-10*t)*Math.sin((t-
this._period/4)*Math.PI*2/this._period)+1},reverse:function(){return
cc.easeElasticIn(this._period)}}:c},cc.easeElasticInOut=function(t)
{return{_period:t=t||.3,easing:function(t){var e=0,i=this._period;if(0===t||
1===t)e=t;else{t*=2,i||(i=this._period=.3*1.5);var n=i/4;e=(t-
=1)<0?-.5*Math.pow(2,10*t)*Math.sin((t-n)*Math.PI*2/i):Math.pow(2,-
10*t)*Math.sin((t-n)*Math.PI*2/i)*.5+1}return e},reverse:function(){return
cc.easeElasticInOut(this._period)}}};var _={easing:function(t){return 1-u(1-
t)},reverse:function(){return f}};cc.easeBounceIn=function(){return _};var
f={easing:function(t){return u(t)},reverse:function(){return
_}};cc.easeBounceOut=function(){return f};var d={easing:function(t){return
t<.5?.5*(1-u(1-(t*=2))):.5*u(2*t-1)+.5},reverse:function(){return
d}};cc.easeBounceInOut=function(){return d};var m={easing:function(t){return
0===t||1===t?t:t*t*(2.70158*t-1.70158)},reverse:function(){return
p}};cc.easeBackIn=function(){return m};var p={easing:function(t){return(t-
=1)*t*(2.70158*t+1.70158)+1},reverse:function(){return
m}};cc.easeBackOut=function(){return p};var v={easing:function(t){return(t*=2)<1?
t*t*(3.5949095*t-2.5949095)/2:(t-
=2)*t*(3.5949095*t+2.5949095)/2+1},reverse:function(){return
v}};cc.easeBackInOut=function(){return v},cc.easeBezierAction=function(t,e,i,n)
{return{easing:function(r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-
r,2)*e+3*Math.pow(r,2)*(1-r)*i+Math.pow(r,3)*n},reverse:function(){return
cc.easeBezierAction(n,i,e,t)}}};var y={easing:function(t){return
Math.pow(t,2)},reverse:function(){return y}};cc.easeQuadraticActionIn=function()
{return y};var g={easing:function(t){return-t*(t-2)},reverse:function(){return
g}};cc.easeQuadraticActionOut=function(){return g};var x={easing:function(t)
{return(t*=2)<1?t*t*.5:-.5*(--t*(t-2)-1)},reverse:function(){return
x}};cc.easeQuadraticActionInOut=function(){return x};var b={easing:function(t)
{return t*t*t*t},reverse:function(){return b}};cc.easeQuarticActionIn=function()
{return b};var A={easing:function(t){return-((t-=1)*t*t*t-1)},reverse:function()
{return A}};cc.easeQuarticActionOut=function(){return A};var C={easing:function(t)
{return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},reverse:function(){return
C}};cc.easeQuarticActionInOut=function(){return C};var S={easing:function(t){return
t*t*t*t*t},reverse:function(){return S}};cc.easeQuinticActionIn=function(){return
S};var T={easing:function(t){return(t-=1)*t*t*t*t+1},reverse:function(){return
T}};cc.easeQuinticActionOut=function(){return T};var w={easing:function(t)
{return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},reverse:function(){return
w}};cc.easeQuinticActionInOut=function(){return w};var E={easing:function(t)
{return-1*(Math.sqrt(1-t*t)-1)},reverse:function(){return
E}};cc.easeCircleActionIn=function(){return E};var M={easing:function(t){return t-
=1,Math.sqrt(1-t*t)},reverse:function(){return
M}};cc.easeCircleActionOut=function(){return M};var D={easing:function(t)
{return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):(t-=2,.5*(Math.sqrt(1-t*t)
+1))},reverse:function(){return D}};cc.easeCircleActionInOut=function(){return
D};var B={easing:function(t){return t*t*t},reverse:function(){return
B}};cc.easeCubicActionIn=function(){return B};var P={easing:function(t){return(t-
=1)*t*t+1},reverse:function(){return P}};cc.easeCubicActionOut=function(){return
P};var I={easing:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-
=2)*t*t+2)},reverse:function(){return I}};cc.easeCubicActionInOut=function(){return
I}}),{}],4:[(function(t,e,i){"use
strict";cc.ActionInstant=cc.Class({name:"cc.ActionInstant",extends:cc.FiniteTimeAct
ion,isDone:function(){return!0},step:function(t){this.update(1)},update:function(t)
{},reverse:function(){return this.clone()},clone:function(){return new
cc.ActionInstant}}),cc.Show=cc.Class({name:"cc.Show",extends:cc.ActionInstant,updat
e:function(t){for(var
e=this.target.getComponentsInChildren(cc.RenderComponent),i=0;i<e.length;++i)
{e[i].enabled=!0}},reverse:function(){return new cc.Hide},clone:function(){return
new cc.Show}}),cc.show=function(){return new
cc.Show},cc.Hide=cc.Class({name:"cc.Hide",extends:cc.ActionInstant,update:function(
t){for(var
e=this.target.getComponentsInChildren(cc.RenderComponent),i=0;i<e.length;++i)
{e[i].enabled=!1}},reverse:function(){return new cc.Show},clone:function(){return
new cc.Hide}}),cc.hide=function(){return new
cc.Hide},cc.ToggleVisibility=cc.Class({name:"cc.ToggleVisibility",extends:cc.Action
Instant,update:function(t){for(var
e=this.target.getComponentsInChildren(cc.RenderComponent),i=0;i<e.length;++i){var
n=e[i];n.enabled=!n.enabled}},reverse:function(){return new
cc.ToggleVisibility},clone:function(){return new
cc.ToggleVisibility}}),cc.toggleVisibility=function(){return new
cc.ToggleVisibility},cc.RemoveSelf=cc.Class({name:"cc.RemoveSelf",extends:cc.Action
Instant,ctor:function(t){this._isNeedCleanUp=!0,void 0!
==t&&this.init(t)},update:function(t)
{this.target.removeFromParent(this._isNeedCleanUp)},init:function(t){return
this._isNeedCleanUp=t,!0},reverse:function(){return new
cc.RemoveSelf(this._isNeedCleanUp)},clone:function(){return new
cc.RemoveSelf(this._isNeedCleanUp)}}),cc.removeSelf=function(t){return new
cc.RemoveSelf(t)},cc.FlipX=cc.Class({name:"cc.FlipX",extends:cc.ActionInstant,ctor:
function(t){this._flippedX=!1,void 0!
==t&&this.initWithFlipX(t)},initWithFlipX:function(t){return this._flippedX=t,!
0},update:function(t)
{this.target.scaleX=Math.abs(this.target.scaleX)*(this._flippedX?-
1:1)},reverse:function(){return new cc.FlipX(!this._flippedX)},clone:function(){var
t=new cc.FlipX;return t.initWithFlipX(this._flippedX),t}}),cc.flipX=function(t)
{return new
cc.FlipX(t)},cc.FlipY=cc.Class({name:"cc.FlipY",extends:cc.ActionInstant,ctor:funct
ion(t){this._flippedY=!1,void 0!
==t&&this.initWithFlipY(t)},initWithFlipY:function(t){return this._flippedY=t,!
0},update:function(t)
{this.target.scaleY=Math.abs(this.target.scaleY)*(this._flippedY?-
1:1)},reverse:function(){return new cc.FlipY(!this._flippedY)},clone:function(){var
t=new cc.FlipY;return t.initWithFlipY(this._flippedY),t}}),cc.flipY=function(t)
{return new
cc.FlipY(t)},cc.Place=cc.Class({name:"cc.Place",extends:cc.ActionInstant,ctor:funct
ion(t,e){this._x=0,this._y=0,void 0!==t&&(void 0!
==t.x&&(e=t.y,t=t.x),this.initWithPosition(t,e))},initWithPosition:function(t,e)
{return this._x=t,this._y=e,!0},update:function(t)
{this.target.setPosition(this._x,this._y)},clone:function(){var t=new
cc.Place;return t.initWithPosition(this._x,this._y),t}}),cc.place=function(t,e)
{return new
cc.Place(t,e)},cc.CallFunc=cc.Class({name:"cc.CallFunc",extends:cc.ActionInstant,ct
or:function(t,e,i)
{this._selectorTarget=null,this._function=null,this._data=null,this.initWithFunctio
n(t,e,i)},initWithFunction:function(t,e,i){return
t&&(this._function=t),e&&(this._selectorTarget=e),void 0!==i&&(this._data=i),!
0},execute:function()
{this._function&&this._function.call(this._selectorTarget,this.target,this._data)},
update:function(t){this.execute()},getTargetCallback:function(){return
this._selectorTarget},setTargetCallback:function(t){t!
==this._selectorTarget&&(this._selectorTarget&&(this._selectorTarget=null),this._se
lectorTarget=t)},clone:function(){var t=new cc.CallFunc;return
t.initWithFunction(this._function,this._selectorTarget,this._data),t}}),cc.callFunc
=function(t,e,i){return new cc.CallFunc(t,e,i)}}),{}],5:[(function(t,e,i){"use
strict";function n(t,e,i,n,r){return Math.pow(1-r,3)*t+3*r*Math.pow(1-
r,2)*e+3*Math.pow(r,2)*(1-
r)*i+Math.pow(r,3)*n}cc.ActionInterval=cc.Class({name:"cc.ActionInterval",extends:c
c.FiniteTimeAction,ctor:function(t)
{this.MAX_VALUE=2,this._elapsed=0,this._firstTick=!
1,this._easeList=null,this._speed=1,this._timesForRepeat=1,this._repeatForever=!
1,this._repeatMethod=!1,this._speedMethod=!1,void 0!
==t&&cc.ActionInterval.prototype.initWithDuration.call(this,t)},getElapsed:function
(){return this._elapsed},initWithDuration:function(t){return this._duration=0===t?
cc.macro.FLT_EPSILON:t,this._elapsed=0,this._firstTick=!0,!0},isDone:function()
{return this._elapsed>=this._duration},_cloneDecoration:function(t)
{t._repeatForever=this._repeatForever,t._speed=this._speed,t._timesForRepeat=this._
timesForRepeat,t._easeList=this._easeList,t._speedMethod=this._speedMethod,t._repea
tMethod=this._repeatMethod},_reverseEaseList:function(t){if(this._easeList)
{t._easeList=[];for(var e=0;e<this._easeList.length;e+
+)t._easeList.push(this._easeList[e].reverse())}},clone:function(){var t=new
cc.ActionInterval(this._duration);return
this._cloneDecoration(t),t},easing:function(t){this._easeList?
this._easeList.length=0:this._easeList=[];for(var e=0;e<arguments.length;e+
+)this._easeList.push(arguments[e]);return this},_computeEaseTime:function(t){var
e=this._easeList;if(!e||0===e.length)return t;for(var i=0,n=e.length;i<n;i+
+)t=e[i].easing(t);return t},step:function(t){this._firstTick?(this._firstTick=!
1,this._elapsed=0):this._elapsed+=t;var
e=this._elapsed/(this._duration>1.192092896e-7?this._duration:1.192092896e-
7);e=1>e?e:1,this.update(e>0?
e:0),this._repeatMethod&&this._timesForRepeat>1&&this.isDone()&&(this._repeatForeve
r||
this._timesForRepeat--,this.startWithTarget(this.target),this.step(this._elapsed-
this._duration))},startWithTarget:function(t)
{cc.Action.prototype.startWithTarget.call(this,t),this._elapsed=0,this._firstTick=!
0},reverse:function(){return cc.logID(1010),null},setAmplitudeRate:function(t)
{cc.logID(1011)},getAmplitudeRate:function(){return
cc.logID(1012),0},speed:function(t){return t<=0?(cc.logID(1013),this):
(this._speedMethod=!0,this._speed*=t,this)},getSpeed:function(){return
this._speed},setSpeed:function(t){return this._speed=t,this},repeat:function(t)
{return t=Math.round(t),isNaN(t)||t<1?(cc.logID(1014),this):(this._repeatMethod=!
0,this._timesForRepeat*=t,this)},repeatForever:function(){return
this._repeatMethod=!0,this._timesForRepeat=this.MAX_VALUE,this._repeatForever=!
0,this}}),cc.actionInterval=function(t){return new
cc.ActionInterval(t)},cc.Sequence=cc.Class({name:"cc.Sequence",extends:cc.ActionInt
erval,ctor:function(t)
{this._actions=[],this._split=null,this._last=0,this._reversed=!1;var e=t
instanceof Array?t:arguments;if(1!==e.length){var i=e.length-
1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],s=1;s<i;s+
+)e[s]&&(n=r,r=cc.Sequence._actionOneTwo(n,e[s]));this.initWithTwoActions(r,e[i])}}
else cc.errorID(1019)},initWithTwoActions:function(t,e){if(!t||!e)return
cc.errorID(1025),!1;var i=t._duration,n=e._duration,r=(i*=t._repeatMethod?
t._timesForRepeat:1)+(n*=e._repeatMethod?e._timesForRepeat:1);return
this.initWithDuration(r),this._actions[0]=t,this._actions[1]=e,!0},clone:function()
{var t=new cc.Sequence;return
this._cloneDecoration(t),t.initWithTwoActions(this._actions[0].clone(),this._action
s[1].clone()),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._split=this._actions
[0]._duration/this._duration,this._split*=this._actions[0]._repeatMethod?
this._actions[0]._timesForRepeat:1,this._last=-1},stop:function(){-1!
==this._last&&this._actions[this._last].stop(),cc.Action.prototype.stop.call(this)}
,update:function(t){var e,i,n=0,r=this._split,s=this._actions,a=this._last;
(t=this._computeEaseTime(t))<r?(e=0!==r?
t/r:1,0===n&&1===a&&this._reversed&&(s[1].update(0),s[1].stop())):(n=1,e=1===r?1:
(t-r)/(1-r),-
1===a&&(s[0].startWithTarget(this.target),s[0].update(1),s[0].stop()),0===a&&(s[0].
update(1),s[0].stop())),i=s[n],a===n&&i.isDone()||(a!
==n&&i.startWithTarget(this.target),e*=i._timesForRepeat,i.update(e>1?e
%1:e),this._last=n)},reverse:function(){var
t=cc.Sequence._actionOneTwo(this._actions[1].reverse(),this._actions[0].reverse());
return this._cloneDecoration(t),this._reverseEaseList(t),t._reversed=!
0,t}}),cc.sequence=function(t){var e=t instanceof Array?
t:arguments;if(1===e.length)return cc.errorID(1019),null;var i=e.length-
1;i>=0&&null==e[i]&&cc.logID(1015);var n=null;if(i>=0){n=e[0];for(var r=1;r<=i;r+
+)e[r]&&(n=cc.Sequence._actionOneTwo(n,e[r]))}return
n},cc.Sequence._actionOneTwo=function(t,e){var i=new cc.Sequence;return
i.initWithTwoActions(t,e),i},cc.Repeat=cc.Class({name:"cc.Repeat",extends:cc.Action
Interval,ctor:function(t,e)
{this._times=0,this._total=0,this._nextDt=0,this._actionInstant=!
1,this._innerAction=null,void 0!
==e&&this.initWithAction(t,e)},initWithAction:function(t,e){var
i=t._duration*e;return!!
this.initWithDuration(i)&&(this._times=e,this._innerAction=t,t instanceof
cc.ActionInstant&&(this._actionInstant=!0,this._times-=1),this._total=0,!
0)},clone:function(){var t=new cc.Repeat;return
this._cloneDecoration(t),t.initWithAction(this._innerAction.clone(),this._times),t}
,startWithTarget:function(t)
{this._total=0,this._nextDt=this._innerAction._duration/this._duration,cc.ActionInt
erval.prototype.startWithTarget.call(this,t),this._innerAction.startWithTarget(t)},
stop:function()
{this._innerAction.stop(),cc.Action.prototype.stop.call(this)},update:function(t)
{t=this._computeEaseTime(t);var
e=this._innerAction,i=this._duration,n=this._times,r=this._nextDt;if(t>=r)
{for(;t>r&&this._total<n;)e.update(1),this._total+
+,e.stop(),e.startWithTarget(this.target),r+=e._duration/i,this._nextDt=r>1?
1:r;t>=1&&this._total<n&&(e.update(1),this._total++),this._actionInstant||
(this._total===n?e.stop():e.update(t-(r-e._duration/i)))}else e.update(t*n
%1)},isDone:function(){return this._total===this._times},reverse:function(){var
t=new cc.Repeat(this._innerAction.reverse(),this._times);return
this._cloneDecoration(t),this._reverseEaseList(t),t},setInnerAction:function(t)
{this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return
this._innerAction}}),cc.repeat=function(t,e){return new
cc.Repeat(t,e)},cc.RepeatForever=cc.Class({name:"cc.RepeatForever",extends:cc.Actio
nInterval,ctor:function(t)
{this._innerAction=null,t&&this.initWithAction(t)},initWithAction:function(t)
{return t?(this._innerAction=t,!0):(cc.errorID(1026),!1)},clone:function(){var
t=new cc.RepeatForever;return
this._cloneDecoration(t),t.initWithAction(this._innerAction.clone()),t},startWithTa
rget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._innerAction.startWi
thTarget(t)},step:function(t){var
e=this._innerAction;e.step(t),e.isDone()&&(e.startWithTarget(this.target),e.step(e.
getElapsed()-e._duration))},isDone:function(){return!1},reverse:function(){var
t=new cc.RepeatForever(this._innerAction.reverse());return
this._cloneDecoration(t),this._reverseEaseList(t),t},setInnerAction:function(t)
{this._innerAction!==t&&(this._innerAction=t)},getInnerAction:function(){return
this._innerAction}}),cc.repeatForever=function(t){return new
cc.RepeatForever(t)},cc.Spawn=cc.Class({name:"cc.Spawn",extends:cc.ActionInterval,c
tor:function(t){this._one=null,this._two=null;var e=t instanceof Array?
t:arguments;if(1!==e.length){var i=e.length-
1;if(i>=0&&null==e[i]&&cc.logID(1015),i>=0){for(var n,r=e[0],s=1;s<i;s+
+)e[s]&&(n=r,r=cc.Spawn._actionOneTwo(n,e[s]));this.initWithTwoActions(r,e[i])}}els
e cc.errorID(1020)},initWithTwoActions:function(t,e){if(!t||!e)return
cc.errorID(1027),!1;var i=!1,n=t._duration,r=e._duration;return
this.initWithDuration(Math.max(n,r))&&(this._one=t,this._two=e,n>r?
this._two=cc.Sequence._actionOneTwo(e,cc.delayTime(n-
r)):n<r&&(this._one=cc.Sequence._actionOneTwo(t,cc.delayTime(r-n))),i=!
0),i},clone:function(){var t=new cc.Spawn;return
this._cloneDecoration(t),t.initWithTwoActions(this._one.clone(),this._two.clone()),
t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._one.startWithTarget
(t),this._two.startWithTarget(t)},stop:function()
{this._one.stop(),this._two.stop(),cc.Action.prototype.stop.call(this)},update:func
tion(t)
{t=this._computeEaseTime(t),this._one&&this._one.update(t),this._two&&this._two.upd
ate(t)},reverse:function(){var
t=cc.Spawn._actionOneTwo(this._one.reverse(),this._two.reverse());return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.spawn=function(t){var e=t
instanceof Array?t:arguments;if(1===e.length)return
cc.errorID(1020),null;e.length>0&&null==e[e.length-1]&&cc.logID(1015);for(var
i=e[0],n=1;n<e.length;n++)null!=e[n]&&(i=cc.Spawn._actionOneTwo(i,e[n]));return
i},cc.Spawn._actionOneTwo=function(t,e){var i=new cc.Spawn;return
i.initWithTwoActions(t,e),i},cc.RotateTo=cc.Class({name:"cc.RotateTo",extends:cc.Ac
tionInterval,ctor:function(t,e)
{this._startAngle=0,this._dstAngle=0,this._angle=0,void 0!
==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._dstAngle=e,!
0)},clone:function(){var t=new cc.RotateTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._dstAngle),t},start
WithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startAngle=t.angle
%360;var e=this._dstAngle-this._startAngle;e>180&&(e-=360),e<-
180&&(e+=360),this._angle=e},reverse:function(){cc.logID(1016)},update:function(t)
{t=this._computeEaseTime(t),this.target&&(this.target.angle=this._startAngle+this._
angle*t)}}),cc.rotateTo=function(t,e){return new
cc.RotateTo(t,e)},cc.RotateBy=cc.Class({name:"cc.RotateBy",extends:cc.ActionInterva
l,ctor:function(t,e){this._deltaAngle=cc.v3(),this._startAngle=0,void 0!
==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaAngle=e,!
0)},clone:function(){var t=new cc.RotateBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaAngle),t},sta
rtWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startAngle=t.angle}
,update:function(t)
{t=this._computeEaseTime(t),this.target&&(this.target.angle=this._startAngle+this._
deltaAngle*t)},reverse:function(){var t=new cc.RotateBy(this._duration,-
this._deltaAngle);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.rotateBy=function(t,e)
{return new
cc.RotateBy(t,e)},cc.MoveBy=cc.Class({name:"cc.MoveBy",extends:cc.ActionInterval,ct
or:function(t,e,i)
{this._positionDelta=cc.v2(0,0),this._startPosition=cc.v2(0,0),this._previousPositi
on=cc.v2(0,0),void 0!
==e&&cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:functi
on(t,e,i){return!!cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void
0!==e.x&&(i=e.y,e=e.x),this._positionDelta.x=e,this._positionDelta.y=i,!
0)},clone:function(){var t=new cc.MoveBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._positionDelta),t},
startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPositi
on.x=e,this._startPosition.y=i},update:function(t)
{if(t=this._computeEaseTime(t),this.target){var
e=this._positionDelta.x*t,i=this._positionDelta.y*t,n=this._startPosition;if(cc.mac
ro.ENABLE_STACKABLE_ACTIONS){var
r=this.target.x,s=this.target.y,a=this._previousPosition;n.x=n.x+r-a.x,n.y=n.y+s-
a.y,e+=n.x,i+=n.y,a.x=e,a.y=i,this.target.setPosition(e,i)}else
this.target.setPosition(n.x+e,n.y+i)}},reverse:function(){var t=new
cc.MoveBy(this._duration,cc.v2(-this._positionDelta.x,-
this._positionDelta.y));return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.moveBy=function(t,e,i)
{return new
cc.MoveBy(t,e,i)},cc.MoveTo=cc.Class({name:"cc.MoveTo",extends:cc.MoveBy,ctor:funct
ion(t,e,i){this._endPosition=cc.v2(0,0),void
0!==e&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){return!!
cc.MoveBy.prototype.initWithDuration.call(this,t,e,i)&&(void 0!
==e.x&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!
0)},clone:function(){var t=new cc.MoveTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition),t},st
artWithTarget:function(t)
{cc.MoveBy.prototype.startWithTarget.call(this,t),this._positionDelta.x=this._endPo
sition.x-t.x,this._positionDelta.y=this._endPosition.y-
t.y}}),cc.moveTo=function(t,e,i){return new
cc.MoveTo(t,e,i)},cc.SkewTo=cc.Class({name:"cc.SkewTo",extends:cc.ActionInterval,ct
or:function(t,e,i)
{this._skewX=0,this._skewY=0,this._startSkewX=0,this._startSkewY=0,this._endSkewX=0
,this._endSkewY=0,this._deltaX=0,this._deltaY=0,void 0!
==i&&cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:functi
on(t,e,i){var n=!1;return
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endSkewX=e,this._
endSkewY=i,n=!0),n},clone:function(){var t=new cc.SkewTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endSkewX,this._end
SkewY),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startSkewX=t.skewX
%180,this._deltaX=this._endSkewX-this._startSkewX,this._deltaX>180&&(this._deltaX-
=360),this._deltaX<-180&&(this._deltaX+=360),this._startSkewY=t.skewY
%360,this._deltaY=this._endSkewY-this._startSkewY,this._deltaY>180&&(this._deltaY-
=360),this._deltaY<-180&&(this._deltaY+=360)},update:function(t)
{t=this._computeEaseTime(t),this.target.skewX=this._startSkewX+this._deltaX*t,this.
target.skewY=this._startSkewY+this._deltaY*t}}),cc.skewTo=function(t,e,i){return
new
cc.SkewTo(t,e,i)},cc.SkewBy=cc.Class({name:"cc.SkewBy",extends:cc.SkewTo,ctor:funct
ion(t,e,i){void 0!
==i&&this.initWithDuration(t,e,i)},initWithDuration:function(t,e,i){var n=!1;return
cc.SkewTo.prototype.initWithDuration.call(this,t,e,i)&&(this._skewX=e,this._skewY=i
,n=!0),n},clone:function(){var t=new cc.SkewBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._skewX,this._skewY)
,t},startWithTarget:function(t)
{cc.SkewTo.prototype.startWithTarget.call(this,t),this._deltaX=this._skewX,this._de
ltaY=this._skewY,this._endSkewX=this._startSkewX+this._deltaX,this._endSkewY=this._
startSkewY+this._deltaY},reverse:function(){var t=new cc.SkewBy(this._duration,-
this._skewX,-this._skewY);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.skewBy=function(t,e,i)
{return new
cc.SkewBy(t,e,i)},cc.JumpBy=cc.Class({name:"cc.JumpBy",extends:cc.ActionInterval,ct
or:function(t,e,i,n,r)
{this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),this._delta=cc.v2
(0,0),this._height=0,this._jumps=0,void 0!
==n&&cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)},initWithDuration:fu
nction(t,e,i,n,r){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(void
0===r&&(r=n,n=i,i=e.y,e=e.x),this._delta.x=e,this._delta.y=i,this._height=n,this._j
umps=r,!0)},clone:function(){var t=new cc.JumpBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._delta,this._height
,this._jumps),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPositi
on.x=e,this._startPosition.y=i},update:function(t)
{if(t=this._computeEaseTime(t),this.target){var e=t*this._jumps
%1,i=4*this._height*e*(1-e);i+=this._delta.y*t;var
n=this._delta.x*t,r=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var
s=this.target.x,a=this.target.y,o=this._previousPosition;r.x=r.x+s-o.x,r.y=r.y+a-
o.y,n+=r.x,i+=r.y,o.x=n,o.y=i,this.target.setPosition(n,i)}else
this.target.setPosition(r.x+n,r.y+i)}},reverse:function(){var t=new
cc.JumpBy(this._duration,cc.v2(-this._delta.x,-
this._delta.y),this._height,this._jumps);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.jumpBy=function(t,e,i,n,r
){return new
cc.JumpBy(t,e,i,n,r)},cc.JumpTo=cc.Class({name:"cc.JumpTo",extends:cc.JumpBy,ctor:f
unction(t,e,i,n,r){this._endPosition=cc.v2(0,0),void 0!
==n&&this.initWithDuration(t,e,i,n,r)},initWithDuration:function(t,e,i,n,r)
{return!!cc.JumpBy.prototype.initWithDuration.call(this,t,e,i,n,r)&&(void
0===r&&(i=e.y,e=e.x),this._endPosition.x=e,this._endPosition.y=i,!
0)},startWithTarget:function(t)
{cc.JumpBy.prototype.startWithTarget.call(this,t),this._delta.x=this._endPosition.x
-this._startPosition.x,this._delta.y=this._endPosition.y-
this._startPosition.y},clone:function(){var t=new cc.JumpTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endPosition,this._
height,this._jumps),t}}),cc.jumpTo=function(t,e,i,n,r){return new
cc.JumpTo(t,e,i,n,r)},cc.BezierBy=cc.Class({name:"cc.BezierBy",extends:cc.ActionInt
erval,ctor:function(t,e)
{this._config=[],this._startPosition=cc.v2(0,0),this._previousPosition=cc.v2(0,0),e
&&cc.BezierBy.prototype.initWithDuration.call(this,t,e)},initWithDuration:function(
t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._config=e,!
0)},clone:function(){var t=new cc.BezierBy;this._cloneDecoration(t);for(var
e=[],i=0;i<this._config.length;i++){var
n=this._config[i];e.push(cc.v2(n.x,n.y))}return
t.initWithDuration(this._duration,e),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.x,i=t.y;this._previousPosition.x=e,this._previousPosition.y=i,this._startPositi
on.x=e,this._startPosition.y=i},update:function(t)
{if(t=this._computeEaseTime(t),this.target){var
e=this._config,i=e[0].x,r=e[1].x,s=e[2].x,a=e[0].y,o=e[1].y,l=e[2].y,h=n(0,i,r,s,t)
,c=n(0,a,o,l,t),u=this._startPosition;if(cc.macro.ENABLE_STACKABLE_ACTIONS){var
_=this.target.x,f=this.target.y,d=this._previousPosition;u.x=u.x+_-d.x,u.y=u.y+f-
d.y,h+=u.x,c+=u.y,d.x=h,d.y=c,this.target.setPosition(h,c)}else
this.target.setPosition(u.x+h,u.y+c)}},reverse:function(){var
t=this._config,e=t[0].x,i=t[0].y,n=t[1].x,r=t[1].y,s=t[2].x,a=t[2].y,o=[cc.v2(n-
s,r-a),cc.v2(e-s,i-a),cc.v2(-s,-a)],l=new cc.BezierBy(this._duration,o);return
this._cloneDecoration(l),this._reverseEaseList(l),l}}),cc.bezierBy=function(t,e)
{return new
cc.BezierBy(t,e)},cc.BezierTo=cc.Class({name:"cc.BezierTo",extends:cc.BezierBy,ctor
:function(t,e)
{this._toConfig=[],e&&this.initWithDuration(t,e)},initWithDuration:function(t,e)
{return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toConfig=e,!
0)},clone:function(){var t=new cc.BezierTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toConfig),t},start
WithTarget:function(t){cc.BezierBy.prototype.startWithTarget.call(this,t);var
e=this._startPosition,i=this._toConfig,n=this._config;n[0]=i[0].sub(e),n[1]=i[1].su
b(e),n[2]=i[2].sub(e)}}),cc.bezierTo=function(t,e){return new
cc.BezierTo(t,e)},cc.ScaleTo=cc.Class({name:"cc.ScaleTo",extends:cc.ActionInterval,
ctor:function(t,e,i)
{this._scaleX=1,this._scaleY=1,this._startScaleX=1,this._startScaleY=1,this._endSca
leX=0,this._endScaleY=0,this._deltaX=0,this._deltaY=0,void 0!
==e&&cc.ScaleTo.prototype.initWithDuration.call(this,t,e,i)},initWithDuration:funct
ion(t,e,i){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._endScaleX=e,this.
_endScaleY=null!=i?i:e,!0)},clone:function(){var t=new cc.ScaleTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endScaleX,this._en
dScaleY),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startScaleX=t.scale
X,this._startScaleY=t.scaleY,this._deltaX=this._endScaleX-
this._startScaleX,this._deltaY=this._endScaleY-
this._startScaleY},update:function(t)
{t=this._computeEaseTime(t),this.target&&(this.target.scaleX=this._startScaleX+this
._deltaX*t,this.target.scaleY=this._startScaleY+this._deltaY*t)}}),cc.scaleTo=funct
ion(t,e,i){return new
cc.ScaleTo(t,e,i)},cc.ScaleBy=cc.Class({name:"cc.ScaleBy",extends:cc.ScaleTo,startW
ithTarget:function(t)
{cc.ScaleTo.prototype.startWithTarget.call(this,t),this._deltaX=this._startScaleX*t
his._endScaleX-this._startScaleX,this._deltaY=this._startScaleY*this._endScaleY-
this._startScaleY},reverse:function(){var t=new
cc.ScaleBy(this._duration,1/this._endScaleX,1/this._endScaleY);return
this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new
cc.ScaleBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._endScaleX,this._en
dScaleY),t}}),cc.scaleBy=function(t,e,i){return new
cc.ScaleBy(t,e,i)},cc.Blink=cc.Class({name:"cc.Blink",extends:cc.ActionInterval,cto
r:function(t,e){this._times=0,this._originalState=!1,void 0!
==e&&this.initWithDuration(t,e)},initWithDuration:function(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._times=e,!
0)},clone:function(){var t=new cc.Blink;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._times),t},update:f
unction(t){if(t=this._computeEaseTime(t),this.target&&!this.isDone()){var
e=1/this._times,i=t%e;this.target.opacity=i>e/2?255:0}},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._originalState=t.opa
city},stop:function()
{this.target.opacity=this._originalState,cc.ActionInterval.prototype.stop.call(this
)},reverse:function(){var t=new cc.Blink(this._duration,this._times);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.blink=function(t,e)
{return new
cc.Blink(t,e)},cc.FadeTo=cc.Class({name:"cc.FadeTo",extends:cc.ActionInterval,ctor:
function(t,e){this._toOpacity=0,this._fromOpacity=0,void 0!
==e&&cc.FadeTo.prototype.initWithDuration.call(this,t,e)},initWithDuration:function
(t,e){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._toOpacity=e,!
0)},clone:function(){var t=new cc.FadeTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},upda
te:function(t){t=this._computeEaseTime(t);var e=void 0!==this._fromOpacity?
this._fromOpacity:255;this.target.opacity=e+(this._toOpacity-
e)*t},startWithTarget:function
(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._fromOpacity=t.opaci
ty}}),cc.fadeTo=function(t,e){return new
cc.FadeTo(t,e)},cc.FadeIn=cc.Class({name:"cc.FadeIn",extends:cc.FadeTo,ctor:functio
n(t)
{null==t&&(t=0),this._reverseAction=null,this.initWithDuration(t,255)},reverse:func
tion(){var t=new cc.FadeOut;return
t.initWithDuration(this._duration,0),this._cloneDecoration(t),this._reverseEaseList
(t),t},clone:function(){var t=new cc.FadeIn;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t},star
tWithTarget:function(t)
{this._reverseAction&&(this._toOpacity=this._reverseAction._fromOpacity),cc.FadeTo.
prototype.startWithTarget.call(this,t)}}),cc.fadeIn=function(t){return new
cc.FadeIn(t)},cc.FadeOut=cc.Class({name:"cc.FadeOut",extends:cc.FadeTo,ctor:functio
n(t)
{null==t&&(t=0),this._reverseAction=null,this.initWithDuration(t,0)},reverse:functi
on(){var t=new cc.FadeIn;return
t._reverseAction=this,t.initWithDuration(this._duration,255),this._cloneDecoration(
t),this._reverseEaseList(t),t},clone:function(){var t=new cc.FadeOut;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._toOpacity),t}}),cc
.fadeOut=function(t){return new
cc.FadeOut(t)},cc.TintTo=cc.Class({name:"cc.TintTo",extends:cc.ActionInterval,ctor:
function(t,e,i,n){this._to=cc.color(0,0,0),this._from=cc.color(0,0,0),e instanceof
cc.Color&&(n=e.b,i=e.g,e=e.r),void 0!
==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._to=cc.color(e,i,n
),!0)},clone:function(){var t=new cc.TintTo;this._cloneDecoration(t);var
e=this._to;return
t.initWithDuration(this._duration,e.r,e.g,e.b),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._from=this.target.co
lor},update:function(t){t=this._computeEaseTime(t);var
e=this._from,i=this._to;e&&(this.target.color=cc.color(e.r+(i.r-e.r)*t,e.g+(i.g-
e.g)*t,e.b+(i.b-e.b)*t))}}),cc.tintTo=function(t,e,i,n){return new
cc.TintTo(t,e,i,n)},cc.TintBy=cc.Class({name:"cc.TintBy",extends:cc.ActionInterval,
ctor:function(t,e,i,n)
{this._deltaR=0,this._deltaG=0,this._deltaB=0,this._fromR=0,this._fromG=0,this._fro
mB=0,void 0!==n&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n)
{return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(this._deltaR=e,this._de
ltaG=i,this._deltaB=n,!0)},clone:function(){var t=new cc.TintBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._deltaR,this._delta
G,this._deltaB),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var
e=t.color;this._fromR=e.r,this._fromG=e.g,this._fromB=e.b},update:function(t)
{t=this._computeEaseTime(t),this.target.color=cc.color(this._fromR+this._deltaR*t,t
his._fromG+this._deltaG*t,this._fromB+this._deltaB*t)},reverse:function(){var t=new
cc.TintBy(this._duration,-this._deltaR,-this._deltaG,-this._deltaB);return
this._cloneDecoration(t),this._reverseEaseList(t),t}}),cc.tintBy=function(t,e,i,n)
{return new
cc.TintBy(t,e,i,n)},cc.DelayTime=cc.Class({name:"cc.DelayTime",extends:cc.ActionInt
erval,update:function(t){},reverse:function(){var t=new
cc.DelayTime(this._duration);return
this._cloneDecoration(t),this._reverseEaseList(t),t},clone:function(){var t=new
cc.DelayTime;return
this._cloneDecoration(t),t.initWithDuration(this._duration),t}}),cc.delayTime=funct
ion(t){return new
cc.DelayTime(t)},cc.ReverseTime=cc.Class({name:"cc.ReverseTime",extends:cc.ActionIn
terval,ctor:function(t)
{this._other=null,t&&this.initWithAction(t)},initWithAction:function(t){return t?
t===this._other?(cc.errorID(1029),!1):!!
cc.ActionInterval.prototype.initWithDuration.call(this,t._duration)&&(this._other=t
,!0):(cc.errorID(1028),!1)},clone:function(){var t=new cc.ReverseTime;return
this._cloneDecoration(t),t.initWithAction(this._other.clone()),t},startWithTarget:f
unction(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._other.startWithTarg
et(t)},update:function(t)
{t=this._computeEaseTime(t),this._other&&this._other.update(1-
t)},reverse:function(){return this._other.clone()},stop:function()
{this._other.stop(),cc.Action.prototype.stop.call(this)}}),cc.reverseTime=function(
t){return new
cc.ReverseTime(t)},cc.TargetedAction=cc.Class({name:"cc.TargetedAction",extends:cc.
ActionInterval,ctor:function(t,e)
{this._action=null,this._forcedTarget=null,e&&this.initWithTarget(t,e)},initWithTar
get:function(t,e){return!!
this.initWithDuration(e._duration)&&(this._forcedTarget=t,this._action=e,!
0)},clone:function(){var t=new cc.TargetedAction;return
this._cloneDecoration(t),t.initWithTarget(this._forcedTarget,this._action.clone()),
t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._action.startWithTar
get(this._forcedTarget)},stop:function(){this._action.stop()},update:function(t)
{t=this._computeEaseTime(t),this._action.update(t)},getForcedTarget:function()
{return this._forcedTarget},setForcedTarget:function(t){this._forcedTarget!
==t&&(this._forcedTarget=t)}}),cc.targetedAction=function(t,e){return new
cc.TargetedAction(t,e)}}),{}],6:[(function(t,e,i){"use
strict";t("../core/platform/CCClass");var n=t("../core/platform/js"),r=function()
{this.actions=[],this.target=null,this.actionIndex=0,this.currentAction=null,this.p
aused=!1,this.lock=!1};cc.ActionManager=function(){this._hashTargets=n.createMap(!
0),this._arrayTargets=[],this._currentTarget=null,cc.director._scheduler&&cc.direct
or._scheduler.enableForTarget(this)},cc.ActionManager.prototype={constructor:cc.Act
ionManager,_elementPool:[],_searchElementByTarget:function(t,e){for(var
i=0;i<t.length;i++)if(e===t[i].target)return t[i];return
null},_getElement:function(t,e){var i=this._elementPool.pop();return i||(i=new
r),i.target=t,i.paused=!!e,i},_putElement:function(t)
{t.actions.length=0,t.actionIndex=0,t.currentAction=null,t.paused=!
1,t.target=null,t.lock=!1,this._elementPool.push(t)},addAction:function(t,e,i)
{if(t&&e){var n=this._hashTargets[e._id];n?n.actions||(n.actions=[]):
(n=this._getElement(e,i),this._hashTargets[e._id]=n,this._arrayTargets.push(n)),n.a
ctions.push(t),t.startWithTarget(e)}else
cc.errorID(1e3)},removeAllActions:function(){for(var
t=this._arrayTargets,e=0;e<t.length;e++){var
i=t[e];i&&this._putElement(i)}this._arrayTargets.length=0,this._hashTargets=n.creat
eMap(!0)},removeAllActionsFromTarget:function(t,e){if(null!=t){var
i=this._hashTargets[t._id];i&&(i.actions.length=0,this._deleteHashElement(i))}},rem
oveAction:function(t){if(null!=t){var
e=t.getOriginalTarget(),i=this._hashTargets[e._id];if(i){for(var
n=0;n<i.actions.length;n++)if(i.actions[n]===t)
{i.actions.splice(n,1),i.actionIndex>=n&&i.actionIndex--;break}}else
cc.logID(1001)}},removeActionByTag:function(t,e)
{t===cc.Action.TAG_INVALID&&cc.logID(1002),cc.assertID(e,1003);var
i=this._hashTargets[e._id];if(i)for(var n=i.actions.length,r=0;r<n;++r){var
s=i.actions[r];if(s&&s.getTag()===t&&s.getOriginalTarget()===e)
{this._removeActionAtIndex(r,i);break}}},getActionByTag:function(t,e)
{t===cc.Action.TAG_INVALID&&cc.logID(1004);var i=this._hashTargets[e._id];if(i)
{if(null!=i.actions)for(var n=0;n<i.actions.length;++n){var
r=i.actions[n];if(r&&r.getTag()===t)return r}cc.logID(1005,t)}return
null},getNumberOfRunningActionsInTarget:function(t){var
e=this._hashTargets[t._id];return e&&e.actions?
e.actions.length:0},pauseTarget:function(t){var
e=this._hashTargets[t._id];e&&(e.paused=!0)},resumeTarget:function(t){var
e=this._hashTargets[t._id];e&&(e.paused=!1)},pauseAllRunningActions:function()
{for(var t=[],e=this._arrayTargets,i=0;i<e.length;i++){var n=e[i];n&&!
n.paused&&(n.paused=!0,t.push(n.target))}return t},resumeTargets:function(t)
{if(t)for(var e=0;e<t.length;e+
+)t[e]&&this.resumeTarget(t[e])},pauseTargets:function(t){if(t)for(var
e=0;e<t.length;e++)t[e]&&this.pauseTarget(t[e])},purgeSharedManager:function()
{cc.director.getScheduler().unscheduleUpdate(this)},_removeActionAtIndex:function(t
,e)
{e.actions[t];e.actions.splice(t,1),e.actionIndex>=t&&e.actionIndex--,0===e.actions
.length&&this._deleteHashElement(e)},_deleteHashElement:function(t){var e=!
1;if(t&&!t.lock&&this._hashTargets[t.target._id]){delete
this._hashTargets[t.target._id];for(var i=this._arrayTargets,n=0,r=i.length;n<r;n+
+)if(i[n]===t){i.splice(n,1);break}this._putElement(t),e=!0}return
e},update:function(t){for(var e,i=this._arrayTargets,n=0;n<i.length;n++)
{if(this._currentTarget=i[n],!(e=this._currentTarget).paused&&e.actions)
{for(e.lock=!0,e.actionIndex=0;e.actionIndex<e.actions.length;e.actionIndex+
+)if(e.currentAction=e.actions[e.actionIndex],e.currentAction)
{if(e.currentAction.step(t*(e.currentAction._speedMethod?
e.currentAction._speed:1)),e.currentAction&&e.currentAction.isDone())
{e.currentAction.stop();var
r=e.currentAction;e.currentAction=null,this.removeAction(r)}e.currentAction=null}e.
lock=!1}0===e.actions.length&&this._deleteHashElement(e)&&n--}}}}),
{"../core/platform/CCClass":200,"../core/platform/js":220}],7:[(function(t,e,i)
{"use
strict";t("./CCActionManager"),t("./CCAction"),t("./CCActionInterval"),t("./CCActio
nInstant"),t("./CCActionEase"),t("./CCActionCatmullRom"),t("./tween")}),
{"./CCAction":1,"./CCActionCatmullRom":2,"./CCActionEase":3,"./CCActionInstant":4,"
./CCActionInterval":5,"./CCActionManager":6,"./tween":8}],8:[(function(t,e,i){"use
strict";var
n=cc.Class({name:"cc.TweenAction",extends:cc.ActionInterval,ctor:function(t,e,i)
{this._opts=i=i||
Object.create(null),this._props=Object.create(null),i.progress=i.progress||
this.progress,i.easing&&"string"==typeof
i.easing&&(i.easing=cc.easing[i.easing]);var n=this._opts.relative;for(var r in e)
{var s=e[r],a=void 0,o=void 0;if(s.value&&(s.easing||
s.progress)&&(a="string"==typeof s.easing?
cc.easing[s.easing]:s.easing,o=s.progress,s=s.value),"number"==typeof s||s.lerp&&(!
n||s.add||s.mul)&&s.clone){var
l=Object.create(null);l.value=s,l.easing=a,l.progress=o,this._props[r]=l}else
cc.warn("Can not animate "+r+" property, because it do not have [lerp, (add|mul),
clone] function.")}this._originProps=e,this.initWithDuration(t)},clone:function()
{var t=new n(this._duration,this._originProps,this._opts);return
this._cloneDecoration(t),t},startWithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t);var e=!!
this._opts.relative,i=this._props;for(var n in i){var
r=t[n],s=i[n];"number"==typeof r?(s.start=r,s.current=r,s.end=e?r+s.value:s.value):
(s.start=r.clone(),s.current=r.clone(),s.end=e?(r.add||
r.mul).call(r,s.value):s.value)}},update:function(t){var
e=this._opts,i=t;e.easing&&(i=e.easing(t));var n=this.target;if(n){var
r=this._props,s=this._opts.progress;for(var a in r){var o=r[a],l=o.easing?
o.easing(t):i,h=o.current=(o.progress||s)
(o.start,o.end,o.current,l);n[a]=h}}},progress:function(t,e,i,n)
{return"number"==typeof t?i=t+(e-
t)*n:t.lerp(e,n,i),i}}),r=cc.Class({name:"cc.SetAction",extends:cc.ActionInstant,ct
or:function(t){this._props={},void 0!==t&&this.init(t)},init:function(t){for(var e
in t)this._props[e]=t[e];return!0},update:function(){var
t=this._props,e=this.target;for(var i in t)e[i]=t[i]},clone:function(){var t=new
r;return t.init(this._props),t}});function s(t)
{this._actions=[],this._finalAction=null,this._target=t}s.prototype.then=function(t
){return t instanceof cc.Action?
this._actions.push(t.clone()):this._actions.push(t._union()),this},s.prototype.targ
et=function(t){return this._target=t,this},s.prototype.start=function(){return
this._target?
(this._finalAction&&cc.director.getActionManager().removeAction(this._finalAction),
this._finalAction=this._union(),cc.director.getActionManager().addAction(this._fina
lAction,this._target,!1),this):(cc.warn("Please set target to tween
first"),this)},s.prototype.stop=function(){return
this._finalAction&&cc.director.getActionManager().removeAction(this._finalAction),t
his},s.prototype.clone=function(t){var e=this._union();return
cc.tween(t).then(e.clone())},s.prototype.union=function(){var
t=this._union();return
this._actions.length=0,this._actions.push(t),this},s.prototype._union=function()
{var t=this._actions;return t=1===t.length?t[0]:cc.sequence(t)};var a=[];function
o(t){return function(){a.length=0;for(var e=arguments.length,i=0;i<e;i++){var
n=a[i]=arguments[i];n instanceof s&&(a[i]=n._union())}return
t.apply(this,a)}}for(var l={to:function(t,e,i){return(i=i||
Object.create(null)).relative=!1,new n(t,e,i)},by:function(t,e,i){return(i=i||
Object.create(null)).relative=!0,new n(t,e,i)},set:function(t){return new
r(t)},delay:cc.delayTime,call:cc.callFunc,hide:cc.hide,show:cc.show,removeSelf:cc.r
emoveSelf,sequence:o(cc.sequence),parallel:o(cc.spawn)},h={repeat:cc.repeat,repeatF
orever:cc.repeatForever,reverseTime:cc.reverseTime},c=Object.keys(l),u=function(t)
{var e=c[t];s.prototype[e]=function(){var t=l[e].apply(l,arguments);return
this._actions.push(t),this}},_=0;_<c.length;_++)u(_);c=Object.keys(h);var
f=function(t){var e=c[t];s.prototype[e]=function(){var
t=this._actions,i=arguments[arguments.length-1],n=arguments.length-1;i instanceof
cc.Tween?i=i._union():i instanceof cc.Action||(i=t[t.length-1],t.length-
=1,n+=1);for(var r=[i],s=0;s<n;s++)r.push(arguments[s]);return
i=h[e].apply(this,r),t.push(i),this}};for(_=0;_<c.length;_+
+)f(_);cc.tween=function(t){return new s(t)},cc.Tween=s}),{}],9:[(function(t,e,i)
{"use strict";var n=cc.js,r=t("./playable"),s=t("./animation-
curves"),a=s.EventAnimCurve,o=s.EventInfo,l=t("./types").WrapModeMask,h=t("../core/
utils/binary-search").binarySearchEpsilon;function c(t,e)
{r.call(this),this.target=t,this.animation=e,this._anims=new
n.array.MutableForwardIterator([])}n.extend(c,r);var u=c.prototype;function _(t,e)
{var
i=e.clip;e.duration=i.duration,e.speed=i.speed,e.wrapMode=i.wrapMode,e.frameRate=i.
sample,(e.wrapMode&l.Loop)===l.Loop?e.repeatCount=1/0:e.repeatCount=1;var
n=e.curves=i.createCurves(e,t),r=i.events;if(r)for(var s=void
0,c=0,u=r.length;c<u;c++){s||((s=new a).target=t,n.push(s));var
_=r[c],f=_.frame/e.duration,d=void 0,m=h(s.ratios,f);m>=0?d=s.events[m]:(d=new
o,s.ratios.push(f),s.events.push(d)),d.add(_.func,_.params)}}u.playState=function(t
,e){t.clip&&(t.curveLoaded||
_(this.target,t),t.animator=this,t.play(),"number"==typeof
e&&t.setTime(e),this.play())},u.stopStatesExcept=function(t){var
e=this._anims,i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];n!
==t&&this.stopState(n)}},u.addAnimation=function(t){-
1===this._anims.array.indexOf(t)&&this._anims.push(t),t._setEventTarget(this.animat
ion)},u.removeAnimation=function(t){var e=this._anims.array.indexOf(t);e>=0?
(this._anims.fastRemoveAt(e),0===this._anims.array.length&&this.stop()):cc.errorID(
3908),t.animator=null},u.sample=function(){var
t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)
{e[t.i].sample()}},u.stopState=function(t){t&&t.stop()},u.pauseState=function(t)
{t&&t.pause()},u.resumeState=function(t)
{t&&t.resume(),this.isPaused&&this.resume()},u.setStateTime=function(t,e){if(void
0!==e)t&&(t.setTime(e),t.sample());else{e=t;for(var
i=this._anims.array,n=0;n<i.length;++n){var
r=i[n];r.setTime(e),r.sample()}}},u.onStop=function(){var
t=this._anims,e=t.array;for(t.i=0;t.i<e.length;++t.i)
{e[t.i].stop()}},u.onPause=function(){for(var t=this._anims.array,e=0;e<t.length;+
+e){var i=t[e];i.pause(),i.animator=null}},u.onResume=function(){for(var
t=this._anims.array,e=0;e<t.length;++e){var
i=t[e];i.animator=this,i.resume()}},u._reloadClip=function(t)
{_(this.target,t)},e.exports=c}),{"../core/utils/binary-search":287,"./animation-
curves":11,"./playable":18,"./types":19}],10:[(function(t,e,i){"use strict";var
n=t("./types").WrapMode,r=t("./animation-
curves"),s=r.DynamicAnimCurve,a=r.quickFindIndex,o=t("./motion-path-
helper").sampleMotionPaths,l=t("../core/utils/binary-
search").binarySearchEpsilon,h=cc.Class({name:"cc.AnimationClip",extends:cc.Asset,p
roperties:{_duration:{default:0,type:"Float"},duration:{get:function(){return
this._duration}},sample:{default:60},speed:{default:1},wrapMode:
{default:n.Normal},curveData:{default:{},visible:!1},events:{default:[],visible:!
1}},statics:{createWithSpriteFrames:function(t,e){if(!Array.isArray(t))return
cc.errorID(3905),null;var i=new h;i.sample=e||
i.sample,i._duration=t.length/i.sample;for(var
n=[],r=1/i.sample,s=0,a=t.length;s<a;s++)n[s]={frame:s*r,value:t[s]};return
i.curveData={comps:{"cc.Sprite":{spriteFrame:n}}},i}},onLoad:function()
{this._duration=Number.parseFloat(this.duration),this.speed=Number.parseFloat(this.
speed),this.wrapMode=Number.parseInt(this.wrapMode),this.frameRate=Number.parseFloa
t(this.sample)},createPropCurve:function(t,e,i){var n=[],r=t instanceof
cc.Node&&"position"===e,h=new s;h.target=t,h.prop=e;for(var c=0,u=i.length;c<u;c++)
{var _=i[c],f=_.frame/this.duration;h.ratios.push(f),r&&n.push(_.motionPath);var
d=_.value;h.values.push(d);var m=_.curve;if(m){if("string"==typeof m)
{h.types.push(m);continue}if(Array.isArray(m)){m[0]===m[1]&&m[2]===m[3]?
h.types.push(s.Linear):h.types.push(s.Bezier(m));continue}}h.types.push(s.Linear)}r
&&o(n,h,this.duration,this.sample,t);for(var p=h.ratios,v=void 0,y=void 0,g=!
0,x=1,b=p.length;x<b;x++)if(v=p[x]-p[x-1],1===x)y=v;else if(Math.abs(v-y)>1e-6){g=!
1;break}h._findFrameIndex=g?a:l;var A=h.values[0];return h._lerp||void 0===A||
("number"==typeof A?h._lerp=s.prototype._lerpNumber:A instanceof cc.Quat?
h._lerp=s.prototype._lerpQuat:A instanceof cc.Vec2||A instanceof cc.Vec3?
h._lerp=s.prototype._lerpVector:A.lerp&&(h._lerp=s.prototype._lerpObject)),h},creat
eTargetCurves:function(t,e,i){var n=e.props,r=e.comps;if(n)for(var s in n){var
a=n[s],o=this.createPropCurve(t,s,a);i.push(o)}if(r)for(var l in r){var
h=t.getComponent(l);if(h){var c=r[l];for(var u in c){var
_=c[u],f=this.createPropCurve(h,u,_);i.push(f)}}}},createCurves:function(t,e){var
i=this.curveData,n=i.paths,r=[];for(var s in this.createTargetCurves(e,i,r),n){var
a=cc.find(s,e);if(a){var o=n[s];this.createTargetCurves(a,o,r)}}return
r}});cc.AnimationClip=e.exports=h}),{"../core/utils/binary-
search":287,"./animation-curves":11,"./motion-path-helper":17,"./types":19}],11:
[(function(t,e,i){"use strict";var
n=t("./bezier").bezierByTime,r=t("../core/utils/binary-
search").binarySearchEpsilon,s=t("./types").WrapModeMask,a=t("./types").WrappedInfo
;function o(t,e){if("string"==typeof e){var i=cc.easing[e];i?
t=i(t):cc.errorID(3906,e)}else Array.isArray(e)&&(t=n(e,t));return t}var
l=cc.Class({name:"cc.AnimCurve",sample:function(t,e,i){},onTimeChangedManually:void
0});function h(t,e){var i=t.length-1;if(0===i)return 0;var n=t[0];if(e<n)return
0;var r=t[i];if(e>r)return i;var s=(e=(e-n)/(r-n))/(1/i),a=0|s;return s-a<1e-6?
a:a+1-s<1e-6?a+1:~(a+1)}var
c=cc.Class({name:"cc.DynamicAnimCurve",extends:l,properties:
{target:null,prop:"",values:[],ratios:[],types:[]},_findFrameIndex:r,_lerp:void
0,_lerpNumber:function(t,e,i){return t+(e-t)*i},_lerpObject:function(t,e,i){return
t.lerp(e,i)},_lerpQuat:(function(){var t=cc.quat();return function(e,i,n){return
e.lerp(i,n,t)}})(),_lerpVector:(function(){var t=cc.v3();return function(e,i,n)
{return e.lerp(i,n,t)}})(),sample:function(t,e,i){var
n=this.values,r=this.ratios,s=r.length;if(0!==s){var
a,l=this._findFrameIndex(r,e);if(l<0)if((l=~l)<=0)a=n[0];else if(l>=s)a=n[s-
1];else{var h=n[l-1];if(this._lerp){var
c=r[l-1],u=r[l],_=this.types[l-1],f=(e-c)/(u-c);_&&(f=o(f,_));var
d=n[l];a=this._lerp(h,d,f)}else a=h}else
a=n[l];this.target[this.prop]=a}}});c.Linear=null,c.Bezier=function(t){return
t};var u=function(){this.events=[]};u.prototype.add=function(t,e)
{this.events.push({func:t||"",params:e||[]})};var
_=cc.Class({name:"cc.EventAnimCurve",extends:l,properties:{target:null,ratios:
[],events:[],_wrappedInfo:{default:function(){return new
a}},_lastWrappedInfo:null,_ignoreIndex:NaN},_wrapIterations:function(t){return t-
(0|t)==0&&(t-=1),0|t},sample:function(t,e,i){var
n=this.ratios.length,o=i.getWrappedInfo(i.time,this._wrappedInfo),l=o.direction,h=r
(this.ratios,o.ratio);if(h<0&&(h=~h-1,l<0&&(h+=1)),this._ignoreIndex!
==h&&(this._ignoreIndex=NaN),o.frameIn
dex=h,!this._lastWrappedInfo)return
this._fireEvent(h),void(this._lastWrappedInfo=new a(o));var
c=i.wrapMode,u=this._wrapIterations(o.iterations),_=this._lastWrappedInfo,f=this._w
rapIterations(_.iterations),d=_.frameIndex,m=_.direction,p=-1!==f&&u!
==f;if(d===h&&p&&1===n)this._fireEvent(0);else if(d!==h||p){l=m;do{if(d!==h){if(-
1===l&&0===d&&h>0?((c&s.PingPong)===s.PingPong?l*=-1:d=n,f++):1===l&&d===n-1&&h<n-
1&&((c&s.PingPong)===s.PingPong?l*=-1:d=-1,f+
+),d===h)break;if(f>u)break}d+=l,cc.director.getAnimationManager().pushDelayEvent(t
his,"_fireEvent",[d])}while(d!==h&&d>-
1&&d<n)}this._lastWrappedInfo.set(o)},_fireEvent:function(t){if(!(t<0||
t>=this.events.length||this._ignoreIndex===t)){var
e=this.events[t].events;if(this.target.isValid)for(var
i=this.target._components,n=0;n<e.length;n++)for(var
r=e[n],s=r.func,a=0;a<i.length;a++){var
o=i[a],l=o[s];l&&l.apply(o,r.params)}}},onTimeChangedManually:function(t,e)
{this._lastWrappedInfo=null,this._ignoreIndex=NaN;var
i=e.getWrappedInfo(t,this._wrappedInfo),n=i.direction,s=r(this.ratios,i.ratio);s<0&
&(s=~s-
1,n<0&&(s+=1),this._ignoreIndex=s)}});e.exports={AnimCurve:l,DynamicAnimCurve:c,Eve
ntAnimCurve:_,EventInfo:u,computeRatioByType:o,quickFindIndex:h}}),
{"../core/utils/binary-search":287,"./bezier":14,"./types":19}],12:
[(function(t,e,i){"use strict";var n=cc.js,r=cc.Class({ctor:function()
{this._anims=new
n.array.MutableForwardIterator([]),this._delayEvents=[],cc.director._scheduler&&cc.
director._scheduler.enableForTarget(this)},update:function(t){var
e=this._anims,i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];n._isPlaying&&!
n._isPaused&&n.update(t)}for(var r=this._delayEvents,s=0,a=r.length;s<a;s++){var
o=r[s];o.target[o.func].apply(o.target,o.args)}r.length=0},destruct:function()
{},addAnimation:function(t){-
1===this._anims.array.indexOf(t)&&this._anims.push(t)},removeAnimation:function(t)
{var e=this._anims.array.indexOf(t);e>=0?
this._anims.fastRemoveAt(e):cc.errorID(3907)},pushDelayEvent:function(t,e,i)
{this._delayEvents.push({target:t,func:e,args:i})}});cc.AnimationManager=e.exports=
r}),{}],13:[(function(t,e,i){"use strict";var
n=cc.js,r=t("./playable"),s=t("./types"),a=s.WrappedInfo,o=s.WrapMode,l=s.WrapModeM
ask;function h(t,e){r.call(this),this._currentFramePlayed=!
1,this._delay=0,this._delayTime=0,this._wrappedInfo=new
a,this._lastWrappedInfo=null,this._process=u,this._clip=t,this._name=e||
t&&t.name,this.animator=null,this.curves=[],this.delay=0,this.repeatCount=1,this.du
ration=1,this.speed=1,this.wrapMode=o.Normal,this.time=0,this._target=null,this._la
stframeEventOn=!1,this.emit=function(){for(var t=new
Array(arguments.length),e=0,i=t.length;e<i;e+
+)t[e]=arguments[e];cc.director.getAnimationManager().pushDelayEvent(this,"_emit",t
)}}n.extend(h,r);var c=h.prototype;function u(){var
t,e=this.sample();this._lastframeEventOn&&(t=this._lastWrappedInfo?
this._lastWrappedInfo:this._lastWrappedInfo=new a(e),this.repeatCount>1&&(0|
e.iterations)>(0|
t.iterations)&&this.emit("lastframe",this),t.set(e));e.stopped&&(this.stop(),this.e
mit("finished",this))}function _(){var t=this.time,e=this.duration;t>e?0===(t
%=e)&&(t=e):t<0&&0!==(t%=e)&&(t+=e);for(var
i=t/e,n=this.curves,r=0,s=n.length;r<s;r++)
{n[r].sample(t,i,this)}this._lastframeEventOn&&(void
0===this._lastIterations&&(this._lastIterations=i),
(this.time>0&&this._lastIterations>i||
this.time<0&&this._lastIterations<i)&&this.emit("lastframe",this),this._lastIterati
ons=i)}c._emit=function(t,e)
{this._target&&this._target.isValid&&this._target.emit(t,t,e)},c.on=function(t,e,i)
{return this._target&&this._target.isValid?
("lastframe"===t&&(this._lastframeEventOn=!
0),this._target.on(t,e,i)):null},c.once=function(t,e,i)
{if(this._target&&this._target.isValid){"lastframe"===t&&(this._lastframeEventOn=!
0);var n=this;return this._target.once(t,(function(t)
{e.call(i,t),n._lastframeEventOn=!1}))}return null},c.off=function(t,e,i)
{this._target&&this._target.isValid&&("lastframe"===t&&(this._target.hasEventListen
er(t)||(this._lastframeEventOn=!
1)),this._target.off(t,e,i))},c._setEventTarget=function(t)
{this._target=t},c.onPlay=function()
{this.setTime(0),this._delayTime=this._delay,cc.director.getAnimationManager().addA
nimation(this),this.animator&&this.animator.addAnimation(this),this.emit("play",thi
s)},c.onStop=function(){this.isPaused||
cc.director.getAnimationManager().removeAnimation(this),this.animator&&this.animato
r.removeAnimation(this),this.emit("stop",this)},c.onResume=function()
{cc.director.getAnimationManager().addAnimation(this),this.emit("resume",this)},c.o
nPause=function()
{cc.director.getAnimationManager().removeAnimation(this),this.emit("pause",this)},c
.setTime=function(t){this._currentFramePlayed=!1,this.time=t||0;for(var
e=this.curves,i=0,n=e.length;i<n;i++){var
r=e[i];r.onTimeChangedManually&&r.onTimeChangedManually(t,this)}},c.update=function
(t){this._delayTime>0&&(this._delayTime-=t,this._delayTime>0)||
(this._currentFramePlayed?this.time+=t*this.speed:this._currentFramePlayed=!
0,this._process())},c._needRevers=function(t){var e=this.wrapMode,i=!1;
(e&l.PingPong)===l.PingPong&&(t-(0|t)==0&&t>0&&(t-=1),1&t&&(i=!
i));return(e&l.Reverse)===l.Reverse&&(i=!i),i},c.getWrappedInfo=function(t,e){e=e||
new a;var i=!1,n=this.duration,r=this.repeatCount,s=t>0?t/n:-t/n;if(s>=r){s=r,i=!
0;var o=r-(0|r);0===o&&(o=1),t=o*n*(t>0?1:-1)}if(t>n){var h=t%n;t=0===h?n:h}else
t<0&&0!==(t%=n)&&(t+=n);var c=!
1,u=this._wrapMode&l.ShouldWrap;u&&(c=this._needRevers(s));var _=c?-1:1;return
this.speed<0&&(_*=-1),u&&c&&(t=n-
t),e.ratio=t/n,e.time=t,e.direction=_,e.stopped=i,e.iterations=s,e},c.sample=functi
on(){for(var
t=this.getWrappedInfo(this.time,this._wrappedInfo),e=this.curves,i=0,n=e.length;i<n
;i++){e[i].sample(t.time,t.ratio,this)}return t},n.get(c,"clip",(function(){return
this._clip})),n.get(c,"name",(function(){return
this._name})),n.obsolete(c,"AnimationState.length","duration"),n.getset(c,"curveLoa
ded",(function(){return this.curves.length>0}),(function()
{this.curves.length=0})),n.getset(c,"wrapMode",(function(){return this._wrapMode}),
(function(t){this._wrapMode=t,this.time=0,t&l.Loop?
this.repeatCount=1/0:this.repeatCount=1})),n.getset(c,"repeatCount",(function()
{return this._repeatCount}),(function(t){this._repeatCount=t;var
e=this._wrapMode&l.ShouldWrap,i=(this.wrapMode&l.Reverse)===l.Reverse;this._process
=t!==1/0||e||i?u:_})),n.getset(c,"delay",(function(){return this._delay}),
(function(t){this._delayTime=this._delay=t})),cc.AnimationState=e.exports=h}),
{"./playable":18,"./types":19}],14:[(function(t,e,i){"use strict";function
n(t,e,i,n,r){var s=1-r;return t*s*s*s+3*e*s*s*r+3*i*s*r*r+n*r*r*r}var
r=Math.cos,s=Math.acos,a=Math.max,o=2*Math.PI,l=Math.sqrt;function h(t){return
t<0?-Math.pow(-t,1/3):Math.pow(t,1/3)}function c(t,e){var i,n,c,u,_=e-0,f=e-
t[0],d=3*_,m=3*f,p=3*(e-t[2]),v=1/(-_+m-p+(e-1)),y=(d-6*f+p)*v,g=y*(1/3),x=(-
d+m)*v,b=1/3*(3*x-y*y),A=b*(1/3),C=(2*y*y*y-
9*y*x+27*(_*v))/27,S=C/2,T=S*S+A*A*A;if(T<0){var
w=1/3*-b,E=l(w*w*w),M=-C/(2*E),D=s(M<-1?-1:M>1?1:M),B=2*h(E);return n=B*r(D*(1/3))-
g,c=B*r((D+o)*(1/3))-g,u=B*r((D+2*o)*(1/3))-g,0<=n&&n<=1?0<=c&&c<=1?0<=u&&u<=1?
a(n,c,u):a(n,c):0<=u&&u<=1?a(n,u):n:0<=c&&c<=1?0<=u&&u<=1?
a(c,u):c:u}if(0===T)return c=-(i=S<0?h(-S):-h(S))-g,0<=(n=2*i-g)&&n<=1?0<=c&&c<=1?
a(n,c):n:c;var P=l(T);return n=(i=h(-S+P))-h(S+P)-g}function u(t,e){var
i=c(t,e),n=1-i;return
0*n*n*n+3*t[1]*i*n*n+3*t[3]*i*i*n+1*i*i*i}e.exports={bezier:n,bezierByTime:u}}),
{}],15:[(function(t,e,i){"use strict";var n={constant:function(){return
0},linear:function(t){return t},quadIn:function(t){return t*t},quadOut:function(t)
{return t*(2-t)},quadInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-
1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--
t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-
=2)*t*t+2)},quartIn:function(t){return t*t*t*t},quartOut:function(t){return 1-
--t*t*t*t},quartInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-
2)},quintIn:function(t){return t*t*t*t*t},quintOut:function(t){return--
t*t*t*t*t+1},quintInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-
=2)*t*t*t*t+2)},sineIn:function(t){return 1-
Math.cos(t*Math.PI/2)},sineOut:function(t){return
Math.sin(t*Math.PI/2)},sineInOut:function(t){return.5*(1-
Math.cos(Math.PI*t))},expoIn:function(t){return 0===t?0:Math.pow(1024,t-
1)},expoOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},expoInOut:function(t)
{return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-
1)))},circIn:function(t){return 1-Math.sqrt(1-t*t)},circOut:function(t){return
Math.sqrt(1- --t*t)},circInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-
1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?
0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-
=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return
0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-
10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return
0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?
i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-
=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return
t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)
+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-
=2)*t*((e+1)*t+e)+2)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?
7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-
=2.625/2.75)*t+.984375},smooth:function(t){return t<=0?0:t>=1?1:t*t*(3-
2*t)},fade:function(t){return t<=0?0:t>=1?1:t*t*t*(t*(6*t-15)+10)}};function r(t,e)
{return function(i){return i<.5?e(2*i)/2:t(2*i-
1)/2+.5}}n.quadOutIn=r(n.quadIn,n.quadOut),n.cubicOutIn=r(n.cubicIn,n.cubicOut),n.q
uartOutIn=r(n.quartIn,n.quartOut),n.quintOutIn=r(n.quintIn,n.quintOut),n.sineOutIn=
r(n.sineIn,n.sineOut),n.expoOutIn=r(n.expoIn,n.expoOut),n.circOutIn=r(n.cir
cIn,n.circOut),n.backOutIn=r(n.backIn,n.backOut),n.bounceIn=function(t){return 1-
n.bounceOut(1-t)},n.bounceInOut=function(t){return
t<.5?.5*n.bounceIn(2*t):.5*n.bounceOut(2*t-
1)+.5},n.bounceOutIn=r(n.bounceIn,n.bounceOut),cc.easing=e.exports=n}),{}],16:
[(function(t,e,i){"use
strict";t("./bezier"),t("./easing"),t("./types"),t("./motion-path-
helper"),t("./animation-curves"),t("./animation-clip"),t("./animation-
manager"),t("./animation-state"),t("./animation-animator")}),{"./animation-
animator":9,"./animation-clip":10,"./animation-curves":11,"./animation-
manager":12,"./animation-state":13,"./bezier":14,"./easing":15,"./motion-path-
helper":17,"./types":19}],17:[(function(t,e,i){"use strict";var n=t("./animation-
curves").DynamicAnimCurve,r=t("./animation-
curves").computeRatioByType,s=t("./bezier").bezier,a=t("../core/utils/binary-
search").binarySearchEpsilon,o=cc.v2;function l(t){this.points=t||
[],this.beziers=[],this.ratios=[],this.progresses=[],this.length=0,this.computeBezi
ers()}function h()
{this.start=o(),this.end=o(),this.startCtrlPoint=o(),this.endCtrlPoint=o()}function
c(t){if(!Array.isArray(t))return!1;for(var e=0,i=t.length;e<i;e++){var n=t[e];if(!
Array.isArray(n)||6!==n.length)return!1}return!0}function u(t,e,i,s,h){function
u(t){return t instanceof cc.Vec2?{in:t,pos:t,out:t}:Array.isArray(t)&&6===t.length?
{in:o(t[2],t[3]),pos:o(t[0],t[1]),out:o(t[4],t[5])}:
{in:cc.Vec2.ZERO,pos:cc.Vec2.ZERO,out:cc.Vec2.ZERO}}var
_=e.values=e.values.map((function(t){return Array.isArray(t)&&(t=2===t.length?
cc.v2(t[0],t[1]):cc.v3(t[0],t[1],t[2])),t}));if(0!==t.length&&0!==_.length){for(var
f=!1,d=0;d<t.length;d++){var m=t[d];if(m&&!c(m)&&(cc.errorID(3904,h?
h.name:"","position",d),m=null),m&&m.length>0){f=!0;break}}if(f&&1!==_.length)
{for(var
p=e.types,v=e.ratios,y=e.values=[],g=e.types=[],x=e.ratios=[],b=0,A=n.Linear,C=0,S=
t.length;C<S-1;C++){var T,w=t[C],E=v[C],M=v[C+1]-
E,D=_[C],B=_[C+1],P=p[C],I=[],R=b/M,O=1/(M*i*s);if(w&&w.length>0){var
L=[];L.push(u(D));for(var F=0,V=w.length;F<V;F++){var
N=u(w[F]);L.push(N)}L.push(u(B));var k=new l(L);k.computeBeziers();for(var
G=k.progresses;1-R>1e-6;){var z,U,j,W;if((T=r(T=R,P))<0)W=(0-
T)*(U=k.beziers[0]).getLength(),j=U.start.sub(U.endCtrlPoint).normalize(),z=U.start
.add(j.mul(W));else if(T>1)W=(T-1)*(U=k.beziers[k.beziers.length-
1]).getLength(),j=U.end.sub(U.startCtrlPoint).normalize(),z=U.end.add(j.mul(W));els
e{var H=a(G,T);H<0&&(H=~H),T-=H>0?G[H-
1]:0,T/=k.ratios[H],z=k.beziers[H].getPointAt(T)}I.push(z),R+=O}}else for(;1-R>1e-
6;)T=r(T=R,P),I.push(D.lerp(B,T)),R+=O;A="constant"===P?
P:n.Linear;for(F=0,V=I.length;F<V;F++){var X=E+b+O*F*M;q(I[F],A,X)}b=Math.abs(R-
1)>1e-6?(R-1)*M:0}v[v.length-1]!==x[x.length-1]&&q(_[_.length-1],A,v[v.length-
1])}}function q(t,e,i)
{y.push(t),g.push(e),x.push(i)}}l.prototype.computeBeziers=function(){var
t;this.beziers.length=0,this.ratios.length=0,this.progresses.length=0,this.length=0
;for(var e=1;e<this.points.length;e++){var i=this.points[e-1],n=this.points[e];
(t=new
h).start=i.pos,t.startCtrlPoint=i.out,t.end=n.pos,t.endCtrlPoint=n.in,this.beziers.
push(t),this.length+=t.getLength()}var r=0;for(e=0;e<this.beziers.length;e+
+)t=this.beziers[e],this.ratios[e]=t.getLength()/this.length,this.progresses[e]=r+=
this.ratios[e];return this.beziers},h.prototype.getPointAt=function(t){var
e=this.getUtoTmapping(t);return this.getPoint(e)},h.prototype.getPoint=function(t)
{var
e=s(this.start.x,this.startCtrlPoint.x,this.endCtrlPoint.x,this.end.x,t),i=s(this.s
tart.y,this.startCtrlPoint.y,this.endCtrlPoint.y,this.end.y,t);return new
o(e,i)},h.prototype.getLength=function(){var t=this.getLengths();return t[t.length-
1]},h.prototype.getLengths=function(t){if(t||(t=this.__arcLengthDivisions?
this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===
t+1)return this.cacheArcLengths;var
e,i,n=[],r=this.getPoint(0),s=o(),a=0;for(n.push(0),i=1;i<=t;i+
+)e=this.getPoint(i/t),s.x=r.x-e.x,s.y=r.y-e.y,a+=s.mag(),n.push(a),r=e;return
this.cacheArcLengths=n,n},h.prototype.getUtoTmapping=function(t,e){var
i,n=this.getLengths(),r=0,s=n.length;i=e||t*n[s-1];for(var a,o=0,l=s-
1;o<=l;)if((a=n[r=Math.floor(o+(l-o)/2)]-i)<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-
1}if(n[r=l]===i)return r/(s-1);var h=n[r];return(r+(i-h)/(n[r+1]-h))/(s-
1)},e.exports={sampleMotionPaths:u,Curve:l,Bezier:h}}),{"../core/utils/binary-
search":287,"./animation-curves":11,"./bezier":14}],18:[(function(t,e,i){"use
strict";var n=cc.js,r=t("../core/CCDebug");function s(){this._isPlaying=!
1,this._isPaused=!1,this._stepOnce=!1}var a=s.prototype;n.get(a,"isPlaying",
(function(){return this._isPlaying}),!0),n.get(a,"isPaused",(function(){return
this._isPaused}),!0);var o=function()
{};a.onPlay=o,a.onPause=o,a.onResume=o,a.onStop=o,a.onError=o,a.play=function()
{this._isPlaying?this._isPaused?(this._isPaused=!
1,this.onResume()):this.onError(r.getError(3912)):(this._isPlaying=!
0,this.onPlay())},a.stop=function(){this._isPlaying&&(this._isPlaying=!
1,this.onStop(),this._isPaused=!1)},a.pause=function(){this._isPlaying&&!
this._isPaused&&(this._isPaused=!0,this.onPause())},a.resume=function()
{this._isPlaying&&this._isPaused&&(this._isPaused=!
1,this.onResume())},a.step=function(){this.pause(),this._stepOnce=!
0,this._isPlaying||this.play()},e.exports=s}),{"../core/CCDebug":49}],19:
[(function(t,e,i){"use strict";var
n={Loop:2,ShouldWrap:4,PingPong:22,Reverse:36},r=cc.Enum({Default:0,Normal:1,Revers
e:n.Reverse,Loop:n.Loop,LoopReverse:n.Loop|
n.Reverse,PingPong:n.PingPong,PingPongReverse:n.PingPong|n.Reverse});function s(t)
{t?this.set(t):(this.ratio=0,this.time=0,this.direction=1,this.stopped=!
0,this.iterations=0,this.frameIndex=void
0)}cc.WrapMode=r,s.prototype.set=function(t)
{this.ratio=t.ratio,this.time=t.time,this.direction=t.direction,this.stopped=t.stop
ped,this.iterations=t.iterations,this.frameIndex=t.frameIndex},e.exports={WrapModeM
ask:n,WrapMode:r,WrappedInfo:s}}),{}],20:[(function(t,e,i){"use strict";var
n=t("../core/event/event-
target"),r=t("../core/platform/CCSys"),s=t("../core/assets/CCAudioClip").LoadMode,a
=!1,o=[],l=function t(e)
{n.call(this),this._src=e,this._element=null,this.id=0,this._volume=1,this._loop=!
1,this._nextTime=0,this._state=t.State.INITIALZING,this._onended=function()
{this._state=t.State.STOPPED,this.emit("ended")}.bind(this)};cc.js.extend(l,n),l.St
ate={ERROR:-1,INITIALZING:0,PLAYING:1,PAUSED:2,STOPPED:3},(function(t)
{t._bindEnded=function(t){t=t||this._onended;var e=this._element;this._src&&e
instanceof HTMLAudioElement?
e.addEventListener("ended",t):e.onended=t},t._unbindEnded=function(){var
t=this._element;t instanceof HTMLAudioElement?
t.removeEventListener("ended",this._onended):t&&(t.onended=null)},t._onLoaded=funct
ion(){var t=this._src._nativeAsset;t instanceof HTMLAudioElement?(this._element||
(this._element=document.createElement("audio")),this._element.src=t.src):this._elem
ent=new h(t,this),this.setVolume(this._volume),this.setLoop(this._loop),0!
==this._nextTime&&this.setCurrentTime(this._nextTime),this._state===l.State.PLAYING
?this.play():this._state=l.State.INITIALZING},t.play=function()
{this._state=l.State.PLAYING,this._element&&(this._bindEnded(),this._element.play()
,this._src&&this._src.loadMode===s.DOM_AUDIO&&this._element.paused&&o.push({instanc
e:this,offset:0,audio:this._element}),a||(a=!
0,cc.game.canvas.addEventListener("touchstart",(function(){for(var t=void
0;t=o.pop();)t.audio.play(t.offset)}))))},t.destroy=function()
{this._element=null},t.pause=function()
{this._element&&this._state===l.State.PLAYING&&(this._unbindEnded(),this._element.p
ause(),this._state=l.State.PAUSED)},t.resume=function()
{this._element&&this._state===l.State.PAUSED&&(this._bindEnded(),this._element.play
(),this._state=l.State.PLAYING)},t.stop=function(){if(this._element)
{this._element.pause();try{this._element.currentTime=0}catch(t){}for(var
t=0;t<o.length;t++)if(o[t].instance===this)
{o.splice(t,1);break}this._unbindEnded(),this.emit("stop"),this._state=l.State.STOP
PED}},t.setLoop=function(t)
{this._loop=t,this._element&&(this._element.loop=t)},t.getLoop=function(){return
this._loop},t.setVolume=function(t)
{this._volume=t,this._element&&(this._element.volume=t)},t.getVolume=function()
{return this._volume},t.setCurrentTime=function(t){if(this._element)
{this._nextTime=0,this._unbindEnded(),this._bindEnded(function()
{this._bindEnded()}.bind(this));try{this._element.currentTime=t}catch(i){var
e=this._element;if(e.addEventListener){e.addEventListener("loadedmetadata",
(function i(){e.removeEventListener("loadedmetadata",i),e.currentTime=t}))}}}else
this._nextTime=t},t.getCurrentTime=function(){return this._element?
this._element.currentTime:0},t.getDuration=function(){return this._element?
this._element.duration:0},t.getState=function(){var t=this._element;return
t&&(l.State.PLAYING===this._state&&t.paused?
this._state=l.State.STOPPED:l.State.STOPPED!==this._state||t.paused||
(this._state=l.State.PLAYING)),this._state},t.__defineGetter__("src",(function()
{return this._src})),t.__defineSetter__("src",(function(t)
{if(this._unbindEnded(),t)if(this._src=t,t.loaded)this._onLoaded();else{var
e=this;t.once("load",(function()
{t===e._src&&e._onLoaded()})),cc.loader.load({url:t.nativeUrl,skips:["Loader"]},
(function(e,i){e?cc.error(e):t.loaded||(t._nativeAsset=i)}))}else
this._src=null,this._element instanceof HTMLAudioElement?
this._element.src="":this._element=null,this._state=l.State.INITIALZING;return
t})),t.__defineGetter__("paused",(function(){return!this._element||
this._element.paused}))})(l.prototype);var h=function(t,e)
{this._audio=e,this._context=r.__audioSupport.context,this._buffer=t,this._gainObj=
this._context.createGain(),this._volume=1,this._gainObj.gain.setTargetAtTime?
this._gainObj.gain.setTargetAtTime(this._volume,this._context.currentTime,.01):this
._gainObj.gain.value=1,this._gainObj.connect(this._context.destination),this._loop=
!1,this._startTime=-
1,this._currentSource=null,this.playedLength=0,this._currextTimer=null,this._endCal
lback=function(){this.onended&&this.onended(this)}.bind(this)};(function(t
){t.play=function(t){this._currentSource&&!
this.paused&&(this._currentSource.onended=null,this._currentSource.stop(0),this.pla
yedLength=0);var
e=this._context.createBufferSource();e.buffer=this._buffer,e.connect(this._gainObj)
,e.loop=this._loop,this._startTime=this._context.currentTime,(t=t||
this.playedLength)&&(this._startTime-=t);var i=this._buffer.duration,n=t,r=void
0;if(this._loop?e.start?e.start(0,n):e.notoGrainOn?
e.noteGrainOn(0,n):e.noteOn(0,n):(r=i-t,e.start?e.start(0,n,r):e.notoGrainOn?
e.noteGrainOn(0,n,r):e.noteOn(0,n,r)),this._currentSource=e,e.onended=this._endCall
back,(!
e.context.state||"suspended"===e.context.state)&&0===this._context.currentTime){var
s=this;clearTimeout(this._currextTimer),this._currextTimer=setTimeout((function()
{0===s._context.currentTime&&o.push({instance:s._audio,offset:t,audio:s})}),10)}},t
.pause=function(){if(clearTimeout(this._currextTimer),!this.paused)
{this.playedLength=this._context.currentTime-this._startTime,this.playedLength
%=this._buffer.duration;var
t=this._currentSource;this._currentSource=null,this._startTime=-
1,t&&t.stop(0)}},t.__defineGetter__("paused",(function(){return(!
this._currentSource||!this._currentSource.loop)&&(-1===this._startTime||
this._context.currentTime-
this._startTime>this._buffer.duration)})),t.__defineGetter__("loop",(function()
{return this._loop})),t.__defineSetter__("loop",(function(t){return
this._currentSource&&(this._currentSource.loop=t),this._loop=t})),t.__defineGetter_
_("volume",(function(){return this._volume})),t.__defineSetter__("volume",
(function(t){return this._volume=t,this._gainObj.gain.setTargetAtTime?
this._gainObj.gain.setTargetAtTime(this._volume,this._context.currentTime,.01):this
._volume.gain.value=t,r.os===r.OS_IOS&&!
this.paused&&this._currentSource&&(this._currentSource.onended=null,this.pause(),th
is.play()),t})),t.__defineGetter__("currentTime",(function(){return this.paused?
this.playedLength:(this.playedLength=this._context.currentTime-
this._startTime,this.playedLength
%=this._buffer.duration,this.playedLength)})),t.__defineSetter__("currentTime",
(function(t){return this.paused?this.playedLength=t:
(this.pause(),this.playedLength=t,this.play()),t})),t.__defineGetter__("duration",
(function(){return this._buffer.duration}))})(h.prototype),e.exports=cc.Audio=l}),
{"../core/assets/CCAudioClip":57,"../core/event/event-
target":132,"../core/platform/CCSys":209}],21:[(function(t,e,i){"use strict";var
n=t("./CCAudio"),r=t("../core/assets/CCAudioClip"),s=cc.js,a=0,o=s.createMap(!
0),l={},h=[],c=function(t){t._finishCallback=null,h.length<32?
(t.off("ended"),t.off("stop"),t.src=null,h.push(t)):t.destroy()},u=function(t){var
e=a++,i=l[t];if(i||(i=l[t]=[]),d._maxAudioInstance<=i.length){var
r=i.shift();_(r).stop()}var s=h.pop()||new n,u=function(){if(_(this.id)){delete
o[this.id];var t=i.indexOf(this.id);cc.js.array.fastRemoveAt(i,t)}c(this)};return
s.on("ended",(function()
{this._finishCallback&&this._finishCallback(),u.call(this)}),s),s.on("stop",u,s),s.
id=e,o[e]=s,i.push(e),s},_=function(t){return o[t]},f=function(t){return void
0===t?t=1:"string"==typeof
t&&(t=Number.parseFloat(t)),t},d={AudioState:n.State,_maxWebAudioSize:2097152,_maxA
udioInstance:24,_id2audio:o,play:function(t,e,i){var n,s=t;if("string"==typeof
t)cc.warnID(8401,"cc.audioEngine","cc.AudioClip","AudioClip","cc.AudioClip","audio"
),n=u(s=t),r._loadByUrl(s,(function(t,e){e&&(n.src=e)}));else{if(!
t)return;s=t.nativeUrl,(n=u(s)).src=t}return n.setLoop(e||!
1),i=f(i),n.setVolume(i),n.play(),n.id},setLoop:function(t,e){var
i=_(t);i&&i.setLoop&&i.setLoop(e)},isLoop:function(t){var e=_(t);return!(!e||!
e.getLoop)&&e.getLoop()},setVolume:function(t,e){var
i=_(t);i&&i.setVolume(e)},getVolume:function(t){var e=_(t);return e?
e.getVolume():1},setCurrentTime:function(t,e){var i=_(t);return!!
i&&(i.setCurrentTime(e),!0)},getCurrentTime:function(t){var e=_(t);return e?
e.getCurrentTime():0},getDuration:function(t){var e=_(t);return e?
e.getDuration():0},getState:function(t){var e=_(t);return e?
e.getState():this.AudioState.ERROR},setFinishCallback:function(t,e){var
i=_(t);i&&(i._finishCallback=e)},pause:function(t){var e=_(t);return!!
e&&(e.pause(),!0)},_pauseIDCache:[],pauseAll:function(){for(var t in o){var
e=o[t];e.getState()===n.State.PLAYING&&(this._pauseIDCache.push(t),e.pause())}},res
ume:function(t){var e=_(t);e&&e.resume()},resumeAll:function(){for(var
t=0;t<this._pauseIDCache.length;++t){var
e=this._pauseIDCache[t],i=_(e);i&&i.resume()}this._pauseIDCache.length=0},stop:func
tion(t){var e=_(t);return!!e&&(e.stop(),!0)},stopAll:function(){for(var t in o){var
e=o[t];e&&e.stop()}},setMaxAudioInstance:function(t)
{this._maxAudioInstance=t},getMaxAudioInstance:function(){return
this._maxAudioInstance},uncache:function(t){var e=t;if("string"==typeof
t)cc.warnID(8401,"cc.audioEngine","cc.AudioClip","AudioClip","cc.AudioClip","audio"
),e=t;else{if(!t)return;e=t.nativeUrl}var i=l[e];if(i)for(;i.length>0;){var
n=i.pop(),r=o[n];r&&(r.stop(),delete o[n])}},uncacheAll:function()
{this.stopAll();var t=void 0;for(var e in o)
(t=o[e])&&t.destroy();for(;t=h.pop();)t.destroy();o=s.createMap(!
0),l={}},getProfile:function(t){},preload:function(t,e)
{cc.loader.load(t,e&&function(t){t||e()})},setMaxWebAudioSize:function(t)
{this._maxWebAudioSize=1024*t},_breakCache:null,_break:function(){for(var t in
this._breakCache=[],o){var
e=o[t];e.getState()===n.State.PLAYING&&(this._breakCache.push(t),e.pause())}},_rest
ore:function(){if(this._breakCache){for(;this._breakCache.length>0;){var
t=this._breakCache.pop(),e=_(t);e&&e.resume&&e.resume()}this._breakCache=null}},_mu
sic:{id:-1,loop:!1,volume:1},_effect:{volume:1,pauseCache:
[]},playMusic:function(t,e){var i=this._music;return
this.stop(i.id),i.id=this.play(t,e,i.volume),i.loop=e,i.id},stopMusic:function()
{this.stop(this._music.id)},pauseMusic:function(){return
this.pause(this._music.id),this._music.id},resumeMusic:function(){return
this.resume(this._music.id),this._music.id},getMusicVolume:function(){return
this._music.volume},setMusicVolume:function(t){t=f(t);var e=this._music;return
e.volume=t,this.setVolume(e.id,e.volume),e.volume},isMusicPlaying:function(){return
this.getState(this._music.id)===this.AudioState.PLAYING},playEffect:function(t,e)
{return this.play(t,e||!1,this._effect.volume)},setEffectsVolume:function(t)
{t=f(t);var e=this._music.id;for(var i in this._effect.volume=t,o){var
n=o[i];n&&n.id!==e&&d.setVolume(i,t)}},getEffectsVolume:function(){return
this._effect.volume},pauseEffect:function(t){return
this.pause(t)},pauseAllEffects:function(){var
t=this._music.id,e=this._effect;for(var i in e.pauseCache.length=0,o){var
n=o[i];if(n&&n.id!
==t)n.getState()===this.AudioState.PLAYING&&(e.pauseCache.push(i),n.pause())}},resu
meEffect:function(t){this.resume(t)},resumeAllEffects:function(){for(var
t=this._effect.pauseCache,e=0;e<t.length;++e){var
i=t[e],n=o[i];n&&n.resume()}},stopEffect:function(t){return
this.stop(t)},stopAllEffects:function(){var t=this._music.id;for(var e in o){var
i=o[e];if(i&&i.id!
==t)i.getState()===d.AudioState.PLAYING&&i.stop()}}};e.exports=cc.audioEngine=d}),
{"../core/assets/CCAudioClip":57,"./CCAudio":20}],22:[(function(t,e,i){"use
strict";var
n={name:"Jacob__Codec"};n.Base64=t("./base64"),n.GZip=t("./gzip"),n.unzip=function(
){return n.GZip.gunzip.apply(n.GZip,arguments)},n.unzipBase64=function(){var
t=n.Base64.decode.apply(n.Base64,arguments);try{return
n.GZip.gunzip.call(n.GZip,t)}catch(e){return
t.slice(7)}},n.unzipBase64AsArray=function(t,e){e=e||1;var
i,n,r,s=this.unzipBase64(t),a=[];for(i=0,r=s.length/e;i<r;i++)for(a[i]=0,n=e-
1;n>=0;--n)a[i]+=s.charCodeAt(i*e+n)<<8*n;return a},n.unzipAsArray=function(t,e)
{e=e||1;var i,n,r,s=this.unzip(t),a=[];for(i=0,r=s.length/e;i<r;i++)for(a[i]=0,n=e-
1;n>=0;--n)a[i]+=s.charCodeAt(i*e+n)<<8*n;return a},cc.codec=e.exports=n}),
{"./base64":23,"./gzip":24}],23:[(function(t,e,i){"use strict";var
n=t("../core/utils/misc").BASE64_VALUES,r={name:"Jacob__Codec__Base64",decode:funct
ion(t){var e,i,r,s,a,o,l=[],h=0;for(t=t.replace(/[^A-Za-z0-
9\+\/\=]/g,"");h<t.length;)e=n[t.charCodeAt(h++)]<<2|(s=n[t.charCodeAt(h+
+)])>>4,i=(15&s)<<4|(a=n[t.charCodeAt(h++)])>>2,r=(3&a)<<6|(o=n[t.charCodeAt(h+
+)]),l.push(String.fromCharCode(e)),64!==a&&l.push(String.fromCharCode(i)),64!
==o&&l.push(String.fromCharCode(r));return
l=l.join("")},decodeAsArray:function(t,e){var
i,n,r,s=this.decode(t),a=[];for(i=0,r=s.length/e;i<r;i++)for(a[i]=0,n=e-1;n>=0;--
n)a[i]+=s.charCodeAt(i*e+n)<<8*n;return a}};e.exports=r}),
{"../core/utils/misc":295}],24:[(function(t,e,i){"use strict";var n=function(t)
{this.data=t,this.debug=!1,this.gpflags=void
0,this.files=0,this.unzipped=[],this.buf32k=new
Array(32768),this.bIdx=0,this.modeZIP=!
1,this.bytepos=0,this.bb=1,this.bits=0,this.nameBuf=[],this.fileout=void
0,this.literalTree=new Array(n.LITERALS),this.distanceTree=new
Array(32),this.treepos=0,this.Places=null,this.len=0,this.fpos=new
Array(17),this.fpos[0]=0,this.flens=void 0,this.fmax=void 0};n.gunzip=function(t)
{return t.constructor===Array||(t.constructor,String),new n(t).gunzip()[0]
[0]},n.HufNode=function(){this.b0=0,this.b1=0,this.jump=null,this.jumppos=-
1},n.LITERALS=288,n.NAMEMAX=256,n.bitReverse=[0,128,64,192,32,160,96,224,16,144,80,
208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,6
8,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,1
56,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10
,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230
,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126
,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,10
5,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181
,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,
163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,
59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,24
7,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],n.cplens=[3,4,5,6,7,8,
9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],n.cp
lext=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],n.cpdist=[1,
2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6
145,8193,12289,16385,24577],n.cpdext=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,1
0,10,11,11,12,12,13,13],n.border=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],n
.prototype.gunzip=function(){return
this.outputArr=[],this.nextFile(),this.unzipped},n.prototype.readByte=function()
{return this.bits+=8,this.bytepos<this.data.length?
this.data.charCodeAt(this.bytepos++):-1},n.prototype.byteAlign=function()
{this.bb=1},n.prototype.readBit=function(){var t;return this.bits+
+,t=1&this.bb,this.bb>>=1,0===this.bb&&(this.bb=this.readByte(),t=1&this.bb,this.bb
=this.bb>>1|128),t},n.prototype.readBits=function(t){for(var e=0,i=t;i--;)e=e<<1|
this.readBit();return t&&(e=n.bitReverse[e]>>8-
t),e},n.prototype.flushBuffer=function()
{this.bIdx=0},n.prototype.addBuffer=function(t){this.buf32k[this.bIdx+
+]=t,this.outputArr.push(String.fromCharCode(t)),32768===this.bIdx&&(this.bIdx=0)},
n.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-
1;if(this.flens[this.fpos[this.len]]===this.len)return this.fpos[this.len]+
+;this.fpos[this.len]++}},n.prototype.Rec=function(){var
t,e=this.Places[this.treepos];if(17===this.len)return-1;if(this.treepos++,this.len+
+,(t=this.IsPat())>=0)e.b0=t;else if(e.b0=32768,this.Rec())return-
1;if((t=this.IsPat())>=0)e.b1=t,e.jump=null;else
if(e.b1=32768,e.jump=this.Places[this.treepos],e.jumppos=this.treepos,this.Rec())re
turn-1;return this.len--,0},n.prototype.CreateTree=function(t,e,i,n){var
r;for(this.Places=t,this.treepos=0,this.flens=i,this.fmax=e,r=0;r<17;r+
+)this.fpos[r]=0;return this.len=0,this.Rec()?-
1:0},n.prototype.DecodeValue=function(t){for(var
e,i,n=0,r=t[n];;)if(this.readBit()){if(!(32768&r.b1))return
r.b1;for(r=r.jump,e=t.length,i=0;i<e;i++)if(t[i]===r){n=i;break}}else{if(!
(32768&r.b0))return r.b0;r=t[++n]}return-1},n.prototype.DeflateLoop=function(){var
t,e,i;do{var
r,s;if(t=this.readBit(),0===(e=this.readBits(2)))for(this.byteAlign(),r=this.readBy
te(),r|=this.readByte()<<8,s=this.readByte(),65535&(r^~(s|
=this.readByte()<<8))&&document.write("BlockLen checksum
mismatch\n");r--;)a=this.readByte(),this.addBuffer(a);else
if(1===e)for(;;)if((o=n.bitReverse[this.readBits(7)]>>1)>23?(o=o<<1|
this.readBit())>199?o=(o-=128)<<1|this.readBit():(o-
=48)>143&&(o+=136):o+=256,o<256)this.addBuffer(o);else{if(256===o)break;for(o-
=257,m=this.readBits(n.cplext[o])
+n.cplens[o],o=n.bitReverse[this.readBits(5)]>>3,n.cpdext[o]>8?
(p=this.readBits(8),p|=this.readBits(n.cpdext[o]-
8)<<8):p=this.readBits(n.cpdext[o]),p+=n.cpdist[o],o=0;o<m;o++){var
a=this.buf32k[this.bIdx-p&32767];this.addBuffer(a)}}else if(2===e){var
o,l,h,c,u,_=new
Array(320);for(h=257+this.readBits(5),c=1+this.readBits(5),u=4+this.readBits(4),o=0
;o<19;o++)_[o]=0;for(o=0;o<u;o+
+)_[n.border[o]]=this.readBits(3);for(m=this.distanceTree.length,i=0;i<m;i+
+)this.distanceTree[i]=new
n.HufNode;if(this.CreateTree(this.distanceTree,19,_,0))return
this.flushBuffer(),1;l=h+c,i=0;for(;i<l;)if(0,
(o=this.DecodeValue(this.distanceTree))<16)_[i++]=o;else if(16===o){var f;if(i+
(o=3+this.readBits(2))>l)return this.flushBuffer(),1;for(f=i?_[i-1]:0;o--;)_[i+
+]=f}else{if(i+(o=17===o?3+this.readBits(3):11+this.readBits(7))>l)return
this.flushBuffer(),1;for(;o--;)_[i++]=0}for(m=this.literalTree.length,i=0;i<m;i+
+)this.literalTree[i]=new
n.HufNode;if(this.CreateTree(this.literalTree,h,_,0))return
this.flushBuffer(),1;for(m=this.literalTree.length,i=0;i<m;i+
+)this.distanceTree[i]=new n.HufNode;var d=new Array;for(i=h;i<_.length;i++)d[i-
h]=_[i];if(this.CreateTree(this.distanceTree,c,d,0))return
this.flushBuffer(),1;for(;;)if((o=this.DecodeValue(this.literalTree))>=256){var
m,p;if(0===(o-=256))break;for(o--,m=this.readBits(n.cplext[o])
+n.cplens[o],o=this.DecodeValue(this.distanceTree),n.cpdext[o]>8?
(p=this.readBits(8),p|=this.readBits(n.cpdext[o]-
8)<<8):p=this.readBits(n.cpdext[o]),p+=n.cpdist[o];m--;){a=this.buf32k[this.bIdx-
p&32767];this.addBuffer(a)}}else this.addBuffer(o)}}while(!t);return
this.flushBuffer(),this.byteAlign(),0},n.prototype.unzipFile=function(t){var
e;for(this.gunzip(),e=0;e<this.unzipped.length;e++)if(this.unzipped[e]
[1]===t)return this.unzipped[e][0]},n.prototype.nextFile=function()
{this.outputArr=[],this.modeZIP=!1;var
t=[];if(t[0]=this.readByte(),t[1]=this.readByte(),120===t[0]&&218===t[1]&&(this.Def
lateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),"geonext.gxt"],this.f
iles+
+),31===t[0]&&139===t[1]&&(this.skipdir(),this.unzipped[this.files]=[this.outputArr
.join(""),"file"],this.files++),80===t[0]&&75===t[1]&&(this.modeZIP=!
0,t[2]=this.readByte(),t[3]=this.readByte(),3===t[2]&&4===t[3]))
{t[0]=this.readByte(),t[1]=this.readByte(),this.gpflags=this.readByte(),this.gpflag
s|=this.readByte()<<8;var e=this.readByte();e|
=this.readByte()<<8,this.readByte(),this.readByte(),this.readByte(),this.readByte()
;this.readByte();this.readByte()<<8,this.readByte()<<16,this.readByte()<<24;this.re
adByte();this.readByte()<<8,this.readByte()<<16,this.readByte()<<24;var
i=this.readByte();i|=this.readByte()<<8;var r=this.readByte();for(r|
=this.readByte()<<8,a=0,this.nameBuf=[];i--;){var
s=this.readByte();"/"===s|":"===s?a=0:a<n.NAMEMAX-1&&(this.nameBuf[a+
+]=String.fromCharCode(s))}this.fileout||(this.fileout=this.nameBuf);for(var
a=0;a<r;)s=this.readByte(),a+
+;8===e&&(this.DeflateLoop(),this.unzipped[this.files]=[this.outputArr.join(""),thi
s.nameBuf.join("")],this.files++),this.skipdir()}},n.prototype.skipdir=function()
{var
t,e,i=[];if(8&this.gpflags&&(i[0]=this.readByte(),i[1]=this.readByte(),i[2]=this.re
adByte(),i[3]=this.readByte(),this.readByte(),this.readByte()<<8,this.readByte()<<1
6,this.readByte()<<24,this.readByte(),this.readByte()<<8,this.readByte()<<16,this.r
eadByte()<<24),this.modeZIP&&this.nextFile(),i[0]=this.readByte(),8!==i[0])return
0;if(this.gpflags=this.readByte(),this.readByte(),this.readByte(),this.readByte(),t
his.readByte(),this.readByte(),this.readByte(),4&this.gpflags)for(i[0]=this.readByt
e(),i[2]=this.readByte(),this.len=i[0]+256*i[1],t=0;t<this.len;t+
+)this.readByte();if(8&this.gpflags)for(t=0,this.nameBuf=[];e=this.readByte();)"7"!
==e&&":"!==e||(t=0),t<n.NAMEMAX-1&&(this.nameBuf[t+
+]=e);if(16&this.gpflags)for(;e=this.readByte(););2&this.gpflags&&(this.readByte(),
this.readByte()),this.DeflateLoop(),this.readByte(),this.readByte(),this.readByte()
,this.readByte(),this.modeZIP&&this.nextFile()},e.exports=n}),{}],25:
[(function(t,e,i){"use strict";(function(){function t(t){throw t}var e=void 0,i=!
0,n=this;function r(t,i){var r,s=t.split("."),a=n;!(s[0]in
a)&&a.execScript&&a.execScript("var
"+s[0]);for(;s.length&&(r=s.shift());)s.length||i===e?a=a[r]?
a[r]:a[r]={}:a[r]=i}var s="undefined"!=typeof Uint8Array&&"undefined"!=typeof
Uint16Array&&"undefined"!=typeof Uint32Array;function a(t){if("string"==typeof t)
{var e,i,n=t.split("");for(e=0,i=n.length;e<i;e+
+)n[e]=(255&n[e].charCodeAt(0))>>>0;t=n}for(var r,s=1,a=0,o=t.length,l=0;0<o;){o-
=r=1024<o?1024:o;do{a+=s+=t[l++]}while(--r);s%=65521,a%=65521}return(a<<16|
s)>>>0}function o(e,i){this.index="number"==typeof i?i:0,this.i=0,this.buffer=e
instanceof(s?Uint8Array:Array)?e:new(s?Uint8Array:Array)
(32768),2*this.buffer.length<=this.index&&t(Error("invalid
index")),this.buffer.length<=this.index&&this.f()}o.prototype.f=function(){var
t,e=this.buffer,i=e.length,n=new(s?Uint8Array:Array)(i<<1);if(s)n.set(e);else
for(t=0;t<i;++t)n[t]=e[t];return this.buffer=n},o.prototype.d=function(t,e,i){var
n,r=this.buffer,s=this.index,a=this.i,o=r[s];if(i&&1<e&&(t=8<e?(f[255&t]<<24|
f[t>>>8&255]<<16|f[t>>>16&255]<<8|f[t>>>24&255])>>32-e:f[t]>>8-e),8>e+a)o=o<<e|
t,a+=e;else for(n=0;n<e;++n)o=o<<1|t>>e-n-1&1,8==++a&&(a=0,r[s+
+]=f[o],o=0,s===r.length&&(r=this.f()));r[s]=o,this.buffer=r,this.i=a,this.index=s}
,o.prototype.finish=function(){var t,e=this.buffer,i=this.index;return
0<this.i&&(e[i]<<=8-this.i,e[i]=f[e[i]],i++),s?t=e.subarray(0,i):
(e.length=i,t=e),t};var l,h=new(s?Uint8Array:Array)(256);for(l=0;256>l;++l){for(var
c=_=l,u=7,_=_>>>1;_;_>>>=1)c<<=1,c|=1&_,--u;h[l]=(c<<u&255)>>>0}var f=h;function
d(t){this.buffer=new(s?Uint16Array:Array)(2*t),this.length=0}function m(t){var
e,i,n,r,a,o,l,h,c,u=t.length,_=0,f=Number.POSITIVE_INFINITY;for(h=0;h<u;+
+h)t[h]>_&&(_=t[h]),t[h]<f&&(f=t[h]);for(e=1<<_,i=new(s?Uint32Array:Array)
(e),n=1,r=0,a=2;n<=_;){for(h=0;h<u;++h)if(t[h]===n){for(o=0,l=r,c=0;c<n;++c)o=o<<1|
1&l,l>>=1;for(c=o;c<e;c+=a)i[c]=n<<16|h;++r}++n,r<<=1,a<<=1}return[i,_,f]}function
p(t,e)
{this.h=y,this.w=0,this.input=t,this.b=0,e&&(e.lazy&&(this.w=e.lazy),"number"==type
of
e.compressionType&&(this.h=e.compressionType),e.outputBuffer&&(this.a=s&&e.outputBu
ffer instanceof Array?new
Uint8Array(e.outputBuffer):e.outputBuffer),"number"==typeof
e.outputIndex&&(this.b=e.outputIndex)),this.a||(this.a=new(s?Uint8Array:Array)
(32768))}s&&new
Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,265
7392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,
2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,41075807
53,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,41953
02755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3
524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,117226610
1,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,145462
1731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,148
3230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,
112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,21376567
63,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,18123
70925,453092731,2181625025,4111451223,1706088902,3
14042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,130353596
0,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,11310
14506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,13
42533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015
,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442
989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,194380
3523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,209
7651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,
1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,3979177
63,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068
828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,
829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,31380784
67,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,30503
60625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,394
3577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3
855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,217671854
1,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,240580
1727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,280
8555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,
2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,6158181
50,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,7119
28724,3020668471,3272380065,1510334235,755167117]),d.prototype.getParent=function(t
){return 2*((t-2)/4|0)},d.prototype.push=function(t,e){var
i,n,r,s=this.buffer;for(i=this.length,s[this.length++]=e,s[this.length+
+]=t;0<i&&(n=this.getParent(i),s[i]>s[n]);)r=s[i],s[i]=s[n],s[n]=r,r=s[i+1],s[i+1]=
s[n+1],s[n+1]=r,i=n;return this.length},d.prototype.pop=function(){var
t,e,i,n,r,s=this.buffer;for(e=s[0],t=s[1],this.length-
=2,s[0]=s[this.length],s[1]=s[this.length+1],r=0;!
((n=2*r+2)>=this.length)&&(n+2<this.length&&s[n+2]>s[n]&&(n+=2),s[n]>s[r]);)i=s[r],
s[r]=s[n],s[n]=i,i=s[r+1],s[r+1]=s[n+1],s[n+1]=i,r=n;return{index:t,value:e,length:
this.length}};var v,y=2,g={NONE:0,r:1,j:y,N:3},x=[];for(v=0;288>v;v++)switch(i)
{case 143>=v:x.push([v+48,8]);break;case 255>=v:x.push([v-144+400,9]);break;case
279>=v:x.push([v-256+0,7]);break;case 287>=v:x.push([v-
280+192,8]);break;default:t("invalid literal: "+v)}function b(t,e)
{this.length=t,this.G=e}function A(){var e=C;switch(i){case 3===e:return[257,e-
3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case
6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-
8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case
12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-
15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case
26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-
31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case
58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-
67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case
130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case
194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case
257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:t("invalid
length: "+e)}}p.prototype.n=function(){var n,r,a,l,h=this.input;switch(this.h){case
0:for(a=0,l=h.length;a<l;){var c,u,_,f=r=s?
h.subarray(a,a+65535):h.slice(a,a+65535),d=(a+=r.length)===l,m=e,p=e,v=this.a,g=thi
s.b;if(s){for(v=new Uint8Array(this.a.buffer);v.length<=g+f.length+5;)v=new
Uint8Array(v.length<<1);v.set(this.a)}if(c=d?1:0,v[g++]=0|
c,_=65536+~(u=f.length)&65535,v[g++]=255&u,v[g++]=u>>>8&255,v[g++]=255&_,v[g+
+]=_>>>8&255,s)v.set(f,g),g+=f.length,v=v.subarray(0,g);else{for(m=0,p=f.length;m<p
;++m)v[g++]=f[m];v.length=g}this.b=g,this.a=v}break;case 1:var b=new o(new
Uint8Array(this.a.buffer),this.b);b.d(1,1,i),b.d(1,2,i);var
A,C,S,T=E(this,h);for(A=0,C=T.length;A<C;A+
+)if(S=T[A],o.prototype.d.apply(b,x[S]),256<S)b.d(T[++A],T[++A],i),b.d(T[+
+A],5),b.d(T[++A],T[++A],i);else
if(256===S)break;this.a=b.finish(),this.b=this.a.length;break;case y:var
w,B,P,I,R,O,L,F,V,N,k,G,z,U,j,W=new o(new
Uint8Array(this.a),this.b),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=Arr
ay(19);for(w=y,W.d(1,1,i),W.d(w,2,i),B=E(this,h),L=D(O=M(this.L,15)),V=D(F=M(this.K
,7)),P=286;257<P&&0===O[P-1];P--);for(I=30;1<I&&0===F[I-1];I--);var q,Y,J,Z,K,Q,
$=P,tt=I,et=new(s?Uint32Array:Array)($+tt),it=new(s?Uint32Array:Array)
(316),nt=new(s?Uint8Array:Array)(19);for(q=Y=0;q<$;q++)et[Y++]=O[q];for(q=0;q<tt;q+
+)et[Y++]=F[q];if(!s)for(q=0,Z=nt.length;q<Z;+
+q)nt[q]=0;for(q=K=0,Z=et.length;q<Z;q+=Y){for(Y=1;q+Y<Z&&et[q+Y]===et[q];+
+Y);if(J=Y,0===et[q])if(3>J)for(;0<J--;)it[K++]=0,nt[0]++;else for(;0<J;)(Q=138>J?
J:138)>J-3&&Q<J&&(Q=J-3),10>=Q?(it[K++]=17,it[K++]=Q-3,nt[17]++):(it[K++]=18,it[K+
+]=Q-11,nt[18]++),J-=Q;else if(it[K++]=et[q],nt[et[q]]++,3>--J)for(;0<J--;)it[K+
+]=et[q],nt[et[q]]++;else for(;0<J;)(Q=6>J?J:6)>J-3&&Q<J&&(Q=J-3),it[K++]=16,it[K+
+]=Q-3,nt[16]++,J-=Q}for(n=s?it.subarray(0,K):it.slice(0,K),N=M(nt,7),U=0;19>U;U+
+)X[U]=N[H[U]];for(R=19;4<R&&0===X[R-1];R--);for(k=D(N),W.d(P-257,5,i),W.d(I-
1,5,i),W.d(R-4,4,i),U=0;U<R;U++)W.d(X[U],3,i);for(U=0,j=n.length;U<j;U+
+)if(G=n[U],W.d(k[G],N[G],i),16<=G){switch(U++,G){case 16:z=2;break;case
17:z=3;break;case 18:z=7;break;default:t("invalid code: "+G)}W.d(n[U],z,i)}var
rt,st,at,ot,lt,ht,ct,ut,_t=[L,O],ft=[V,F];for(lt=_t[0],ht=_t[1],ct=ft[0],ut=ft[1],r
t=0,st=B.length;rt<st;++rt)if(at=B[rt],W.d(lt[at],ht[at],i),256<at)W.d(B[++rt],B[+
+rt],i),ot=B[++rt],W.d(ct[ot],ut[ot],i),W.d(B[++rt],B[++rt],i);else
if(256===at)break;this.a=W.finish(),this.b=this.a.length;break;default:t("invalid
compression type")}return this.a};var C,S,T=[];for(C=3;258>=C;C+
+)S=A(),T[C]=S[2]<<24|S[1]<<16|S[0];var w=s?new Uint32Array(T):T;function E(n,r)
{function a(e,n){var r,s,a,o,l=e.G,h=[],c=0;switch(r=w[e.length],h[c+
+]=65535&r,h[c++]=r>>16&255,h[c++]=r>>24,i){case 1===l:s=[0,l-1,0];break;case
2===l:s=[1,l-2,0];break;case 3===l:s=[2,l-3,0];break;case 4===l:s=[3,l-
4,0];break;case 6>=l:s=[4,l-5,1];break;case 8>=l:s=[5,l-7,1];break;case
12>=l:s=[6,l-9,2];break;case 16>=l:s=[7,l-13,2];break;case 24>=l:s=[8,l-
17,3];break;case 32>=l:s=[9,l-25,3];break;case 48>=l:s=[10,l-33,4];break;case
64>=l:s=[11,l-49,4];break;case 96>=l:s=[12,l-65,5];break;case 128>=l:s=[13,l-
97,5];break;case 192>=l:s=[14,l-129,6];break;case 256>=l:s=[15,l-193,6];break;case
384>=l:s=[16,l-257,7];break;case 512>=l:s=[17,l-385,7];break;case 768>=l:s=[18,l-
513,8];break;case 1024>=l:s=[19,l-769,8];break;case 1536>=l:s=[20,l-
1025,9];break;case 2048>=l:s=[21,l-1537,9];break;case 3072>=l:s=[22,l-
2049,10];break;case 4096>=l:s=[23,l-3073,10];break;case 6144>=l:s=[24,l-
4097,11];break;case 8192>=l:s=[25,l-6145,11];break;case 12288>=l:s=[26,l-
8193,12];break;case 16384>=l:s=[27,l-12289,12];break;case 24576>=l:s=[28,l-
16385,13];break;case 32768>=l:s=[29,l-24577,13];break;default:t("invalid
distance")}for(r=s,h[c++]=r[0],h[c++]=r[1],h[c++]=r[2],a=0,o=h.length;a<o;++a)v[y+
+]=h[a];x[h[0]]++,A[h[3]]++,g=e.length+n-1,d=null}var o,l,h,c,u,_,f,d,m,p={},v=s?
new Uint16Array(2*r.length):[],y=0,g=0,x=new(s?Uint32Array:Array)(286),A=new(s?
Uint32Array:Array)(30),C=n.w;if(!s){for(h=0;285>=h;)x[h++]=0;for(h=0;29>=h;)A[h+
+]=0}for(x[256]=1,o=0,l=r.length;o<l;++o){for(h=u=0,c=3;h<c&&o+h!==l;++h)u=u<<8|
r[o+h];if(p[u]===e&&(p[u]=[]),_=p[u],!(0<g--)){for(;0<_.length&&32768<o-
_[0];)_.shift();if(o+3>=l){for(d&&a(d,-1),h=0,c=l-o;h<c;++h)m=r[o+h],v[y++]=m,+
+x[m];break}if(0<_.length){var
S=e,T=e,E=0,M=e,D=e,B=e,P=r.length,I=(D=0,_.length);t:for(;D<I;D++){if(S=_[I-D-
1],M=3,3<E){for(B=E;3<B;B--)if(r[S+B-1]!==r[o+B-1])continue
t;M=E}for(;258>M&&o+M<P&&r[S+M]===r[o+M];)++M;if(M>E&&(T=S,E=M),258===M)break}f=new
b(E,o-T),d?d.length<f.length?(m=r[o-1],v[y++]=m,++x[m],a(f,0)):a(d,-1):f.length<C?
d=f:a(f,0)}else d?a(d,-1):(m=r[o],v[y++]=m,++x[m])}_.push(o)}return v[y+
+]=256,x[256]++,n.L=x,n.K=A,s?v.subarray(0,y):v}function M(t,e){function i(t){var
e=C[t][S[t]];e===y?(i(t+1),i(t+1)):--b[e],++S[t]}var n,r,a,o,l,h=t.length,c=new
d(572),u=new(s?Uint8Array:Array)(h);if(!s)for(o=0;o<h;o++)u[o]=0;for(o=0;o<h;+
+o)0<t[o]&&c.push(o,t[o]);if(n=Array(c.length/2),r=new(s?Uint32Array:Array)
(c.length/2),1===n.length)return u[c.pop().index]=1,u;for(o=0,l=c.length/2;o<l;+
+o)n[o]=c.pop(),r[o]=n[o].value;var _,f,m,p,v,y=r.length,g=new(s?Uint16Array:Array)
(e),x=new(s?Uint8Array:Array)(e),b=new(s?Uint8Array:Array)
(y),A=Array(e),C=Array(e),S=Array(e),T=(1<<e)-y,w=1<<e-1;for(g[e-1]=y,f=0;f<e;+
+f)T<w?x[f]=0:(x[f]=1,T-=w),T<<=1,g[e-2-f]=(g[e-1-f]/2|
0)+y;for(g[0]=x[0],A[0]=Array(g[0]),C[0]=Array(g[0]),f=1;f<e;++f)g[f]>2*g[f-
1]+x[f]&&(g[f]=2*g[f-1]+x[f]),A[f]=Array(g[f]),C[f]=Array(g[f]);for(_=0;_<y;+
+_)b[_]=e;for(m=0;m<g[e-1];++m)A[e-1][m]=r[m],C[e-1][m]=m;for(_=0;_<e;+
+_)S[_]=0;for(1===x[e-1]&&(--b[0],++S[e-1]),f=e-2;0<=f;--f)
{for(p=_=0,v=S[f+1],m=0;m<g[f];m++)(p=A[f+1][v]+A[f+1][v+1])>r[_]?(A[f][m]=p,C[f]
[m]=y,v+=2):(A[f][m]=r[_],C[f][m]=_,+
+_);S[f]=0,1===x[f]&&i(f)}for(a=b,o=0,l=n.length;o<l;++o)u[n[o].index]=a[o];return
u}function D(e){var i,n,r,a,o=new(s?Uint16Array:Array)
(e.length),l=[],h=[],c=0;for(i=0,n=e.length;i<n;i++)l[e[i]]=1+(0|
l[e[i]]);for(i=1,n=16;i<=n;i++)h[i]=c,(c+=0|
l[i])>1<<i&&t("overcommitted"),c<<=1;for(65536>c&&t("undercommitted"),i=0,n=e.lengt
h;i<n;i++)for(c=h[e[i]],h[e[i]]+=1,r=o[i]=0,a=e[i];r<a;r++)o[i]=o[i]<<1|
1&c,c>>>=1;return o}function B(t,e){this.input=t,this.a=new(s?Uint8Array:Array)
(32768),this.h=P.j;var i,n={};for(i in!e&&(e={})||"number"!=typeof
e.compressionType||
(this.h=e.compressionType),e)n[i]=e[i];n.outputBuffer=this.a,this.z=new
p(this.input,n)}var P=g;function I(e,i)
{switch(this.k=[],this.l=32768,this.e=this.g=this.c=this.q=0,this.input=s?new
Uint8Array(e):e,this.s=!1,this.m=O,this.B=!1,!i&&(i={})||
(i.index&&(this.c=i.index),i.bufferSize&&(this.l=i.bufferSize),i.bufferType&&(this.
m=i.bufferType),i.resize&&(this.B=i.resize)),this.m){case
R:this.b=32768,this.a=new(s?Uint8Array:Array)(32768+this.l+258);break;case
O:this.b=0,this.a=new(s?Uint8Array:Array)
(this.l),this.f=this.J,this.t=this.H,this.o=this.I;break;default:t(Error("invalid
inflate mode"))}}B.prototype.n=function(){var
e,i,n,r,o,l,h,c=0;switch(h=this.a,e=ct){case ct:i=Math.LOG2E*Math.log(32768)-
8;break;default:t(Error("invalid compression method"))}switch(n=i<<4|e,h[c++]=n,e)
{case ct:switch(this.h){case P.NONE:o=0;break;case P.r:o=1;break;case
P.j:o=2;break;default:t(Error("unsupported compression
type"))}break;default:t(Error("invalid compression method"))}return r=o<<6|0,h[c+
+]=r|31-(256*n+r)%31,l=a(this.input),this.z.b=c,c=(h=this.z.n()).length,s&&((h=new
Uint8Array(h.buffer)).length<=c+4&&(this.a=new
Uint8Array(h.length+4),this.a.set(h),h=this.a),h=h.subarray(0,c+4)),h[c+
+]=l>>24&255,h[c++]=l>>16&255,h[c++]=l>>8&255,h[c+
+]=255&l,h},r("Zlib.Deflate",B),r("Zlib.Deflate.compress",(function(t,e){return new
B(t,e).n()})),r("Zlib.Deflate.CompressionType",P),r("Zlib.Deflate.CompressionType.N
ONE",P.NONE),r("Zlib.Deflate.CompressionType.FIXED",P.r),r("Zlib.Deflate.Compressio
nType.DYNAMIC",P.j);var R=0,O=1,L={D:R,C:O};I.prototype.p=function(){for(;!this.s;)
{var n=tt(this,3);switch(1&n&&(this.s=i),n>>>=1){case 0:var
r=this.input,a=this.c,o=this.a,l=this.b,h=e,c=e,u=e,_=o.length,f=e;switch(this.e=th
is.g=0,(h=r[a++])===e&&t(Error("invalid uncompressed block header: LEN (first
byte)")),c=h,(h=r[a++])===e&&t(Error("invalid uncompressed block header: LEN
(second byte)")),c|=h<<8,(h=r[a++])===e&&t(Error("invalid uncompressed block
header: NLEN (first byte)")),u=h,(h=r[a++])===e&&t(Error("invalid uncompressed
block header: NLEN (second byte)")),c===~(u|=h<<8)&&t(Error("invalid uncompressed
block header: length verify")),a+c>r.length&&t(Error("input buffer is
broken")),this.m){case R:for(;l+c>o.length;){if(c-=f=_-
l,s)o.set(r.subarray(a,a+f),l),l+=f,a+=f;else for(;f--;)o[l++]=r[a+
+];this.b=l,o=this.f(),l=this.b}break;case
O:for(;l+c>o.length;)o=this.f({v:2});break;default:t(Error("invalid inflate
mode"))}if(s)o.set(r.subarray(a,a+c),l),l+=c,a+=c;else for(;c--;)o[l++]=r[a+
+];this.c=a,this.b=l,this.a=o;break;case 1:this.o(K,$);break;case
2:it(this);break;default:t(Error("unknown BTYPE: "+n))}}return this.t()};var
F,V,N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=s?new
Uint16Array(N):N,G=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,1
15,131,163,195,227,258,258,258],z=s?new
Uint16Array(G):G,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],
j=s?new
Uint8Array(U):U,W=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,
1537,2049,3073,4097,6145,8193,12289,16385,24577],H=s?new
Uint16Array(W):W,X=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,1
3,13],q=s?new Uint8Array(X):X,Y=new(s?Uint8Array:Array)
(288);for(F=0,V=Y.length;F<V;++F)Y[F]=143>=F?8:255>=F?9:279>=F?7:8;var
J,Z,K=m(Y),Q=new(s?Uint8Array:Array)(30);for(J=0,Z=Q.length;J<Z;++J)Q[J]=5;var
$=m(Q);function tt(i,n){for(var r,s=i.g,a=i.e,o=i.input,l=i.c;a<n;)(r=o[l+
+])===e&&t(Error("input buffer is broken")),s|=r<<a,a+=8;return r=s&(1<<n)-
1,i.g=s>>>n,i.e=a-n,i.c=l,r}function et(i,n){for(var
r,s,a,o=i.g,l=i.e,h=i.input,c=i.c,u=n[0],_=n[1];l<_;)(r=h[c++])===e&&t(Error("input
buffer is broken")),o|=r<<l,l+=8;return a=(s=u[o&(1<<_)-1])>>>16,i.g=o>>a,i.e=l-
a,i.c=c,65535&s}function it(t){function e(t,e,i){var
n,r,s,a;for(a=0;a<t;)switch(n=et(this,e)){case 16:for(s=3+tt(this,2);s--;)i[a+
+]=r;break;case 17:for(s=3+tt(this,3);s--;)i[a++]=0;r=0;break;case
18:for(s=11+tt(this,7);s--;)i[a++]=0;r=0;break;default:r=i[a++]=n}return i}var
i,n,r,a,o=tt(t,5)+257,l=tt(t,5)+1,h=tt(t,4)+4,c=new(s?Uint8Array:Array)
(k.length);for(a=0;a<h;++a)c[k[a]]=tt(t,3);i=m(c),n=new(s?Uint8Array:Array)
(o),r=new(s?Uint8Array:Array)
(l),t.o(m(e.call(t,o,i,n)),m(e.call(t,l,i,r)))}function nt(e,i){var
n,r;switch(this.input=e,this.c=0,!i&&(i={})||
(i.index&&(this.c=i.index),i.verify&&(this.M=i.verify)),n=e[this.c++],r=e[this.c+
+],15&n){case ct:this.method=ct;break;default:t(Error("unsupported compression
method"))}0!=((n<<8)+r)%31&&t(Error("invalid fcheck flag:"+((n<<8)+r)
%31)),32&r&&t(Error("fdict flag is not supported")),this.A=new I(e,
{index:this.c,bufferSize:i.bufferSize,bufferType:i.bufferType,resize:i.resize})}I.p
rototype.o=function(t,e){var i=this.a,n=this.b;this.u=t;for(var r,s,a,o,l=i.length-
258;256!==(r=et(this,t));)if(256>r)n>=l&&(this.b=n,i=this.f(),n=this.b),i[n+
+]=r;else for(o=z[s=r-
257],0<j[s]&&(o+=tt(this,j[s])),r=et(this,e),a=H[r],0<q[r]&&(a+=tt(this,q[r])),n>=l
&&(this.b=n,i=this.f(),n=this.b);o--;)i[n]=i[n++-a];for(;8<=this.e;)this.e-
=8,this.c--;this.b=n},I.prototype.I=function(t,e){var
i=this.a,n=this.b;this.u=t;for(var r,s,a,o,l=i.length;256!
==(r=et(this,t));)if(256>r)n>=l&&(l=(i=this.f()).length),i[n++]=r;else for(o=z[s=r-
257],0<j[s]&&(o+=tt(this,j[s])),r=et(this,e),a=H[r],0<q[r]&&(a+=tt(this,q[r])),n+o>
l&&(l=(i=this.f()).length);o--;)i[n]=i[n++-a];for(;8<=this.e;)this.e-
=8,this.c--;this.b=n},I.prototype.f=function(){var t,e,i=new(s?Uint8Array:Array)
(this.b-32768),n=this.b-32768,r=this.a;if(s)i.set(r.subarray(32768,i.length));else
for(t=0,e=i.length;t<e;+
+t)i[t]=r[t+32768];if(this.k.push(i),this.q+=i.length,s)r.set(r.subarray(n,n+32768)
);else for(t=0;32768>t;++t)r[t]=r[n+t];return
this.b=32768,r},I.prototype.J=function(t){var e,i,n,r=this.input.length/this.c+1|
0,a=this.input,o=this.a;return t&&("number"==typeof t.v&&(r=t.v),"number"==typeof
t.F&&(r+=t.F)),2>r?i=(n=(a.length-this.c)/this.u[2]/2*258|0)<o.length?
o.length+n:o.length<<1:i=o.length*r,s?(e=new
Uint8Array(i)).set(o):e=o,this.a=e},I.prototype.t=function(){var
t,e,i,n,r,a=0,o=this.a,l=this.k,h=new(s?Uint8Array:Array)(this.q+(this.b-
32768));if(0===l.length)return s?
this.a.subarray(32768,this.b):this.a.slice(32768,this.b);for(e=0,i=l.length;e<i;+
+e)for(n=0,r=(t=l[e]).length;n<r;++n)h[a++]=t[n];for(e=32768,i=this.b;e<i;++e)h[a+
+]=o[e];return this.k=[],this.buffer=h},I.prototype.H=function(){var
t,e=this.b;return s?this.B?(t=new
Uint8Array(e)).set(this.a.subarray(0,e)):t=this.a.subarray(0,e):
(this.a.length>e&&(this.a.length=e),t=this.a),this.buffer=t},nt.prototype.p=functio
n(){var e,i=this.input;return e=this.A.p(),this.c=this.A.c,this.M&&((i[this.c+
+]<<24|i[this.c++]<<16|i[this.c++]<<8|i[this.c++])>>>0!==a(e)&&t(Error("invalid
adler-32
checksum"))),e},r("Zlib.Inflate",nt),r("Zlib.Inflate.BufferType",L),L.ADAPTIVE=L.C,
L.BLOCK=L.D,r("Zlib.Inflate.prototype.decompress",nt.prototype.p);s&&new
Uint16Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);s&&new
Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,
163,195,227,258,258,258]);s&&new
Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0]);s&&new
Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2
049,3073,4097,6145,8193,12289,16385,24577]);s&&new
Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);v
ar rt,st,at=new(s?Uint8Array:Array)(288);for(rt=0,st=at.length;rt<st;+
+rt)at[rt]=143>=rt?8:255>=rt?9:279>=rt?7:8;m(at);var ot,lt,ht=new(s?
Uint8Array:Array)(30);for(ot=0,lt=ht.length;ot<lt;++ot)ht[ot]=5;m(ht);var
ct=8}).call(window);var
n=window.Zlib;n.Deflate=n.Deflate,n.Deflate.compress=n.Deflate.compress,n.Inflate=n
.Inflate,n.Inflate.BufferType=n.Inflate.BufferType,n.Inflate.prototype.decompress=n
.Inflate.prototype.decompress,e.exports=n}),{}],26:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n,r,s,a,o,l,h,c,u,_,f,d,m,p,v,y,g,x,b,A,C,S,T,w=(function(){function t(t,e){for(var
i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!
0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return
function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}})
(),E=P(t("../../renderer/enums")),M=P(t("../../renderer/scene/light")),D=t("../valu
e-types"),B=t("../vmath");function P(t){return t&&t.__esModule?t:
{default:t}}function I(t,e,i,n){i&&Object.defineProperty(t,e,
{enumerable:i.enumerable,configurable:i.configurable,writable:i.writable,value:i.in
itializer?i.initializer.call(n):void 0})}function R(t,e){if(!(t instanceof e))throw
new TypeError("Cannot call a class as a function")}function O(t,e){if(!t)throw new
ReferenceError("this hasn't been initialised - super() hasn't been called");return!
e||"object"!=typeof e&&"function"!=typeof e?t:e}function L(t,e){if("function"!
=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a
function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:
{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?
Object.setPrototypeOf(t,e):t.__proto__=e)}function F(t,e,i,n,r){var s={};return
Object.keys(n).forEach((function(t){s[t]=n[t]})),s.enumerable=!!
s.enumerable,s.configurable=!!s.configurable,("value"in s||
s.initializer)&&(s.writable=!0),s=i.slice().reverse().reduce((function(i,n){return
n(t,e,i)||i}),s),r&&void 0!==s.initializer&&(s.value=s.initializer?
s.initializer.call(r):void 0,s.initializer=void 0),void
0===s.initializer&&(Object.defineProperty(t,e,s),s=null),s}var
V=t("../renderer/index"),N=t("../platform/CCEnum"),k=t("../components/CCComponent")
,G=t("../platform/CCClassDecorator"),z=G.ccclass,U=G.menu,j=G.inspector,W=G.propert
y,H=G.executeInEditMode,X=N({DIRECTIONAL:0,POINT:1,SPOT:2}),q=N({NONE:0,HARD:2}),Y=
(n=z("cc.Light"),r=U("i18n:MAIN_MENU.component.renderers/Light"),s=j("packages://in
spector/inspectors/comps/light.js"),a=W({type:X}),o=W({type:q}),n(l=r(l=H(l=s((T=S=
(function(t){function e(){R(this,e);var t=O(this,(e.__proto__||
Object.getPrototypeOf(e)).call(this));return

I(t,"_type",c,t),I(t,"_color",u,t),I(t,"_intensity",_,t),I(t,"_range",f,t),I(t,"_sp
otAngle",d,t),I(t,"_spotExp",m,t),I(t,"_shadowType",p,t),I(t,"_shadowResolution",v,
t),I(t,"_shadowDarkness",y,t),I(t,"_shadowMinDepth",g,t),I(t,"_shadowMaxDepth",x,t)
,I(t,"_shadowDepthScale",b,t),I(t,"_shadowFrustumSize",A,t),I(t,"_shadowBias",C,t),
t._light=new M.default,t}return L(e,k),w(e,[{key:"type",get:function(){return
this._type},set:function(t){this._type=t;var
e=E.default.LIGHT_DIRECTIONAL;this._type===X.POINT?
e=E.default.LIGHT_POINT:this._type===X.SPOT&&(e=E.default.LIGHT_SPOT),this._light.s
etType(e)}},{key:"color",get:function(){return this._color},set:function(t)
{this._color=t,this._light.setColor(t.r/255,t.g/255,t.b/255)}},
{key:"intensity",get:function(){return this._intensity},set:function(t)
{this._intensity=t,this._light.setIntensity(t)}},{key:"range",get:function(){return
this._range},set:function(t){this._range=t,this._light.setRange(t)}},
{key:"spotAngle",get:function(){return this._spotAngle},set:function(t)
{this._spotAngle=t,this._light.setSpotAngle((0,B.toRadian)(t))}},
{key:"spotExp",get:function(){return this._spotExp},set:function(t)
{this._spotExp=t,this._light.setSpotExp(t)}},{key:"shadowType",get:function()
{return this._shadowType},set:function(t){this._shadowType=t;var
e=E.default.SHADOW_NONE;t===q.HARD?
e=E.default.SHADOW_HARD:t===q.SOFT&&(e=E.default.SHADOW_SOFT),this._light.setShadow
Type(e)}},{key:"shadowResolution",get:function(){return
this._shadowResolution},set:function(t)
{this._shadowResolution=t,this._light.setShadowResolution(t)}},
{key:"shadowDarkness",get:function(){return this._shadowDarkness},set:function(t)
{this._shadowDarkness=t,this._light.setShadowDarkness(t)}},
{key:"shadowMinDepth",get:function(){return this._shadowMinDepth},set:function(t)
{this._shadowMinDepth=t,this._light.setShadowMinDepth(t)}},
{key:"shadowMaxDepth",get:function(){return this._shadowMaxDepth},set:function(t)
{this._shadowMaxDepth=t,this._light.setShadowMaxDepth(t)}},
{key:"shadowDepthScale",get:function(){return
this._shadowDepthScale},set:function(t)
{this._shadowDepthScale=t,this._light.setShadowDepthScale(t)}},
{key:"shadowFrustumSize",get:function(){return
this._shadowFrustumSize},set:function(t)
{this._shadowFrustumSize=t,this._light.setShadowFrustumSize(t)}}]),w(e,
[{key:"onLoad",value:function()
{this._light.setNode(this.node),this.type=this._type,this.color=this._color,this.in
tensity=this._intensity,this.range=this._range,this.spotAngle=this._spotAngle,this.
spotExp=this._spotExp,this.shadowType=this._shadowType,this.shadowResolution=this._
shadowResolution,this.shadowDarkness=this._shadowDarkness,this.shadowMaxDepth=this.
_shadowMaxDepth,this.shadowDepthScale=this._shadowDepthScale,this.shadowFrustumSize
=this._shadowFrustumSize,this.shadowBias=this._shadowBias}},
{key:"onEnable",value:function(){V.scene.addLight(this._light)}},
{key:"onDisable",value:function(){V.scene.removeLight(this._light)}}]),e})
(),S.Type=X,S.ShadowType=q,c=F((h=T).prototype,"_type",[W],{enumerable:!
0,initializer:function(){return X.DIRECTIONAL}}),u=F(h.prototype,"_color",[W],
{enumerable:!0,initializer:function(){return
D.Color.WHITE}}),_=F(h.prototype,"_intensity",[W],{enumerable:!
0,initializer:function(){return 1}}),f=F(h.prototype,"_range",[W],{enumerable:!
0,initializer:function(){return 1}}),d=F(h.prototype,"_spotAngle",[W],{enumerable:!
0,initializer:function(){return 60}}),m=F(h.prototype,"_spotExp",[W],{enumerable:!
0,initializer:function(){return 1}}),p=F(h.prototype,"_shadowType",[W],
{enumerable:!0,initializer:function(){return
q.NONE}}),v=F(h.prototype,"_shadowResolution",[W],{enumerable:!
0,initializer:function(){return 1024}}),y=F(h.prototype,"_shadowDarkness",[W],
{enumerable:!0,initializer:function()
{return.5}}),g=F(h.prototype,"_shadowMinDepth",[W],{enumerable:!
0,initializer:function(){return 1}}),x=F(h.prototype,"_shadowMaxDepth",[W],
{enumerable:!0,initializer:function(){return
4096}}),b=F(h.prototype,"_shadowDepthScale",[W],{enumerable:!
0,initializer:function(){return 250}}),A=F(h.prototype,"_shadowFrustumSize",[W],
{enumerable:!0,initializer:function(){return 1024}}),C=F(h.prototype,"_shadowBias",
[W],{enumerable:!0,initializer:function(){return 5e-4}}),F(h.prototype,"type",
[a],Object.getOwnPropertyDescriptor(h.prototype,"type"),h.prototype),F(h.prototype,
"color",
[W],Object.getOwnPropertyDescriptor(h.prototype,"color"),h.prototype),F(h.prototype
,"intensity",
[W],Object.getOwnPropertyDescriptor(h.prototype,"intensity"),h.prototype),F(h.proto
type,"range",
[W],Object.getOwnPropertyDescriptor(h.prototype,"range"),h.prototype),F(h.prototype
,"spotAngle",
[W],Object.getOwnPropertyDescriptor(h.prototype,"spotAngle"),h.prototype),F(h.proto
type,"spotExp",
[W],Object.getOwnPropertyDescriptor(h.prototype,"spotExp"),h.prototype),F(h.prototy
pe,"shadowType",
[o],Object.getOwnPropertyDescriptor(h.prototype,"shadowType"),h.prototype),F(h.prot
otype,"shadowResolution",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowResolution"),h.prototype),F(
h.prototype,"shadowDarkness",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowDarkness"),h.prototype),F(h.
prototype,"shadowMinDepth",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowMinDepth"),h.prototype),F(h.
prototype,"shadowMaxDepth",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowMaxDepth"),h.prototype),F(h.
prototype,"shadowDepthScale",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowDepthScale"),h.prototype),F(
h.prototype,"shadowFrustumSize",
[W],Object.getOwnPropertyDescriptor(h.prototype,"shadowFrustumSize"),h.prototype),l
=h))||l)||l)||l)||l);i.default=Y,cc.Light=Y,e.exports=i.default}),
{"../../renderer/enums":343,"../../renderer/scene/light":371,"../components/CCCompo
nent":95,"../platform/CCClassDecorator":201,"../platform/CCEnum":202,"../renderer/i
ndex":243,"../value-types":304,"../vmath":316}],27:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.Model",extends:cc.Asset,ctor:function()
{this._rootNode=null},properties:{_nodes:{default:[]},_precomputeJointMatrix:!
1,nodes:{get:function(){return this._nodes}},rootNode:{get:function(){return
this._rootNode}},precomputeJointMatrix:{get:function(){return
this._precomputeJointMatrix}}},onLoad:function(){var
t=this._nodes;this._rootNode=t[0];for(var e=0;e<t.length;e++){var
i=t[e];i.position=cc.v3.apply(this,i.position),i.scale=cc.v3.apply(this,i.scale),i.
quat=cc.quat.apply(this,i.quat),i.uniqueBindPose&&(i.uniqueBindPose=cc.mat4.apply(t
his,i.uniqueBindPose));var n=i.bindpose;if(n)for(var r in
n)n[r]=cc.mat4.apply(this,n[r]);var s=i.children;if(s)for(var a=0;a<s.length;a+
+)s[a]=t[s[a]]}}});cc.Model=e.exports=n}),{}],28:[(function(t,e,i){"use strict";var
n=cc.vmath.quat,r=cc.quat(),s=cc.v3();cc.Rotate3DTo=cc.Class({name:"cc.Rotate3DTo",
extends:cc.ActionInterval,ctor:function(t,e,i,n)
{this._startQuat=cc.quat(),this._dstQuat=cc.quat(),void 0!
==e&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n)
{if(cc.ActionInterval.prototype.initWithDuration.call(this,t)){var
r=this._dstQuat;return e instanceof cc.Quat?r.set(e):(e instanceof cc.Vec3?
(i=e.y,n=e.z,e=e.x):(i=i||0,n=n||0),cc.vmath.quat.fromEuler(r,e,i,n)),!0}return!
1},clone:function(){var t=new cc.Rotate3DTo;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._dstQuat),t},startW
ithTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._startQuat.set(t.qua
t)},reverse:function(){cc.logID(1016)},update:function(t)
{t=this._computeEaseTime(t),this.target&&(n.slerp(r,this._startQuat,this._dstQuat,t
),this.target.setRotation(r))}}),cc.rotate3DTo=function(t,e,i,n){return new
cc.Rotate3DTo(t,e,i,n)},cc.Rotate3DBy=cc.Class({name:"cc.Rotate3DBy",extends:cc.Act
ionInterval,ctor:function(t,e,i,n)
{this._angle=cc.v3(),this._quat=cc.quat(),this._lastDt=0,void 0!
==e&&this.initWithDuration(t,e,i,n)},initWithDuration:function(t,e,i,n){return!!
cc.ActionInterval.prototype.initWithDuration.call(this,t)&&(e instanceof cc.Vec3?
(i=e.y,n=e.z,e=e.x):(i=i||0,n=n||0),cc.vmath.vec3.set(this._angle,e,i,n),!
0)},clone:function(){var t=new cc.Rotate3DBy;return
this._cloneDecoration(t),t.initWithDuration(this._duration,this._angle),t},startWit
hTarget:function(t)
{cc.ActionInterval.prototype.startWithTarget.call(this,t),this._quat.set(t.quat),th
is._lastDt=0},update:(function(){var t=Math.PI/180;return function(e)
{if(e=this._computeEaseTime(e),this.target){var i=this._angle,r=this._quat,s=e-
this._lastDt,a=i.x,o=i.y,l=i.z;a&&n.rotateX(r,r,a*t*s),o&&n.rotateY(r,r,o*t*s),l&&n
.rotateZ(r,r,l*t*s),this.target.setRotation(r),this._lastDt=e}}})
(),reverse:function(){var t=this._angle;s.x=-t.x,s.y=-t.y,s.z=-t.z;var e=new
cc.Rotate3DBy(this._duration,s);return
this._cloneDecoration(e),this._reverseEaseList(e),e}}),cc.rotate3DBy=function(t,e,i
,n){return new cc.Rotate3DBy(t,e,i,n)}}),{}],29:[(function(t,e,i){"use
strict";t("./polyfill-
3d"),t("./primitive"),t("./CCModel"),t("./skeleton/CCSkeleton"),t("./skeleton/CCSke
letonAnimationClip"),t("./actions"),t("./skeleton/CCSkeletonAnimation"),t("./skelet
on/CCSkinnedMeshRenderer"),t("./skeleton/skinned-mesh-
renderer"),t("./CCLightComponent")}),
{"./CCLightComponent":26,"./CCModel":27,"./actions":28,"./polyfill-
3d":30,"./primitive":35,"./skeleton/CCSkeleton":44,"./skeleton/CCSkeletonAnimation"
:45,"./skeleton/CCSkeletonAnimationClip":46,"./skeleton/CCSkinnedMeshRenderer":47,"
./skeleton/skinned-mesh-renderer":48}],30:[(function(t,e,i){"use strict";var
n=t("../vmath"),r=t("../CCNode"),s=r.EventType,a=r._LocalDirtyFlag,o=t("../renderer
/render-flow"),l=Math.PI/180,h=1,c=2;function u(){if(this._localMatDirty){var
t=this._matrix;if(n.mat4.fromRTS(t,this._quat,this._position,this._scale),this._ske
wX||this._skewY){var
e=t.m00,i=t.m01,r=t.m04,s=t.m05,a=Math.tan(this._skewX*l),o=Math.tan(this._skewY*l)
;a===1/0&&(a=99999999),o===1/0&&(o=99999999),t.m00=e+r*o,t.m01=i+s*o,t.m04=r+e*a,t.
m05=s+i*a}this._localMatDirty=0,this._worldMatDirty=!0}}function _()
{if(this._localMatDirty&&this._updateLocalMatrix(),this._parent){var
t=this._parent._worldMatrix;n.mat4.mul(this._worldMatrix,t,this._matrix)}else
n.mat4.copy(this._worldMatrix,this._matrix);this._worldMatDirty=!1}function
f(t,e,i){var n=void 0;void 0===e?(n=t.x,e=t.y,i=t.z||0):(n=t,i=i||0);var
r=this._position;r.x===n&&r.y===e&&r.z===i||
(r.x=n,r.y=e,r.z=i,this.setLocalDirty(a.POSITION),this._renderFlag|
=o.FLAG_WORLD_TRANSFORM,this._eventMask&h&&this.emit(s.POSITION_CHANGED))}var
d=cc.Node.prototype,m=d._updateLocalMatrix,p=d._calculWorldMatrix,v=d._upgrade_1x_t
o_2x,y=d._mulMat;d.setPosition=f,d.setScale=function(t,e,i){t&&"number"!=typeof t?
(e=t.y,i=t.z||1,t=t.x):void 0!==t&&void 0===e?(e=t,i=t):void
0===i&&(i=1),this._scale.x===t&&this._scale.y===e&&this._scale.z===i||
(this._scale.x=t,this._scale.y=e,this._scale.z=i,this.setLocalDirty(a.SCALE),this._
renderFlag|
=o.FLAG_TRANSFORM,this._eventMask&c&&this.emit(s.SCALE_CHANGED))},d._upgrade_1x_to_
2x=function()
{this._is3DNode&&this._update3DFunction(),v.call(this)},d._update3DFunction=functio
n(){this._is3DNode?
(this._updateLocalMatrix=u,this._calculWorldMatrix=_,this._mulMat=n.mat4.mul):
(this._updateLocalMatrix=m,this._calculWorldMatrix=p,this._mulMat=y),this._renderCo
mponent&&this._renderComponent._on3DNodeChanged&&this._renderComponent._on3DNodeCha
nged(),this._renderFlag|
=o.FLAG_TRANSFORM,this._localMatDirty=a.ALL},cc.js.getset(d,"position",d.getPositio
n,f,!1,!0),cc.js.getset(d,"is3DNode",(function(){return this._is3DNode}),
(function(t){this._is3DNode!
==t&&(this._is3DNode=t,this._update3DFunction())})),cc.js.getset(d,"scaleZ",
(function(){return this._scale.z}),(function(t){this._scale.z!
==t&&(this._scale.z=t,this.setLocalDirty(a.SCALE),this._renderFlag|
=o.FLAG_TRANSFORM,this._eventMask&c&&this.emit(s.SCALE_CHANGED))})),cc.js.getset(d,
"z",(function(){return this._position.z}),(function(t){var e=this._position;t!
==e.z&&(e.z=t,this.setLocalDirty(a.POSITION),this._renderFlag|
=o.FLAG_WORLD_TRANSFORM,this._eventMask&h&&this.emit(s.POSITION_CHANGED))})),cc.js.
getset(d,"eulerAngles",(function(){return this._quat.toEuler(cc.v3())}),
(function(t)
{this._quat.fromEuler(t),this.setLocalDirty(a.ROTATION),this._renderFlag|
=o.FLAG_TRANSFORM})),cc.js.getset(d,"quat",(function(){return
this._quat}),d.setRotation)}),{"../CCNode":52,"../renderer/render-
flow":244,"../vmath":316}],31:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){var
t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:1,v=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},y=void
0!==v.widthSegments?v.widthSegments:1,g=void 0!==v.heightSegments?
v.heightSegments:1,x=void 0!==v.lengthSegments?v.lengthSegments:1,b=void 0!
==v.invWinding&&v.invWinding,A=.5*t,C=.5*e,S=.5*i,T=[n.vec3.set(h,-A,-
C,S),n.vec3.set(c,A,-C,S),n.vec3.set(u,A,C,S),n.vec3.set(_,-A,C,S),n.vec3.set(f,A,-
C,-S),n.vec3.set(d,-A,-C,-S),n.vec3.set(m,-A,C,-S),n.vec3.set(p,A,C,-
S)],w=[[2,3,1],[4,5,7],[7,6,2],[1,0,4],[1,4,2],[5,0,6]],E=[[0,0,1],[0,0,-1],
[0,1,0],[0,-1,0],[1,0,0],[-1,0,0]],M=[],D=[],B=[],P=[],I=n.vec3.create(-A,-C,-
S),R=n.vec3.create(A,C,S),O=Math.sqrt(A*A+C*C+S*S);function L(t,e,i){var r=void
0,h=void 0,c=void 0,u=void 0,_=M.length/3,f=w[t],d=E[t];for(u=0;u<=i;u+
+)for(c=0;c<=e;c+
+)if(r=c/e,h=u/i,n.vec3.lerp(s,T[f[0]],T[f[1]],r),n.vec3.lerp(a,T[f[0]],T[f[2]],h),
n.vec3.sub(o,a,T[f[0]]),n.vec3.add(l,s,o),M.push(l.x,l.y,l.z),D.push(d[0],d[1],d[2]
),B.push(r,h),c<e&&u<i){var m=e+1,p=c+u*m,v=c+(u+1)*m,y=c+1+(u+1)*m,g=c+1+u*m;b?
(P.push(_+p,_+v,_+g),P.push(_+g,_+v,_+y)):
(P.push(_+p,_+g,_+v),P.push(_+v,_+g,_+y))}}return
L(0,y,g),L(4,x,g),L(1,y,g),L(5,x,g),L(3,y,x),L(2,y,x),new
r.default(M,D,B,P,I,R,O)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0),o=n.vec3.create(0,0,0),l=n.vec3.creat
e(0,0,0),h=n.vec3.create(0,0,0),c=n.vec3.create(0,0,0),u=n.vec3.create(0,0,0),_=n.v
ec3.create(0,0,0),f=n.vec3.create(0,0,0),d=n.vec3.create(0,0,0),m=n.vec3.create(0,0
,0),p=n.vec3.create(0,0,0);e.exports=i.default}),{"../../vmath":316,"./vertex-
data":42}],32:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",
{value:!0}),i.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:.5,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:2,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=i-t-
e,h=o.sides||32,c=o.heightSegments||
32,u=e/i,_=l/i,f=t/i,d=Math.floor(c*u),m=Math.floor(c*f),p=Math.floor(c*_),v=l+e-
i/2,y=e-i/2,g=e-i/2,x=o.arc||
2*Math.PI,b=[],A=[],C=[],S=[],T=Math.max(t,e),w=n.vec3.create(-T,-i/2,-
T),E=n.vec3.create(T,i/2,T),M=i/2,D=0,B=[];return (function(){for(var t=0;t<=d;+
+t)for(var i=t*Math.PI/d/2,n=Math.sin(i),r=-Math.cos(i),s=0;s<=h;++s){var
a=2*s*Math.PI/h-
Math.PI/2,o=Math.sin(a),l=Math.cos(a),u=o*n,_=r,f=l*n,m=s/h,p=t/c;if(b.push(u*e,_*e
+g,f*e),A.push(u,_,f),C.push(m,p),t<d&&s<h){var
v=h+1,y=v*t+s,x=v*(t+1)+s,T=v*(t+1)+s+1,w=v*t+s+1;S.push(y,w,x),S.push(w,T,x)}+
+D}})(),(function(){for(var i=(t-e)/l,r=0;r<=p;r++){for(var o=[],c=r/p,f=c*(t-e)
+e,d=0;d<=h;++d){var m=d/h,v=c*_+u,g=m*x-
x/4,T=Math.sin(g),w=Math.cos(g);b.push(f*T),b.push(c*l+y),b.push(f*w),n.vec3.normal
ize(s,n.vec3.set(a,T,-
i,w)),A.push(s.x),A.push(s.y),A.push(s.z),C.push(m,v),o.push(D),+
+D}B.push(o)}for(var E=0;E<p;++E)for(var M=0;M<h;++M){var P=B[E][M],I=B[E+1]
[M],R=B[E+1][M+1],O=B[E]
[M+1];S.push(P),S.push(O),S.push(I),S.push(O),S.push(R),S.push(I)}})(),(function()
{for(var e=0;e<=m;++e)for(var i=e*Math.PI/m/2+Math.PI/2,n=Math.sin(i),r=-
Math.cos(i),s=0;s<=h;++s){var a=2*s*Math.PI/h-
Math.PI/2,o=Math.sin(a),l=Math.cos(a),u=o*n,_=r,d=l*n,y=s/h,g=e/c+(1-
f);if(b.push(u*t,_*t+v,d*t),A.push(u,_,d),C.push(y,g),e<m&&s<h){var
x=h+1,T=x*e+s+B[p][h]+1,w=x*(e+1)+s+B[p][h]+1,E=x*(e+1)+s+1+B[p][h]
+1,M=x*e+s+1+B[p][h]+1;S.push(T,M,w),S.push(M,E,w)}}})(),new
r.default(b,A,C,S,w,E,M)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0);e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],33:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){var
t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:
{};return(0,n.default)(0,t,e,i)};var n=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./cylinder"));e.exports=i.default}),{"./cylinder":34}],34:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:.5,i=arguments.length>2&&void 0!==arguments[2]?
arguments[2]:2,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:
{},l=.5*i,h=o.radialSegments||32,c=o.heightSegments||1,u=void 0===o.capped||
o.capped,_=o.arc||2*Math.PI,f=0;u||(t>0&&f++,e>0&&f++);var
d=(h+1)*(c+1);u&&(d+=(h+1)*f+h*f);var m=h*c*2*3;u&&(m+=h*f*3);var p=new
Array(m),v=new Array(3*d),y=new Array(3*d),g=new
Array(2*d),x=Math.max(t,e),b=n.vec3.create(-x,-l,-
x),A=n.vec3.create(x,l,x),C=Math.sqrt(x*x+l*l),S=0,T=0;return (function(){for(var
r=[],o=t-e,u=o*o/i*Math.sign(o),f=0;f<=c;f++){for(var d=[],m=f/c,x=m*o+e,b=0;b<=h;+
+b){var A=b/h,C=A*_,w=Math.sin(C),E=Math.cos(C);v[3*S]=x*w,v[3*S+1]=m*i-
l,v[3*S+2]=x*E,n.vec3.normalize(s,n.vec3.set(a,w,-
u,E)),y[3*S]=s.x,y[3*S+1]=s.y,y[3*S+2]=s.z,g[2*S]=2*(1-A)%1,g[2*S+1]=m,d.push(S),+
+S}r.push(d)}for(var M=0;M<c;++M)for(var D=0;D<h;++D){var B=r[M][D],P=r[M+1]
[D],I=r[M+1][D+1],R=r[M][D+1];p[T]=B,p[++T]=R,p[++T]=P,p[++T]=R,p[++T]=I,p[++T]=P,+
+T}})(),u&&(e>0&&w(!1),t>0&&w(!0)),new r.default(v,y,g,p,b,A,C);function w(i){var
n,r,s=i?t:e,a=i?1:-1;n=S;for(var o=1;o<=h;+
+o)v[3*S]=0,v[3*S+1]=l*a,v[3*S+2]=0,y[3*S]=0,y[3*S+1]=a,y[3*S+2]=0,g[2*S]=.5,g[2*S+
1]=.5,++S;r=S;for(var c=0;c<=h;++c){var
u=c/h*_,f=Math.cos(u),d=Math.sin(u);v[3*S]=s*d,v[3*S+1]=l*a,v[3*S+2]=s*f,y[3*S]=0,y
[3*S+1]=a,y[3*S+2]=0,g[2*S]=.5-.5*d*a,g[2*S+1]=.5+.5*f,++S}for(var m=0;m<h;++m){var
x=n+m,b=r+m;i?(p[T]=b+1,p[++T]=x,p[++T]=b,++T):(p[T]=x,p[++T]=b+1,p[++T]=b,+
+T)}}};var n=t("../../vmath"),r=(function(t){return t&&t.__esModule?t:{default:t}})
(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0);e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],35:[(function(t,e,i){"use strict";var
n=f(t("./utils")),r=f(t("./box")),s=f(t("./cone")),a=f(t("./cylinder")),o=f(t("./pl
ane")),l=f(t("./quad")),h=f(t("./sphere")),c=f(t("./torus")),u=f(t("./capsule")),_=
t("./polyhedron");function f(t){return t&&t.__esModule?t:
{default:t}}cc.primitive=Object.assign({box:r.default,cone:s.default,cylinder:a.def
ault,plane:o.default,quad:l.default,sphere:h.default,torus:c.default,capsule:u.defa
ult,polyhedron:_.polyhedron,PolyhedronType:_.PolyhedronType},n.default)}),
{"./box":31,"./capsule":32,"./cone":33,"./cylinder":34,"./plane":36,"./polyhedron":
37,"./quad":38,"./sphere":39,"./torus":40,"./utils":41}],36:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){var
t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:10,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:10,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},_=void
0!==i.widthSegments?i.widthSegments:10,f=void 0!==i.lengthSegments?
i.lengthSegments:10,d=.5*t,m=.5*e,p=[],v=[],y=[],g=[],x=n.vec3.create(-d,0,-
m),b=n.vec3.create(d,0,m),A=Math.sqrt(t*t+e*e);n.vec3.set(h,-
d,0,m),n.vec3.set(c,d,0,m),n.vec3.set(u,-d,0,-m);for(var C=0;C<=f;C++)for(var
S=0;S<=_;S++){var
T=S/_,w=C/f;if(n.vec3.lerp(s,h,c,T),n.vec3.lerp(a,h,u,w),n.vec3.sub(o,a,h),n.vec3.a
dd(l,s,o),p.push(l.x,l.y,l.z),v.push(0,1,0),y.push(T,w),S<_&&C<f){var
E=_+1,M=S+C*E,D=S+(C+1)*E,B=S+1+
(C+1)*E,P=S+1+C*E;g.push(M,P,D),g.push(P,B,D)}}return new
r.default(p,v,y,g,x,b,A)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));var
s=n.vec3.create(0,0,0),a=n.vec3.create(0,0,0),o=n.vec3.create(0,0,0),l=n.vec3.creat
e(0,0,0),h=n.vec3.create(0,0,0),c=n.vec3.create(0,0,0),u=n.vec3.create(0,0,0);e.exp
orts=i.default}),{"../../vmath":316,"./vertex-data":42}],37:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.polyhedron=i.PolyhedronType=void 0;var
n=t("./utils"),r=t("../../vmath"),s=(function(t){return t&&t.__esModule?t:
{default:t}})(t("./vertex-
data"));i.PolyhedronType=cc.Enum({Tetrahedron:0,Octahedron:1,Dodecahedron:2,Icosahe
dron:3,Rhombicuboctahedron:4,TriangularPrism:5,PentagonalPrism:6,HexagonalPrism:7,S
quarePyramid:8,PentagonalPyramid:9,TriangularDipyramid:10,PentagonalDipyramid:11,El
ongatedSquareDipyramid:12,ElongatedPentagonalDipyramid:13,ElongatedPentagonalCupola
:14});var a=[];a[0]={vertex:[[0,0,1.732051],[1.632993,0,-.5773503],
[-.8164966,1.414214,-.5773503],[-.8164966,-1.414214,-.5773503]],face:[[0,1,2],
[0,2,3],[0,3,1],[1,3,2]]},a[1]={vertex:[[0,0,1.414214],[1.414214,0,0],
[0,1.414214,0],[-1.414214,0,0],[0,-1.414214,0],[0,0,-1.414214]],face:[[0,1,2],
[0,2,3],[0,3,4],[0,4,1],[1,4,5],[1,5,2],[2,5,3],[3,5,4]]},a[2]={vertex:
[[0,0,1.070466],[.7136442,0,.7978784],[-.3568221,.618034,.7978784],
[-.3568221,-.618034,.7978784],[.7978784,.618034,.3568221],
[.7978784,-.618034,.3568221],[-.9341724,.381966,.3568221],[.1362939,1,.3568221],
[.1362939,-1,.3568221],[-.9341724,-.381966,.3568221],[.9341724,.381966,-.3568221],
[.9341724,-.381966,-.3568221],[-.7978784,.618034,-.3568221],
[-.1362939,1,-.3568221],[-.1362939,-1,-.3568221],[-.7978784,-.618034,-.3568221],
[.3568221,.618034,-.7978784],[.3568221,-.618034,-.7978784],[-.7136442,0,-.7978784],
[0,0,-1.070466]],face:[[0,1,4,7,2],[0,2,6,9,3],[0,3,8,5,1],[1,5,11,10,4],
[2,7,13,12,6],[3,9,15,14,8],[4,10,16,13,7],[5,8,14,17,11],[6,12,18,15,9],
[10,11,17,19,16],[12,13,16,19,18],[14,15,18,19,17]]},a[3]={vertex:[[0,0,1.175571],
[1.051462,0,.5257311],[.3249197,1,.5257311],[-.8506508,.618034,.5257311],
[-.8506508,-.618034,.5257311],[.3249197,-1,.5257311],[.8506508,.618034,-.5257311],
[.8506508,-.618034,-.5257311],[-.3249197,1,-.5257311],[-1.051462,0,-.5257311],
[-.3249197,-1,-.5257311],[0,0,-1.175571]],face:[[0,1,2],[0,2,3],[0,3,4],[0,4,5],
[0,5,1],[1,5,7],[1,7,6],[1,6,2],[2,6,8],[2,8,3],[3,8,9],[3,9,4],[4,9,10],[4,10,5],
[5,10,7],[6,7,11],[6,11,8],[7,10,11],[8,11,9],[9,11,10]]},a[4]={vertex:
[[0,0,1.070722],[.7148135,0,.7971752],[-.104682,.7071068,.7971752],
[-.6841528,.2071068,.7971752],[-.104682,-.7071068,.7971752],
[.6101315,.7071068,.5236279],[1.04156,.2071068,.1367736],
[.6101315,-.7071068,.5236279],[-.3574067,1,.1367736],[-.7888348,-.5,.5236279],
[-.9368776,.5,.1367736],[-.3574067,-1,.1367736],[.3574067,1,-.1367736],
[.9368776,-.5,-.1367736],[.7888348,.5,-.5236279],[.3574067,-1,-.1367736],
[-.6101315,.7071068,-.5236279],[-1.04156,-.2071068,-.1367736],
[-.6101315,-.7071068,-.5236279],[.104682,.7071068,-.7971752],
[.6841528,-.2071068,-.7971752],[.104682,-.7071068,-.7971752],
[-.7148135,0,-.7971752],[0,0,-1.070722]],face:[[0,2,3],[1,6,5],[4,9,11],[7,15,13],
[8,16,10],[12,14,19],[17,22,18],[20,21,23],[0,1,5,2],[0,3,9,4],[0,4,7,1],
[1,7,13,6],[2,5,12,8],[2,8,10,3],[3,10,17,9],[4,11,15,7],[5,6,14,12],[6,13,20,14],
[8,12,19,16],[9,17,18,11],[10,16,22,17],[11,18,21,15],[13,15,21,20],[14,20,23,19],
[16,19,23,22],[18,22,23,21]]},a[5]={vertex:[[0,0,1.322876],[1.309307,0,.1889822],
[-.9819805,.8660254,.1889822],[.1636634,-1.299038,.1889822],
[.3273268,.8660254,-.9449112],[-.8183171,-.4330127,-.9449112]],face:[[0,3,1],
[2,4,5],[0,1,4,2],[0,2,5,3],[1,3,5,4]]},a[6]={vertex:[[0,0,1.159953],
[1.013464,0,.5642542],[-.3501431,.9510565,.5642542],[-.7715208,-.6571639,.5642542],
[.6633206,.9510565,-.03144481],[.8682979,-.6571639,-.3996071],[-
1.121664,.2938926,-.03144481],[-.2348831,-1.063314,-.3996071],
[.5181548,.2938926,-.9953061],[-.5850262,-.112257,-.9953061]],face:[[0,1,4,2],
[0,2,6,3],[1,5,8,4],[3,6,9,7],[5,7,9,8],[0,3,7,5,1],[2,4,8,9,6]]},a[7]={vertex:
[[0,0,1.118034],[.8944272,0,.6708204],[-.2236068,.8660254,.6708204],
[-.7826238,-.4330127,.6708204],[.6708204,.8660254,.2236068],
[1.006231,-.4330127,-.2236068],[-1.006231,.4330127,.2236068],
[-.6708204,-.8660254,-.2236068],[.7826238,.4330127,-.6708204],
[.2236068,-.8660254,-.6708204],[-.8944272,0,-.6708204],[0,0,-1.118034]],face:
[[0,1,4,2],[0,2,6,3],[1,5,8,4],[3,6,10,7],[5,9,11,8],[7,10,11,9],[0,3,7,9,5,1],
[2,4,8,11,10,6]]},a[8]={vertex:[[-.729665,.670121,.319155],
[-.655235,-.29213,-.754096],[-.093922,-.607123,.537818],[.702196,.595691,.485187],
[.776626,-.36656,-.588064]],face:[[1,4,2],[0,1,2],[3,0,2],[4,3,2],
[4,1,0,3]]},a[9]={vertex:[[-.868849,-.100041,.61257],[-.329458,.976099,.28078],
[-.26629,-.013796,-.477654],[-.13392,-1.034115,.229829],[.738834,.707117,-.307018],
[.859683,-.535264,-.338508]],face:[[3,0,2],[5,3,2],[4,5,2],[1,4,2],[0,1,2],
[0,3,5,4,1]]},a[10]={vertex:[[-.610389,.243975,.531213],
[-.187812,-.48795,-.664016],[-.187812,.9759,-.664016],[.187812,-.9759,.664016],
[.798201,.243975,.132803]],face:[[1,3,0],[3,4,0],[3,1,4],[0,2,1],[0,4,2],
[2,4,1]]},a[11]={vertex:[[-1.028778,.392027,-.048786],[-.640503,-.646161,.621837],
[-.125162,-.395663,-.540059],[.004683,.888447,-.651988],[.125161,.395663,.540059],
[.632925,-.791376,.433102],[1.031672,.157063,-.354165]],face:[[3,2,0],[2,1,0],
[2,5,1],[0,4,3],[0,1,4],[4,1,5],[2,3,6],[3,4,6],[5,2,6],[4,5,6]]},a[12]={vertex:
[[-.669867,.334933,-.529576],[-.669867,.334933,.529577],[-.4043,1.212901,0],
[-.334933,-.669867,-.529576],[-.334933,-.669867,.529577],
[.334933,.669867,-.529576],[.334933,.669867,.529577],[.4043,-1.212901,0],
[.669867,-.334933,-.529576],[.669867,-.334933,.529577]],face:[[8,9,7],[6,5,2],
[3,8,7],[5,0,2],[4,3,7],[0,1,2],[9,4,7],[1,6,2],[9,8,5,6],[8,3,0,5],[3,4,1,0],
[4,9,6,1]]},a[13]={vertex:[[-.931836,.219976,-.264632],[-.636706,.318353,.692816],
[-.613483,-.735083,-.264632],[-.326545,.979634,0],[-.318353,-.636706,.692816],
[-.159176,.477529,-.856368],[.159176,-.477529,-.856368],[.318353,.636706,.692816],
[.326545,-.979634,0],[.613482,.735082,-.264632],[.636706,-.318353,.692816],
[.931835,-.219977,-.264632]],face:[[11,10,8],[7,9,3],[6,11,8],[9,5,3],[2,6,8],
[5,0,3],[4,2,8],[0,1,3],[10,4,8],[1,7,3],[10,11,9,7],[11,6,5,9],[6,2,0,5],
[2,4,1,0],[4,10,7,1]]},a[14]={vertex:[[-.93465,.300459,-.271185],
[-.838689,-.260219,-.516017],[-.711319,.717591,.128359],
[-.710334,-.156922,.080946],[-.599799,.556003,-.725148],
[-.503838,-.004675,-.969981],[-.487004,.26021,.48049],[-.460089,-.750282,-.512622],
[-.376468,.973135,-.325605],[-.331735,-.646985,.084342],[-.254001,.831847,.530001],
[-.125239,-.494738,-.966586],[.029622,.027949,.730817],[.056536,-.982543,-.262295],
[.08085,1.087391,.076037],[.125583,-.532729,.485984],[.262625,.599586,.780328],
[.391387,-.726999,-.716259],[.513854,-.868287,.139347],[.597475,.85513,.326364],
[.641224,.109523,.783723],[.737185,-.451155,.538891],[.848705,-.612742,-.314616],
[.976075,.365067,.32976],[1.072036,-.19561,.084927]],face:[[15,18,21],[12,20,16],
[6,10,2],[3,0,1],[9,7,13],[2,8,4,0],[0,4,5,1],[1,5,11,7],[7,11,17,13],
[13,17,22,18],[18,22,24,21],[21,24,23,20],[20,23,19,16],[16,19,14,10],[10,14,8,2],
[15,9,13,18],[12,15,21,20],[6,12,16,10],[3,6,2,0],[9,3,1,7],[9,15,12,6,3],
[22,17,11,5,4,8,14,19,23,24]]};i.polyhedron=function(t){var
e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:
{};t=t&&(t<0||t>=a.length)?0:t||0;for(var o=i.sizeX||e,l=i.sizeY||e,h=i.sizeZ||
e,c=a[t],u=c.face.length,_=[],f=[],d=[],m=[],p=r.vec3.create(1/0,1/0,1/0),v=r.vec3.
create(-1/0,-1/0,-1/0),y=0;y<c.vertex.length;y++){var g=c.vertex[y]
[0]*o,x=c.vertex[y][1]*l,b=c.vertex[y]
[2]*h;p.x=Math.min(p.x,g),p.y=Math.min(p.y,x),p.z=Math.min(p.z,b),v.x=Math.max(v.x,
g),v.y=Math.max(v.y,x),v.z=Math.max(v.z,b),_.push(g,x,b),m.push(0,0)}for(var
A=0;A<u;A++)for(var C=0;C<c.face[A].length-2;C++)f.push(c.face[A][0],c.face[A]
[C+2],c.face[A][C+1]);(0,n.calcNormals)(_,f,d);var S=Math.sqrt(Math.pow(v.x-
p.x,2),Math.pow(v.y-p.y,2),Math.pow(v.z-p.z,2));return new
s.default(_,d,m,f,p,v,S)}}),{"../../vmath":316,"./utils":41,"./vertex-
data":42}],38:[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",
{value:!0}),i.default=function(){return new r.default(s,l,a,o,h,c,u)};var
n=t("../../vmath"),r=(function(t){return t&&t.__esModule?t:{default:t}})
(t("./vertex-data"));var
s=[-.5,-.5,0,-.5,.5,0,.5,.5,0,.5,-.5,0],a=[0,0,1,0,0,1,0,0,1,0,0,1],o=[0,0,0,1,1,1,
1,0],l=[0,3,1,3,2,1],h=n.vec3.create(-.5,-.5,0),c=n.vec3.create(.5,.5,0),u=Math.sqr
t(.5);e.exports=i.default}),{"../../vmath":316,"./vertex-data":42}],39:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.5,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=void
0!==e.segments?e.segments:32,s=[],a=[],o=[],l=[],h=n.vec3.create(-t,-t,-
t),c=n.vec3.create(t,t,t),u=t,_=0;_<=i;++_)for(var f=_*Math.PI/i,d=Math.sin(f),m=-
Math.cos(f),p=0;p<=i;++p){var v=2*p*Math.PI/i-
Math.PI/2,y=Math.sin(v)*d,g=m,x=Math.cos(v)*d,b=p/i,A=_/i;if(s.push(y*t,g*t,x*t),a.
push(y,g,x),o.push(b,A),_<i&&p<i){var
C=i+1,S=C*_+p,T=C*(_+1)+p,w=C*(_+1)+p+1,E=C*_+p+1;l.push(S,E,T),l.push(E,w,T)}}retu
rn new r.default(s,l,a,o,h,c,u)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],40:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function()
{for(var t=arguments.length>0&&void 0!==arguments[0]?
arguments[0]:.4,e=arguments.length>1&&void 0!==arguments[1]?
arguments[1]:.1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:
{},s=i.radialSegments||32,a=i.tubularSegments||32,o=i.arc||
2*Math.PI,l=[],h=[],c=[],u=[],_=n.vec3.create(-t-e,-e,-t-
e),f=n.vec3.create(t+e,e,t+e),d=t+e,m=0;m<=s;m++)for(var
p=0;p<=a;p++){var
v=p/a,y=m/s,g=v*o,x=y*Math.PI*2,b=(t+e*Math.cos(x))*Math.sin(g),A=e*Math.sin(x),C=(
t+e*Math.cos(x))*Math.cos(g),S=Math.sin(g)*Math.cos(x),T=Math.sin(x),w=Math.cos(g)*
Math.cos(x);if(l.push(b,A,C),h.push(S,T,w),c.push(v,y),p<a&&m<s){var
E=a+1,M=E*m+p,D=E*(m+1)+p,B=E*(m+1)+p+1,P=E*m+p+1;u.push(M,P,D),u.push(P,B,D)}}retu
rn new r.default(l,h,c,u,_,f,d)};var n=t("../../vmath"),r=(function(t){return
t&&t.__esModule?t:{default:t}})(t("./vertex-data"));e.exports=i.default}),
{"../../vmath":316,"./vertex-data":42}],41:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.wireframe=function(t)
{for(var e=[[0,1],[1,2],[2,0]],i=[],n={},r=0;r<t.length;r+=3)for(var s=0;s<3;++s)
{var a=t[r+e[s][0]],o=t[r+e[s][1]],l=a>o?o<<16|a:a<<16|o;void
0===n[l]&&(n[l]=0,i.push(a,o))}return i},i.invWinding=function(t){for(var
e=[],i=0;i<t.length;i+=3)e.push(t[i],t[i+2],t[i+1]);return
e},i.toWavefrontOBJ=function(t){for(var e=arguments.length>1&&void 0!
==arguments[1]?
arguments[1]:1,i=t.positions,n=t.uvs,r=t.normals,s=t.indices,a=function(t){return
s[t]+1+"/"+(s[t]+1)+"/"+(s[t]+1)},o="",l=0;l<i.length;l+=3)o+="v "+i[l]*e+"
"+i[l+1]*e+" "+i[l+2]*e+"\n";for(var h=0;h<n.length;h+=2)o+="vt "+n[h]+"
"+n[h+1]+"\n";for(var c=0;c<r.length;c+=3)o+="vn "+r[c]+" "+r[c+1]+"
"+r[c+2]+"\n";for(var u=0;u<s.length;u+=3)o+="f "+a(u)+" "+a(u+1)+"
"+a(u+2)+"\n";return o},i.normals=function(t,e){for(var i=arguments.length>2&&void
0!==arguments[2]?arguments[2]:1,n=new Array(2*t.length),r=0;r<t.length/3;++r){var
s=3*r,a=6*r;n[a+0]=t[s+0],n[a+1]=t[s+1],n[a+2]=t[s+2],n[a+3]=t[s+0]+e[s+0]*i,n[a+4]
=t[s+1]+e[s+1]*i,n[a+5]=t[s+2]+e[s+2]*i}return n},i.calcNormals=function(t,e,i)
{for(var s=0,a=(i=i||new Array(t.length)).length;s<a;s++)i[s]=0;for(var o=void
0,l=void 0,h=void
0,c=cc.v3(),u=cc.v3(),_=cc.v3(),f=cc.v3(),d=cc.v3(),m=0,p=e.length;m<p;m+=3)o=3*e[m
+0],l=3*e[m+1],h=3*e[m+2],r(c,t,o),r(u,t,l),r(_,t,h),n.vec3.sub(f,_,u),n.vec3.sub(d
,c,u),n.vec3.cross(f,f,d),i[o]+=f.x,i[o+1]+=f.y,i[o+2]+=f.z,i[l]
+=f.x,i[l+1]+=f.y,i[l+2]+=f.z,i[h]+=f.x,i[h+1]+=f.y,i[h+2]+=f.z;for(var
v=cc.v3(),y=0,g=i.length;y<g;y+=3)v.x=i[y],v.y=i[y+1],v.z=i[y+2],v.normalizeSelf(),
i[y]=v.x,i[y+1]=v.y,i[y+2]=v.z;return i};var n=t("../../vmath");function r(t,e,i)
{t.x=e[i],t.y=e[i+1],t.z=e[i+2]}}),{"../../vmath":316}],42:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(t,e,i,n,r,s,a)
{this.positions=t,this.normals=e,this.uvs=i,this.indices=n,this.minPos=r,this.maxPo
s=s,this.boundingRadius=a},e.exports=i.default}),{}],43:[(function(t,e,i){"use
strict";var n=t("../../../animation/animation-
curves"),r=n.DynamicAnimCurve,s=n.quickFindIndex,a=cc.Class({name:"cc.JointMatrixCu
rve",extends:r,_findFrameIndex:s,sample:function(t,e){var
i=this.ratios,n=this._findFrameIndex(i,e);n<-1&&(n=~n-1);for(var
r=this.pairs,s=0;s<r.length;s++){var
a=r[s];a.target._jointMatrix=a.values[n]}}});e.exports=a}),
{"../../../animation/animation-curves":11}],44:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Skeleton",extends:cc.Asset,ctor:function()
{this._bindposes=[],this._uniqueBindPoses=[],this._jointPaths=[]},properties:
{_model:cc.Model,_jointIndices:[],_skinIndex:-1,jointPaths:{get:function(){return
this._jointPaths}},bindposes:{get:function(){return
this._bindposes}},uniqueBindPoses:{get:function(){return
this._uniqueBindPoses}},model:{get:function(){return
this._model}}},onLoad:function(){for(var
t=this._model.nodes,e=this._jointIndices,i=this._jointPaths,n=this._bindposes,r=thi
s._uniqueBindPoses,s=0;s<e.length;s++){var a=t[e[s]];i[s]=a.path,a.uniqueBindPose?
n[s]=r[s]=a.uniqueBindPose:n[s]=a.bindpose[this._skinIndex]}}});cc.Skeleton=e.expor
ts=n}),{}],45:[(function(t,e,i){"use strict";var
n=t("../../components/CCAnimation"),r=t("../CCModel"),s=t("./CCSkeletonAnimationCli
p"),a=cc.Class({name:"cc.SkeletonAnimation",extends:n,editor:!1,properties:{_model:
{default:null,type:r},_defaultClip:{override:!0,default:null,type:s},_clips:
{override:!0,default:[],type:[s],visible:!0},defaultClip:{override:!
0,get:function(){return this._defaultClip},set:function(t)
{this._defaultClip=t},type:s},model:{get:function(){return
this._model},set:function(t)
{this._model=t,this._updateClipModel()},type:r}},__preload:function()
{this._updateClipModel()},_updateClipModel:function()
{this._defaultClip&&(this._defaultClip._model=this._model);for(var
t=this._clips,e=0;e<t.length;e++)t[e]._model=this._model},addClip:function(t,e)
{return t._model=this._model,n.prototype.addClip.call(this,t,e)},searchClips:!
1});cc.SkeletonAnimation=e.exports=a}),
{"../../components/CCAnimation":90,"../CCModel":27,"./CCSkeletonAnimationClip":46,"
fire-path":void 0}],46:[(function(t,e,i){"use strict";var n=(function(t){return
t&&t.__esModule?t:{default:t}})(t("../../vmath/mat4"));var
r=t("../../../animation/animation-clip"),s=t("./CCJointMatrixCurve");function a(t)
{var e=new Float32Array(16);return
e[0]=t.m00,e[1]=t.m01,e[2]=t.m02,e[3]=t.m03,e[4]=t.m04,e[5]=t.m05,e[6]=t.m06,e[7]=t
.m07,e[8]=t.m08,e[9]=t.m09,e[10]=t.m10,e[11]=t.m11,e[12]=t.m12,e[13]=t.m13,e[14]=t.
m14,e[15]=t.m15,e}var
o=cc.Class({name:"cc.SkeletonAnimationClip",extends:r,properties:{_nativeAsset:
{override:!0,get:function(){return this._buffer},set:function(t){var
e=ArrayBuffer.isView(t)?t.buffer:t;this._buffer=new Float32Array(e||
t,0,e.byteLength/4)}},description:{default:null,type:Object},curveData:{visible:!
1,override:!0,get:function(){return this._curveData||{}},set:function()
{}}},_init:function(){return this._curveData?this._curveData:
(this._curveData={},this._generateCommonCurve(),this._model.precomputeJointMatrix&&
this._generateJointMatrixCurve(),this._curveData)},_generateCommonCurve:function()
{var t=this._buffer,e=this.description,i=0;function n(){return t[i+
+]}this._curveData.paths||(this._curveData.paths={});var
r=this._curveData.paths;for(var s in e){var a=e[s],o={};for(var l in
r[s]={props:o},a){var h=[],c=a[l].frameCount;i=a[l].offset;for(var u=0;u<c;u++){var
_=n(),f=void 0;"position"===l||"scale"===l?
f=cc.v3(n(),n(),n()):"quat"===l&&(f=cc.quat(n(),n(),n(),n())),h.push({frame:_,value
:f})}o[l]=h}}},_generateJointMatrixCurve:function(){var
t=this._model.rootNode,e=this._curveData.paths,i={ratios:[],jointMatrixMap:
{}},r=i.jointMatrixMap;function s(i,o,l){var h=void 0;if(i!==t){var
c=e[i.path].props;for(var u in c)for(var _=c[u],f=0;f<_.length;f++){var
d=_[f];if(Math.abs(d.frame-o)<1e-4){i[u].set(d.value);break}if(d.frame>o){var
m=_[f-1],p=(o-m.frame)/(d.frame-
m.frame);m.value.lerp(d.value,p,i[u]);break}}h=n.default.create(),n.default.fromRTS
(h,i.quat,i.position,i.scale),l&&n.default.mul(h,l,h),c._jointMatrix||
(c._jointMatrix=[]);var v=void
0;i.uniqueBindPose&&(v=n.default.create(),n.default.mul(v,h,i.uniqueBindPose)),r[i.
path]||(r[i.path]=[]),v?r[i.path].push(a(v)):r[i.path].push(h)}var
y=i.children;for(var g in y){s(y[g],o,h)}}for(var
o=0,l=this.duration,h=1/this.sample;o<l;)i.ratios.push(o/l),s(t,o),o+=h;this._curve
Data=i},_createJointMatrixCurve:function(t,e){var i=new
s;i.ratios=this.curveData.ratios,i.pairs=[];var
n=this.curveData.jointMatrixMap;for(var r in n){var
a=cc.find(r,e);a&&i.pairs.push({target:a,values:n[r]})}return[i]},createCurves:func
tion(t,e){return this._model?(this._init(),this._model.precomputeJointMatrix?
this._createJointMatrixCurve(t,e):r.prototype.createCurves.call(this,t,e)):
(cc.warn("Skeleton Animation Clip ["+this.name+"] Can not find model"),
[])}});cc.SkeletonAnimationClip=e.exports=o}),{"../../../animation/animation-
clip":10,"../../vmath/mat4":320,"./CCJointMatrixCurve":43}],47:[(function(t,e,i)
{"use strict";var
n=t("./CCSkeleton"),r=t("../../mesh/CCMeshRenderer"),s=t("../../renderer/render-
flow"),a=cc.vmath.mat4,o=a.create(),l=new
cc.Node,h=cc.Class({name:"cc.SkinnedMeshRenderer",extends:r,editor:!
1,ctor:function()
{this._jointsData=null,this._jointsTexture=null,this._joints=[]},properties:
{_skeleton:n,_rootBone:cc.Node,skeleton:{get:function(){return
this._skeleton},set:function(t)
{this._skeleton=t,this._init(),this._activateMaterial(!0)},type:n},rootBone:
{get:function(){return this._rootBone},set:function(t)
{this._rootBone=t,this._init()},type:cc.Node}},_activateMaterial:function(t)
{this._jointsData?this._super(t):this.disableRender()},__preload:function()
{this._init()},_init:function()
{this._model=this._skeleton&&this._skeleton.model,this._initJoints(),this._initJoin
tsTexture()},_calcWorldMatrixToRoot:function(t){var e=t._worldMatrixToRoot;if(!e)
{t._worldMatrixToRoot=e=cc.mat4(),t.getLocalMatrix(e);var i=t.parent;i!
==this.rootBone&&(i._worldMatrixToRoot||
this._calcWorldMatrixToRoot(i),a.mul(e,i._worldMatrixToRoot,e))}},_initJoints:funct
ion(){var t=this._joints;if(t.length=0,this.skeleton&&this.rootBone){for(var
e=this._useJointMatrix(),i=this.skeleton.jointPaths,n=this.rootBone,r=0;r<i.length;
r++){var l=cc.find(i[r],n);l||cc.warn("Can not find joint in root bone [%s] with
path
[%s]",n.name,i[r]),e&&(l._renderFlag&=~s.FLAG_CHILDREN,this._calcWorldMatrixToRoot(
l)),t.push(l)}if(e)for(var h=this.skeleton.uniqueBindPoses,c=0;c<i.length;c++){var
u=t[c];h[c]?
(a.mul(o,u._worldMatrixToRoot,h[c]),u._jointMatrix=a.array([],o)):u._jointMatrix=u.
_worldMatrixToRoot}}},_initJointsTexture:function(){if(this._skeleton){var
t=this._joints.length,e=this._customProperties,i=!!
cc.sys.glExtension("OES_texture_float");if(i){var n=void 0;n=t>256?64:t>64?32:t>16?
16:8,this._jointsData=new Float32Array(n*n*4);var r=this._jointsTexture||new
cc.Texture2D;r.initWithData(this._jointsData,cc.Texture2D.PixelFormat.RGBA32F,n,n),
this._jointsTexture=r,e.setProperty("_jointsTexture",r.getImpl()),e.setProperty("_j
ointsTextureSize",this._jointsTexture.width)}else this._jointsData=new
Float32Array(16*t),e.define("_JOINT_MATRICES_SIZE",t),e.setProperty("_jointMatrices
",this._jointsData);e.define("_USE_SKINNING",!
0),e.define("_USE_JOINTS_TEXTRUE",i)}},_setJointsDataWithArray:function(t,e)
{this._jointsData.set(e,16*t)},_setJointsDataWithMatrix:function(t,e){var

i=this._jointsData;i[16*t+0]=e.m00,i[16*t+1]=e.m01,i[16*t+2]=e.m02,i[16*t+3]=e.m03,
i[16*t+4]=e.m04,i[16*t+5]=e.m05,i[16*t+6]=e.m06,i[16*t+7]=e.m07,i[16*t+8]=e.m08,i[1
6*t+9]=e.m09,i[16*t+10]=e.m10,i[16*t+11]=e.m11,i[16*t+12]=e.m12,i[16*t+13]=e.m13,i[
16*t+14]=e.m14,i[16*t+15]=e.m15},_commitJointsData:function()
{this._jointsTexture&&this._jointsTexture.update({image:this._jointsData})},_useJoi
ntMatrix:function(){return
this._model&&this._model.precomputeJointMatrix},getRenderNode:function(){return
this._useJointMatrix()?this.rootBone:l},calcJointMatrix:function()
{if(this.skeleton&&this.rootBone){var
t=this._joints,e=this.skeleton.bindposes,i=this.skeleton.uniqueBindPoses;if(this._u
seJointMatrix())for(var n=0;n<t.length;++n){var r=t[n]._jointMatrix;i[n]?
this._setJointsDataWithArray(n,r):
(a.multiply(o,r,e[n]),this._setJointsDataWithMatrix(n,o))}else for(var
s=0;s<t.length;++s){var
l=t[s];l._updateWorldMatrix(),a.multiply(o,l._worldMatrix,e[s]),this._setJointsData
WithMatrix(s,o)}this._commitJointsData()}}});cc.SkinnedMeshRenderer=e.exports=h}),
{"../../mesh/CCMeshRenderer":167,"../../renderer/render-
flow":244,"./CCSkeleton":44}],48:[(function(t,e,i){"use strict";var
n=t("./CCSkinnedMeshRenderer"),r=t("../../mesh/mesh-
renderer"),s=cc.js.addon({fillBuffers:function(t,e)
{t.calcJointMatrix(),r.fillBuffers(t,e)}},r);e.exports=n._assembler=s}),
{"../../mesh/mesh-renderer":170,"./CCSkinnedMeshRenderer":47}],49:[(function(t,e,i)
{"use strict";t("../../DebugInfos");var n="https://github.com/cocos-
creator/engine/blob/master/EngineErrorMap.md",r=void
0;cc.log=cc.warn=cc.error=cc.assert=console.log;function s(t){return function(){var
e=arguments[0],i=t+" "+e+", please go to "+n+"#"+e+" to see
details.";if(1===arguments.length)return i;if(2===arguments.length)return i+"
Arguments: "+arguments[1];var r=cc.js.shiftArguments.apply(null,arguments);return
i+" Arguments: "+r.join(", ")}}cc._throw=function(t){var e=t.stack;e?
cc.error(e):cc.error(t)};var a=s("Log");cc.logID=function()
{cc.log(a.apply(null,arguments))};var o=s("Warning");cc.warnID=function()
{cc.warn(o.apply(null,arguments))};var l=s("Error");cc.errorID=function()
{cc.error(l.apply(null,arguments))};var h=s("Assert");cc.assertID=function(t){t||
cc.assert(!1,h.apply(null,cc.js.shiftArguments.apply(null,arguments)))};var
c=cc.Enum({NONE:0,INFO:1,WARN:2,ERROR:3,INFO_FOR_WEB_PAGE:4,WARN_FOR_WEB_PAGE:5,ERR
OR_FOR_WEB_PAGE:6});e.exports=cc.debug={DebugMode:c,_resetDebugSetting:function(t)
{if(cc.log=cc.warn=cc.error=cc.assert=function(){},t!==c.NONE){if(t>c.ERROR){var
e=function(t){if(cc.game.canvas){if(!r){var
e=document.createElement("Div");e.setAttribute("id","logInfoDiv"),e.setAttribute("w
idth","200"),e.setAttribute("height",cc.game.canvas.height);var
i=e.style;i.zIndex="99999",i.position="absolute",i.top=i.left="0",
(r=document.createElement("textarea")).setAttribute("rows","20"),r.setAttribute("co
ls","30"),r.setAttribute("disabled","true");var
n=r.style;n.backgroundColor="transparent",n.borderBottom="1px solid
#cccccc",n.borderTopWidth=n.borderLeftWidth=n.borderRightWidth="0px",n.borderTopSty
le=n.borderLeftStyle=n.borderRightStyle="none",n.padding="0px",n.margin=0,e.appendC
hild(r),cc.game.canvas.parentNode.appendChild(e)}r.value=r.value+t+"\r\n",r.scrollT
op=r.scrollHeight}};cc.error=function(){e("ERROR :
"+cc.js.formatStr.apply(null,arguments))},cc.assert=function(t,i){!
t&&i&&(i=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments)),e("
ASSERT: "+i))},t!==c.ERROR_FOR_WEB_PAGE&&(cc.warn=function(){e("WARN :
"+cc.js.formatStr.apply(null,arguments))}),t===c.INFO_FOR_WEB_PAGE&&(cc.log=functio
n(){e(cc.js.formatStr.apply(null,arguments))})}else
console&&console.log.apply&&(console.error||
(console.error=console.log),console.warn||
(console.warn=console.log),console.error.bind?
cc.error=console.error.bind(console):cc.error=function(){return
console.error.apply(console,arguments)},cc.assert=function(t,e){if(!t)throw
e&&(e=cc.js.formatStr.apply(null,cc.js.shiftArguments.apply(null,arguments))),new
Error(e)});t!==c.ERROR&&(console.warn.bind?
cc.warn=console.warn.bind(console):cc.warn=function(){return
console.warn.apply(console,arguments)}),t===c.INFO&&(console.log.bind?
cc.log=console.log.bind(console):cc.log=function(){return
console.log.apply(console,arguments)})}},getError:s("ERROR"),isDisplayStats:functio
n(){return!!cc.profiler&&cc.profiler.isShowingStats()},setDisplayStats:function(t)
{cc.profiler&&(t?
cc.profiler.showStats():cc.profiler.hideStats(),cc.game.config.showFPS=!!t)}}}),
{"../../DebugInfos":void 0}],50:[(function(t,e,i){"use strict";var
n=t("./event/event-target"),r=t("./load-pipeline/auto-release-
utils"),s=t("./component-scheduler"),a=t("./node-
activator"),o=t("./platform/CCObject"),l=t("./CCGame"),h=t("./renderer"),c=t("./eve
nt-manager"),u=t("./CCScheduler");cc.Director=function()
{n.call(this),this.invalid=!1,this._paused=!1,this._purgeDirectorInNextLoop=!
1,this._winSizeInPoints=null,this._loadingScene="",this._scene=null,this._totalFram
es=0,this._lastUpdate=0,this._deltaTime=0,this._scheduler=null,this._compScheduler=
null,this._nodeActivator=null,this._actionManager=null;var
t=this;l.on(l.EVENT_SHOW,(function()
{t._lastUpdate=performance.now()})),l.once(l.EVENT_ENGINE_INITED,this.init,this)},c
c.Director.prototype={constructor:cc.Director,init:function(){return
this._totalFrames=0,this._lastUpdate=performance.now(),this._paused=!
1,this._purgeDirectorInNextLoop=!
1,this._winSizeInPoints=cc.size(0,0),this._scheduler=new u,cc.ActionManager?
(this._actionManager=new
cc.ActionManager,this._scheduler.scheduleUpdate(this._actionManager,u.PRIORITY_SYST
EM,!1)):this._actionManager=null,this.sharedInit(),!0},sharedInit:function()
{this._compScheduler=new s,this._nodeActivator=new a,c&&c.setEnabled(!
0),cc.AnimationManager?(this._animationManager=new
cc.AnimationManager,this._scheduler.scheduleUpdate(this._animationManager,u.PRIORIT
Y_SYSTEM,!1)):this._animationManager=null,cc.CollisionManager?
(this._collisionManager=new
cc.CollisionManager,this._scheduler.scheduleUpdate(this._collisionManager,u.PRIORIT
Y_SYSTEM,!1)):this._collisionManager=null,cc.PhysicsManager?
(this._physicsManager=new
cc.PhysicsManager,this._scheduler.scheduleUpdate(this._physicsManager,u.PRIORITY_SY
STEM,!
1)):this._physicsManager=null,cc._widgetManager&&cc._widgetManager.init(this),cc.lo
ader.init(this)},calculateDeltaTime:function(t){t||
(t=performance.now()),this._deltaTime=(t-
this._lastUpdate)/1e3,this._lastUpdate=t},convertToGL:function(t){var
e=l.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-
e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,a=i._devicePixelRatio*(t.x-
r),o=i._devicePixelRatio*(s+n.height-t.y);return i._isRotated?
cc.v2(i._viewportRect.width-o,a):cc.v2(a,o)},convertToUI:function(t){var
e=l.container,i=cc.view,n=e.getBoundingClientRect(),r=n.left+window.pageXOffset-
e.clientLeft,s=n.top+window.pageYOffset-e.clientTop,a=cc.v2(0,0);return
i._isRotated?(a.x=r+t.y/i._devicePixelRatio,a.y=s+n.height-(i._viewportRect.width-
t.x)/i._devicePixelRatio):(a.x=r+t.x*i._devicePixelRatio,a.y=s+n.height-
t.y*i._devicePixelRatio),a},end:function(){this._purgeDirectorInNextLoop=!
0},getWinSize:function(){return cc.size(cc.winSize)},getWinSizeInPixels:function()
{return cc.size(cc.winSize)},pause:function(){this._paused||(this._paused=!
0)},purgeCachedData:function(){cc.loader.releaseAll()},purgeDirector:function()
{this._scheduler.unscheduleAll(),this._compScheduler.unscheduleAll(),this._nodeActi
vator.reset(),c&&c.setEnabled(!
1),cc.renderer.clear(),cc.isValid(this._scene)&&this._scene.destroy(),this._scene=n
ull,this.stopAnimation(),cc.loader.releaseAll()},reset:function()
{this.purgeDirector(),c&&c.setEnabled(!
0),this._actionManager&&this._scheduler.scheduleUpdate(this._actionManager,cc.Sched
uler.PRIORITY_SYSTEM,!
1),this._animationManager&&this._scheduler.scheduleUpdate(this._animationManager,cc
.Scheduler.PRIORITY_SYSTEM,!
1),this._collisionManager&&this._scheduler.scheduleUpdate(this._collisionManager,cc
.Scheduler.PRIORITY_SYSTEM,!
1),this._physicsManager&&this._scheduler.scheduleUpdate(this._physicsManager,cc.Sch
eduler.PRIORITY_SYSTEM,!1),this.startAnimation()},runSceneImmediate:function(t,e,i)
{cc.assertID(t instanceof cc.Scene,1216),t._load();for(var
n=Object.keys(l._persistRootNodes).map((function(t){return
l._persistRootNodes[t]})),s=0;s<n.length;s++){var
a=n[s],h=t.getChildByUuid(a.uuid);if(h){var
c=h.getSiblingIndex();h._destroyImmediate(),t.insertChild(a,c)}else a.parent=t}var
u=this._scene,_=u&&u.autoReleaseAssets&&u.dependAssets;r.autoRelease(_,t.dependAsse
ts,n),cc.isValid(u)&&u.destroy(),this._scene=null,o._deferredDestroy(),e&&e(),this.
emit(cc.Director.EVENT_BEFORE_SCENE_LAUNCH,t),this._scene=t,t._activate(),this.star
tAnimation(),i&&i(null,t),this.emit(cc.Director.EVENT_AFTER_SCENE_LAUNCH,t)},runSce
ne:function(t,e,i){cc.assertID(t,1205),cc.assertID(t instanceof
cc.Scene,1216),t._load(),this.once(cc.Director.EVENT_AFTER_UPDATE,(function()
{this.runSceneImmediate(t,e,i)}),this)},_getSceneUuid:function(t){var
e=l._sceneInfos;if("string"==typeof t){t.endsWith(".fire")||
(t+=".fire"),"/"===t[0]||t.startsWith("db://")||(t="/"+t);for(var i=0;i<e.length;i+
+){var n=e[i];if(n.url.endsWith(t))return n}}else if("number"==typeof t)
{if(0<=t&&t<e.length)return e[t];cc.errorID(1206,t)}else cc.errorID(1207,t);return
null},loadScene:function(t,e,i){if(this._loadingScene)return
cc.errorID(1208,t,this._loadingScene),!1;var n=this._getSceneUuid(t);if(n){var
r=n.uuid;return
this.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING,t),this._loadingScene=t,this._load
SceneByUuid(r,e,i),!0}return cc.errorID(1209,t),!1},preloadScene:function(t,e,i)
{void 0===i&&(i=e,e=null);var
n=this._getSceneUuid(t);if(n)this.emit(cc.Director.EVENT_BEFORE_SCENE_LOADING,t),cc
.loader.load({uuid:n.uuid,type:"uuid"},e,(function(e,n)
{e&&cc.errorID(1210,t,e.message),i&&i(e,n)}));else{var r='Can not preload the scene
"'+t+'" because it is not
in the build settings.';i(new Error(r)),cc.error("preloadScene:
"+r)}},_loadSceneByUuid:function(t,e,i,n){console.time("LoadScene
"+t),cc.AssetLibrary.loadAsset(t,(function(n,r){console.timeEnd("LoadScene "+t);var
s=cc.director;if(s._loadingScene="",n)n="Failed to load scene:
"+n,cc.error(n);else{if(r instanceof cc.SceneAsset){var a=r.scene;return
a._id=r._uuid,a._name=r._name,void s.runSceneImmediate(a,i,e)}n="The asset "+t+" is
not a scene",cc.error(n)}e&&e(n)}))},resume:function()
{this._paused&&(this._lastUpdate=performance.now(),this._lastUpdate||
cc.logID(1200),this._paused=!1,this._deltaTime=0)},setDepthTest:function(t)
{cc.Camera.main&&(cc.Camera.main.depth=!!t)},setClearColor:function(t)
{cc.Camera.main&&(cc.Camera.main.backgroundColor=t)},getRunningScene:function()
{return this._scene},getScene:function(){return
this._scene},getAnimationInterval:function(){return
1e3/l.getFrameRate()},setAnimationInterval:function(t)
{l.setFrameRate(Math.round(1e3/t))},getDeltaTime:function(){return
this._deltaTime},getTotalFrames:function(){return
this._totalFrames},isPaused:function(){return this._paused},getScheduler:function()
{return this._scheduler},setScheduler:function(t){this._scheduler!
==t&&(this._scheduler=t)},getActionManager:function(){return
this._actionManager},setActionManager:function(t){this._actionManager!
==t&&(this._actionManager&&this._scheduler.unscheduleUpdate(this._actionManager),th
is._actionManager=t,this._scheduler.scheduleUpdate(this._actionManager,cc.Scheduler
.PRIORITY_SYSTEM,!1))},getAnimationManager:function(){return
this._animationManager},getCollisionManager:function(){return
this._collisionManager},getPhysicsManager:function(){return
this._physicsManager},startAnimation:function(){this.invalid=!
1,this._lastUpdate=performance.now()},stopAnimation:function(){this.invalid=!
0},mainLoop:function(t){this._purgeDirectorInNextLoop?
(this._purgeDirectorInNextLoop=!1,this.purgeDirector()):this.invalid||
(this.calculateDeltaTime(t),this._paused||
(this.emit(cc.Director.EVENT_BEFORE_UPDATE),this._compScheduler.startPhase(),this._
compScheduler.updatePhase(this._deltaTime),this._scheduler.update(this._deltaTime),
this._compScheduler.lateUpdatePhase(this._deltaTime),this.emit(cc.Director.EVENT_AF
TER_UPDATE),o._deferredDestroy()),this.emit(cc.Director.EVENT_BEFORE_DRAW),h.render
(this._scene),this.emit(cc.Director.EVENT_AFTER_DRAW),c.frameUpdateListeners(),this
._totalFrames++)},__fastOn:function(t,e,i)
{this.add(t,e,i)},__fastOff:function(t,e,i)
{this.remove(t,e,i)}},cc.js.addon(cc.Director.prototype,n.prototype),cc.Director.EV
ENT_PROJECTION_CHANGED="director_projection_changed",cc.Director.EVENT_BEFORE_SCENE
_LOADING="director_before_scene_loading",cc.Director.EVENT_BEFORE_SCENE_LAUNCH="dir
ector_before_scene_launch",cc.Director.EVENT_AFTER_SCENE_LAUNCH="director_after_sce
ne_launch",cc.Director.EVENT_BEFORE_UPDATE="director_before_update",cc.Director.EVE
NT_AFTER_UPDATE="director_after_update",cc.Director.EVENT_BEFORE_VISIT="director_be
fore_draw",cc.Director.EVENT_AFTER_VISIT="director_before_draw",cc.Director.EVENT_B
EFORE_DRAW="director_before_draw",cc.Director.EVENT_AFTER_DRAW="director_after_draw
",cc.Director.PROJECTION_2D=0,cc.Director.PROJECTION_3D=1,cc.Director.PROJECTION_CU
STOM=3,cc.Director.PROJECTION_DEFAULT=cc.Director.PROJECTION_2D,cc.director=new
cc.Director,e.exports=cc.director}),{"./CCGame":51,"./CCScheduler":55,"./component-
scheduler":89,"./event-manager":130,"./event/event-target":132,"./load-
pipeline/auto-release-utils":150,"./node-
activator":171,"./platform/CCObject":206,"./renderer":243}],51:[(function(t,e,i)
{"use strict";var n=t("./event/event-target");t("../audio/CCAudioEngine");var
r=t("./CCDebug"),s=t("./renderer/index.js"),a=t("./platform/CCInputManager"),o=t(".
./core/renderer/utils/dynamic-
atlas/manager"),l={EVENT_HIDE:"game_on_hide",EVENT_SHOW:"game_on_show",EVENT_RESTAR
T:"game_on_restart",EVENT_GAME_INITED:"game_inited",EVENT_ENGINE_INITED:"engine_ini
ted",EVENT_RENDERER_INITED:"engine_inited",RENDER_TYPE_CANVAS:0,RENDER_TYPE_WEBGL:1
,RENDER_TYPE_OPENGL:2,_persistRootNodes:{},_paused:!0,_configLoaded:!1,_isCloning:!
1,_prepared:!1,_rendererInitialized:!
1,_renderContext:null,_intervalId:null,_lastTime:null,_frameTime:null,_sceneInfos:
[],frame:null,container:null,canvas:null,renderType:-
1,config:null,onStart:null,setFrameRate:function(t)
{this.config.frameRate=t,this._intervalId&&window.cancelAnimFrame(this._intervalId)
,this._intervalId=0,this._paused=!
0,this._setAnimFrame(),this._runMainLoop()},getFrameRate:function(){return
this.config.frameRate},step:function(){cc.director.mainLoop()},pause:function()
{this._paused||(this._paused=!
0,cc.audioEngine&&cc.audioEngine._break(),cc.director.stopAnimation(),this._interva
lId&&window.cancelAnimFrame(this._intervalId),this._intervalId=0)},resume:function(
){this._paused&&(this._paused=!
1,cc.audioEngine&&cc.audioEngine._restore(),cc.director.startAnimation(),this._runM
ainLoop())},isPaused:function(){return this._paused},restart:function()
{cc.director.once(cc.Director.EVENT_AFTER_DRAW,(function(){for(var t in
l._persistRootNodes)l.removePersistRootNode(l._persistRootNodes[t]);cc.director.get
Scene().destroy(),cc.Object._deferredDestroy(),cc.director.purgeDirector(),cc.audio
Engine&&cc.audioEngine.uncacheAll(),cc.director.reset(),l.onStart(),l.emit(l.EVENT_
RESTART)}))},end:function(){close()},_initEngine:function()
{this._rendererInitialized||
(this._initRenderer(),this._initEvents(),this.emit(this.EVENT_ENGINE_INITED))},_pre
pareFinished:function(t){var e=this;this._prepared=!
0,this._initEngine(),cc.AssetLibrary._loadBuiltins((function(){console.log("Cocos
Creator
v"+cc.ENGINE_VERSION),e._setAnimFrame(),e._runMainLoop(),e.emit(e.EVENT_GAME_INITED
),t&&t()}))},eventTargetOn:n.prototype.on,eventTargetOnce:n.prototype.once,on:funct
ion(t,e,i){this._prepared&&t===this.EVENT_ENGINE_INITED||!
this._paused&&t===this.EVENT_GAME_INITED?
e.call(i):this.eventTargetOn(t,e,i)},once:function(t,e,i)
{this._prepared&&t===this.EVENT_ENGINE_INITED||!
this._paused&&t===this.EVENT_GAME_INITED?
e.call(i):this.eventTargetOnce(t,e,i)},prepare:function(t)
{if(this._prepared)t&&t();else{var e=this.config.jsList;if(e&&e.length>0){var
i=this;cc.loader.load(e,(function(e){if(e)throw new
Error(JSON.stringify(e));i._prepareFinished(t)}))}else
this._prepareFinished(t)}},run:function(t,e)
{this._initConfig(t),this.onStart=e,this.prepare(l.onStart&&l.onStart.bind(l))},add
PersistRootNode:function(t){if(cc.Node.isNode(t)&&t.uuid){var e=t.uuid;if(!
this._persistRootNodes[e]){var i=cc.director._scene;if(cc.isValid(i))if(t.parent)
{if(!(t.parent instanceof cc.Scene))return void cc.warnID(3801);if(t.parent!
==i)return void cc.warnID(3802)}else
t.parent=i;this._persistRootNodes[e]=t,t._persistNode=!0}}else
cc.warnID(3800)},removePersistRootNode:function(t){var
e=t.uuid||"";t===this._persistRootNodes[e]&&(delete
this._persistRootNodes[e],t._persistNode=!1)},isPersistRootNode:function(t){return
t._persistNode},_setAnimFrame:function(){this._lastTime=performance.now();var
t=l.config.frameRate;this._frameTime=1e3/t,60!==t&&30!==t?
(window.requestAnimFrame=this._stTime,window.cancelAnimFrame=this._ctTime):
(window.requestAnimFrame=window.requestAnimationFrame||
window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||
window.oRequestAnimationFrame||window.msRequestAnimationFrame||
this._stTime,window.cancelAnimFrame=window.cancelAnimationFrame||
window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||
window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||
window.webkitCancelRequestAnimationFrame||window.msCancelAnimationFrame||
window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||
window.oCancelAnimationFrame||this._ctTime)},_stTime:function(t){var
e=performance.now(),i=Math.max(0,l._frameTime-(e-
l._lastTime)),n=window.setTimeout((function(){t()}),i);return
l._lastTime=e+i,n},_ctTime:function(t)
{window.clearTimeout(t)},_runMainLoop:function(){var
t,e=this,i=e.config,n=cc.director,s=!
0,a=i.frameRate;r.setDisplayStats(i.showFPS),t=function(i){if(!e._paused)
{if(e._intervalId=window.requestAnimFrame(t),30===a&&(s=!
s))return;n.mainLoop(i)}},e._intervalId=window.requestAnimFrame(t),e._paused=!
1},_initConfig:function(t){"number"!=typeof
t.debugMode&&(t.debugMode=0),t.exposeClassName=!!t.exposeClassName,"number"!=typeof
t.frameRate&&(t.frameRate=60);var e=t.renderMode;("number"!=typeof e||e>2||
e<0)&&(t.renderMode=0),"boolean"!=typeof
t.registerSystemEvent&&(t.registerSystemEvent=!0),t.showFPS=!!
t.showFPS,this._sceneInfos=t.scenes||[],this.collisionMatrix=t.collisionMatrix||
[],this.groupList=t.groupList||
[],r._resetDebugSetting(t.debugMode),this.config=t,this._configLoaded=!
0},_determineRenderType:function(){var t=this.config,e=parseInt(t.renderMode)||
0;this.renderType=this.RENDER_TYPE_CANVAS;var i=!1;if(0===e?
cc.sys.capabilities.opengl?(this.renderType=this.RENDER_TYPE_WEBGL,i=!
0):cc.sys.capabilities.canvas&&(this.renderType=this.RENDER_TYPE_CANVAS,i=!
0):1===e&&cc.sys.capabilities.canvas?(this.renderType=this.RENDER_TYPE_CANVAS,i=!
0):2===e&&cc.sys.capabilities.opengl&&(this.renderType=this.RENDER_TYPE_WEBGL,i=!
0),!i)throw new Error(r.getError(3820,e))},_initRenderer:function(){if(!
this._rendererInitialized){var t=this.config.id,e=void 0,i=void 0,n=void 0,r=void
0,a=t instanceof HTMLElement?t:document.querySelector(t)||
document.querySelector("#"+t);if("CANVAS"===a.tagName?
(e=a.width,i=a.height,this.canvas=n=a,this.container=r=document.createElement("DIV"
),n.parentNode&&n.parentNode.insertBefore(r,n)):("DIV"!
==a.tagName&&cc.warnID(3819),e=a.clientWidth,i=a.clientHeight,this.canvas=n=documen
t.createElement("CANVAS"),this.container=r=document.createElement("DIV"),a.appendCh
ild(r)),r.setAttribute("id","Cocos2dGameContainer"),r.appendChild(n),this.frame=r.p
arentNode===document.body?document.documentElement:r.parentNode,(function(t,e){("
"+t.className+" ").indexOf(" "+e+" ")>-1||(t.className&&(t.className+="
"),t.className+=e)})(n,"gameCanvas"),n.setAttribute("width",e||
480),n.setAttribute("height",i||
320),n.setAttribute("tabindex",99),this._determineRenderType(),this.renderType===th
is.RENDER_TYPE_WEBGL){var l={stencil:!
0,antialias:cc.macro.ENABLE_WEBGL_ANTIALIAS,alpha:cc.macro.ENABLE_TRANSPARENT_CANVA
S};0,s.initWebGL(n,l),this._renderContext=s.device._gl,!
cc.macro.CLEANUP_IMAGE_CACHE&&o&&(o.enabled=!0)}this._renderContext||
(this.renderType=this.RENDER_TYPE_CANVAS,s.initCanvas(n),this._renderContext=s.devi
ce._ctx),this.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!
1},this._rendererInitialized=!0}},_initEvents:function(){var
t,e=window;this.config.registerSystemEvent&&a.registerSystemEvent(this.canvas),void
0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!
==document.msHidden?t="msHidden":void 0!
==document.webkitHidden&&(t="webkitHidden");var i=!1;function n(){i||(i=!
0,l.emit(l.EVENT_HIDE))}function r(t,e,n,r,s){i&&(i=!
1,l.emit(l.EVENT_SHOW,t,e,n,r,s))}if(t)for(var
s=["visibilitychange","mozvisibilitychange","msvisibilitychange","webkitvisibilityc
hange","qbrowserVisibilityChange"],o=0;o<s.length;o+
+)document.addEventListener(s[o],(function(e){var i=document[t];(i=i||e.hidden)?
n():r()}));else
e.addEventListener("blur",n),e.addEventListener("focus",r);navigator.userAgent.inde
xOf("MicroMessenger")>-1&&(e.onfocus=r),"onpageshow"in window&&"onpagehide"in
window&&(e.addEventListener("pagehide",n),e.addEventListener("pageshow",r),document
.addEventListener("pagehide",n),document.addEventListener("pageshow",r)),this.on(l.
EVENT_HIDE,(function(){l.pause()})),this.on(l.EVENT_SHOW,(function()
{l.resume()}))}};n.call(l),cc.js.addon(l,n.prototype),cc.game=e.exports=l}),
{"../audio/CCAudioEngine":21,"../core/renderer/utils/dynamic-
atlas/manager":246,"./CCDebug":49,"./event/event-
target":132,"./platform/BKInputManager":198,"./platform/CCInputManager":204,"./rend
erer/index.js":243}],52:[(function(t,e,i){"use strict";var
n=t("./vmath"),r=t("./utils/base-node"),s=t("./utils/prefab-
helper"),a=t("./utils/math-pools"),o=t("./utils/affine-transform"),l=t("./event-
manager"),h=t("./platform/CCMacro"),c=t("./platform/js"),u=(t("./event/event"),t(".
/event/event-target")),_=t("./renderer/render-
flow"),f=cc.Object.Flags.Destroying,d=Math.PI/180,m=!!cc.ActionManager,p=function()
{},v=cc.v2(),y=cc.v2(),g=n.mat4.create(),x=n.vec3.create(),b=n.quat.create(),A=new
Array(16);A.length=0;var
C=cc.Enum({DEBUG:31}),S=cc.Enum({POSITION:1,SCALE:2,ROTATION:4,SKEW:8,RT:7,ALL:6553
5}),T=cc.Enum({TOUCH_START:"touchstart",TOUCH_MOVE:"touchmove",TOUCH_END:"touchend"
,TOUCH_CANCEL:"touchcancel",MOUSE_DOWN:"mousedown",MOUSE_MOVE:"mousemove",MOUSE_ENT
ER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_UP:"mouseup",MOUSE_WHEEL:"mousewheel
",POSITION_CHANGED:"position-changed",ROTATION_CHANGED:"rotation-
changed",SCALE_CHANGED:"scale-changed",SIZE_CHANGED:"size-
changed",ANCHOR_CHANGED:"anchor-changed",COLOR_CHANGED:"color-
changed",CHILD_ADDED:"child-added",CHILD_REMOVED:"child-
removed",CHILD_REORDER:"child-reorder",GROUP_CHANGED:"group-
changed"}),w=[T.TOUCH_START,T.TOUCH_MOVE,T.TOUCH_END,T.TOUCH_CANCEL],E=[T.MOUSE_DOW
N,T.MOUSE_ENTER,T.MOUSE_MOVE,T.MOUSE_LEAVE,T.MOUSE_UP,T.MOUSE_WHEEL],M=null,D=funct
ion(t,e){var i=t.getLocation(),n=this.owner;return!!
n._hitTest(i,this)&&(e.type=T.TOUCH_START,e.touch=t,e.bubbles=!
0,n.dispatchEvent(e),!0)},B=function(t,e){var
i=this.owner;e.type=T.TOUCH_MOVE,e.touch=t,e.bubbles=!
0,i.dispatchEvent(e)},P=function(t,e){var
i=t.getLocation(),n=this.owner;n._hitTest(i,this)?
e.type=T.TOUCH_END:e.type=T.TOUCH_CANCEL,e.touch=t,e.bubbles=!
0,n.dispatchEvent(e)},I=function(t,e){t.getLocation();var
i=this.owner;e.type=T.TOUCH_CANCEL,e.touch=t,e.bubbles=!
0,i.dispatchEvent(e)},R=function(t){var
e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=T.MOUSE_DOWN,t.bubbles=!
0,i.dispatchEvent(t))},O=function(t){var
e=t.getLocation(),i=this.owner;if(i._hitTest(e,this))this._previousIn||
(M&&M._mouseListener&&(t.type=T.MOUSE_LEAVE,M.dispatchEvent(t),M._mouseListener._pr
eviousIn=!
1),M=this.owner,t.type=T.MOUSE_ENTER,i.dispatchEvent(t),this._previousIn=!
0),t.type=T.MOUSE_MOVE,t.bubbles=!0,i.dispatchEvent(t);else{if(!
this._previousIn)return;t.type=T.MOUSE_LEAVE,i.dispatchEvent(t),this._previousIn=!
1,M=null}t.stopPropagation()},L=function(t){var
e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=T.MOUSE_UP,t.bubbles=!
0,i.dispatchEvent(t),t.stopPropagation())},F=function(t){var
e=t.getLocation(),i=this.owner;i._hitTest(e,this)&&(t.type=T.MOUSE_WHEEL,t.bubbles=
!0,i.dispatchEvent(t),t.stopPropagation())};function V(t){var
e=cc.Mask;if(e)for(var i=0,n=t;n&&cc.Node.isNode(n);n=n._parent,+
+i)if(n.getComponent(e))return{index:i,node:n};return null}function N(t,e){if(!
(t._objFlags&f)){var i=0;if(t._bubblingListeners)for(;i<e.length;+
+i)if(t._bubblingListeners.hasEventListener(e[i]))return!
0;if(t._capturingListeners)for(;i<e.length;+
+i)if(t._capturingListeners.hasEventListener(e[i]))return!0;return!1}return!
0}function k(t,e){var
i,n;for(e.target=t,A.length=0,t._getCapturingTargets(e.type,A),e.eventPhase=1,n=A.l
ength-1;n>=0;--
n)if((i=A[n])._capturingListeners&&(e.currentTarget=i,i._capturingListeners.emit(e.
type,e,A),e._propagationStopped))return
void(A.length=0);if(A.length=0,e.eventPhase=2,e.currentTarget=t,t._capturingListene
rs&&t._capturingListeners.emit(e.type,e),!
e._propagationImmediateStopped&&t._bubblingListeners&&t._bubblingListeners.emit(e.t
ype,e),!
e._propagationStopped&&e.bubbles)for(t._getBubblingTargets(e.type,A),e.eventPhase=3
,n=0;n<A.length;+
+n)if((i=A[n])._bubblingListeners&&(e.currentTarget=i,i._bubblingListeners.emit(e.t
ype,e),e._propagationStopped))return void(A.length=0);A.length=0}function G(t){var
e=t.groupIndex;return 0===e&&t.parent&&(e=G(t.parent)),e}function z(t){var
e=G(t);t._cullingMask=1<<e;for(var i=0;i<t._children.length;i+
+)z(t._children[i])}var U={name:"cc.Node",extends:r,properties:
{_opacity:255,_color:cc.Color.WHITE,_contentSize:cc.Size,_anchorPoint:cc.v2(.5,.5),
_position:cc.Vec3,_scale:cc.Vec3,_quat:cc.Quat,_skewX:0,_skewY:0,_zIndex:
{default:void 0,type:cc.Integer},_localZOrder:{default:0,serializable:!
1},_is3DNode:!1,groupIndex:{default:0,type:cc.Integer},group:{get:function(){return
cc.game.groupList[this.groupIndex]||""},set:function(t)
{this.groupIndex=cc.game.groupList.indexOf(t),z(this),this.emit(T.GROUP_CHANGED,thi
s)}},x:{get:function(){return this._position.x},set:function(t){var
e=this._position;t!==e.x&&(e.x=t,this.setLocalDirty(S.POSITION),this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(T.POSITION_CHANGED))}},y:
{get:function(){return this._position.y},set:function(t){var e=this._position;t!
==e.y&&(e.y=t,this.setLocalDirty(S.POSITION),this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(T.POSITION_CHANGED))}},rotatio
n:{get:function(){return-this.angle},set:function(t){this.angle=-t}},angle:
{get:function(){return this._eulerAngles.z},set:function(t)
{n.vec3.set(this._eulerAngles,0,0,t),this._fromEuler(),this.setLocalDirty(S.ROTATIO
N),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED)}},rotationX:
{get:function(){return this._eulerAngles.x},set:function(t){this._eulerAngles.x!
==t&&(this._eulerAngles.x=t,this._eulerAngles.x===this._eulerAngles.y?
n.quat.fromEuler(this._quat,0,0,-
t):n.quat.fromEuler(this._quat,t,this._eulerAngles.y,0),this.setLocalDirty(S.ROTATI
ON),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED))}},rotationY:
{get:function(){return this._eulerAngles.y},set:function(t){this._eulerAngles.y!
==t&&(this._eulerAngles.y=t,this._eulerAngles.x===this._eulerAngles.y?
n.quat.fromEuler(this._quat,0,0,-
t):n.quat.fromEuler(this._quat,this._eulerAngles.x,t,0),this.setLocalDirty(S.ROTATI
ON),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED))}},scale:
{get:function(){return this._scale.x},set:function(t){this.setScale(t)}},scaleX:
{get:function(){return this._scale.x},set:function(t){this._scale.x!
==t&&(this._scale.x=t,this.setLocalDirty(S.SCALE),this._renderFlag|
=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(T.SCALE_CHANGED))}},scaleY:
{get:function(){return this._scale.y},set:function(t){this._scale.y!
==t&&(this._scale.y=t,this.setLocalDirty(S.SCALE),this._renderFlag|
=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(T.SCALE_CHANGED))}},skewX:
{get:function(){return this._skewX},set:function(t)
{this._skewX=t,this.setLocalDirty(S.SKEW),this._renderFlag|
=_.FLAG_TRANSFORM}},skewY:{get:function(){return this._skewY},set:function(t)
{this._skewY=t,this.setLocalDirty(S.SKEW),this._renderFlag|
=_.FLAG_TRANSFORM}},opacity:{get:function(){return this._opacity},set:function(t)
{t=cc.misc.clampf(t,0,255),this._opacity!==t&&(this._opacity=t,this._renderFlag|
=_.FLAG_OPACITY)},range:[0,255]},color:{get:function(){return
this._color.clone()},set:function(t){this._color.equals(t)||
(this._color.set(t),32&this._eventMask&&this.emit(T.COLOR_CHANGED,t))}},anchorX:
{get:function(){return this._anchorPoint.x},set:function(t){var
e=this._anchorPoint;e.x!
==t&&(e.x=t,16&this._eventMask&&this.emit(T.ANCHOR_CHANGED))}},anchorY:
{get:function(){return this._anchorPoint.y},set:function(t){var
e=this._anchorPoint;e.y!
==t&&(e.y=t,16&this._eventMask&&this.emit(T.ANCHOR_CHANGED))}},width:
{get:function(){return this._contentSize.width},set:function(t){t!
==this._contentSize.width&&(this._contentSize.width=t,8&this._eventMask&&this.emit(
T.SIZE_CHANGED))}},height:{get:function(){return
this._contentSize.height},set:function(t){t!
==this._contentSize.height&&(this._contentSize.height=t,8&this._eventMask&&this.emi
t(T.SIZE_CHANGED))}},zIndex:{get:function(){return
this._localZOrder>>16},set:function(t){t>h.MAX_ZINDEX?
(cc.warnID(1636),t=h.MAX_ZINDEX):t<h.MIN_ZINDEX&&(cc.warnID(1637),t=h.MIN_ZINDEX),t
his.zIndex!==t&&(this._localZOrder=65535&this._localZOrder|
t<<16,this._parent&&this._onSiblingIndexChanged())}}},ctor:function()
{this._reorderChildDirty=!1,this._widget=null,this._renderComponent=nul
l,this._capturingListeners=null,this._bubblingListeners=null,this._touchListener=nu
ll,this._mouseListener=null,this._scale.x=1,this._scale.y=1,this._scale.z=1,this._m
atrix=a.mat4.get(),this._worldMatrix=a.mat4.get(),this._localMatDirty=S.ALL,this._w
orldMatDirty=!
0,this._eventMask=0,this._cullingMask=1,this._childArrivalOrder=1,this._eulerAngles
=cc.v3()},statics:{EventType:T,_LocalDirtyFlag:S,isNode:function(t){return t
instanceof j&&(t.constructor===j||!(t instanceof
cc.Scene))},BuiltinGroupIndex:C},_onSiblingIndexChanged:function(){for(var
t=this._parent,e=t._children,i=0,n=e.length;i<n;i+
+)e[i]._updateOrderOfArrival();t._delaySort()},_onPreDestroy:function()
{this._onPreDestroyBase();m&&cc.director.getActionManager().removeAllActionsFromTar
get(this),M===this&&(M=null),(this._touchListener||
this._mouseListener)&&(l.removeListeners(this),this._touchListener&&(this._touchLis
tener.owner=null,this._touchListener.mask=null,this._touchListener=null),this._mous
eListener&&(this._mouseListener.owner=null,this._mouseListener.mask=null,this._mous
eListener=null)),a.mat4.put(this._matrix),a.mat4.put(this._worldMatrix),this._matri
x=this._worldMatrix=null,this._reorderChildDirty&&cc.director.__fastOff(cc.Director
.EVENT_AFTER_UPDATE,this.sortAllChildren,this)},_onPostActivated:function(t){var
e=m?cc.director.getActionManager():null;if(t)if(this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,e&&e.resumeTarget(this),l.resumeTarget(this),this._touchLis
tener){var
i=this._touchListener.mask=V(this);this._mouseListener&&(this._mouseListener.mask=i
)}else this._mouseListener&&(this._mouseListener.mask=V(this));else
e&&e.pauseTarget(this),l.pauseTarget(this)},_onHierarchyChanged:function(t)
{this._updateOrderOfArrival(),z(this),this._parent&&this._parent._delaySort(),this.
_renderFlag|
=_.FLAG_WORLD_TRANSFORM,this._onHierarchyChangedBase(t),cc._widgetManager&&(cc._wid
getManager._nodesOrderDirty=!0)},_toEuler:function()
{if(this.is3DNode)this._quat.toEuler(this._eulerAngles);else{var
t=Math.asin(this._quat.z)/d*2;n.vec3.set(this._eulerAngles,0,0,t)}},_fromEuler:func
tion(){this.is3DNode?
this._quat.fromEuler(this._eulerAngles):n.quat.fromEuler(this._quat,0,0,this._euler
Angles.z)},_upgrade_1x_to_2x:function(){void 0!
==this._scaleX&&(this._scale.x=this._scaleX,this._scaleX=void 0),void 0!
==this._scaleY&&(this._scale.y=this._scaleY,this._scaleY=void 0),void 0!
==this._zIndex&&(this._localZOrder=this._zIndex<<16,this._zIndex=void 0);var
t=this._quat;(this._rotationX||
this._rotationY)&&0===t.x&&0===t.y&&0===t.z&&1===t.w&&(this._rotationX===this._rota
tionY?t.fromEuler(t,0,0,-
this._rotationX):t.fromEuler(t,this._rotationX,this._rotationY,0),this._rotationX=t
his._rotationY=void
0),this._toEuler(),this._color.a<255&&255===this._opacity&&(this._opacity=this._col
or.a,this._color.a=255)},_onBatchCreated:function()
{this._upgrade_1x_to_2x(),this._updateOrderOfArrival(),this._cullingMask=1<<G(this)
;var
t=this._prefab;t&&t.sync&&t.root===this&&s.syncWithPrefab(this),this._activeInHiera
rchy||
(m&&cc.director.getActionManager().pauseTarget(this),l.pauseTarget(this));for(var
e=this._children,i=0,n=e.length;i<n;i+
+)e[i]._onBatchCreated();e.length>0&&(this._renderFlag|
=_.FLAG_CHILDREN)},_onBatchRestored:function()
{if(this._upgrade_1x_to_2x(),this._cullingMask=1<<G(this),!this._activeInHierarchy)
{var
t=cc.director.getActionManager();t&&t.pauseTarget(this),l.pauseTarget(this)}for(var
e=this._children,i=0,n=e.length;i<n;i+
+)e[i]._onBatchRestored();e.length>0&&(this._renderFlag|
=_.FLAG_CHILDREN)},_checknSetupSysEvent:function(t){var e=!1,i=!1;return-1!
==w.indexOf(t)?(this._touchListener||
(this._touchListener=cc.EventListener.create({event:cc.EventListener.TOUCH_ONE_BY_O
NE,swallowTouches:!
0,owner:this,mask:V(this),onTouchBegan:D,onTouchMoved:B,onTouchEnded:P,onTouchCance
lled:I}),l.addListener(this._touchListener,this),e=!0),i=!0):-1!
==E.indexOf(t)&&(this._mouseListener||
(this._mouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,_previou
sIn:!
1,owner:this,mask:V(this),onMouseDown:R,onMouseMove:O,onMouseUp:L,onMouseScroll:F})
,l.addListener(this._mouseListener,this),e=!0),i=!0),e&&!
this._activeInHierarchy&&cc.director.getScheduler().schedule((function()
{this._activeInHierarchy||l.pauseTarget(this)}),this,0,0,0,!
1),i},on:function(t,e,i,n){if(this._checknSetupSysEvent(t))return
this._onDispatch(t,e,i,n);switch(t){case T.POSITION_CHANGED:this._eventMask|
=1;break;case T.SCALE_CHANGED:this._eventMask|=2;break;case
T.ROTATION_CHANGED:this._eventMask|=4;break;case T.SIZE_CHANGED:this._eventMask|
=8;break;case T.ANCHOR_CHANGED:this._eventMask|=16;break;case
T.COLOR_CHANGED:this._eventMask|=32}return this._bubblingListeners||
(this._bubblingListeners=new
u),this._bubblingListeners.on(t,e,i)},once:function(t,e,i,n){var
r=this._checknSetupSysEvent(t),s="__ONCE_FLAG:"+t,a=null;if(!(a=r&&n?
this._capturingListeners=this._capturingListeners||new
u:this._bubblingListeners=this._bubblingListeners||new u).hasEventListener(s,e,i))
{var o=this;this.on(t,(function n(r,l,h,c,u)
{o.off(t,n,i),a.remove(s,e,i),e.call(this,r,l,h,c,u)}),i),a.add(s,e,i)}},_onDispatc
h:function(t,e,i,n){if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var
r=null;return(r=n?this._capturingListeners=this._capturingListeners||new
u:this._bubblingListeners=this._bubblingListeners||new u).hasEventListener(t,e,i)||
(r.add(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this)),e}cc.errorID(6800)}
,off:function(t,e,i,n){var r=-1!==w.indexOf(t),s=!r&&-1!==E.indexOf(t);if(r||
s)this._offDispatch(t,e,i,n),r?this._touchListener&&!
N(this,w)&&(l.removeListener(this._touchListener),this._touchListener=null):s&&this
._mouseListener&&!
N(this,E)&&(l.removeListener(this._mouseListener),this._mouseListener=null);else
if(this._bubblingListeners){if(this._bubblingListeners.off(t,e,i),!
this._bubblingListeners.hasEventListener(t))switch(t){case
T.POSITION_CHANGED:this._eventMask&=-2;break;case
T.SCALE_CHANGED:this._eventMask&=-3;break;case
T.ROTATION_CHANGED:this._eventMask&=-5;break;case T.SIZE_CHANGED:this._eventMask&=-
9;break;case T.ANCHOR_CHANGED:this._eventMask&=-17;break;case
T.COLOR_CHANGED:this._eventMask&=-33}}},_offDispatch:function(t,e,i,n)
{if("boolean"==typeof i?(n=i,i=void 0):n=!!n,e){var r=n?
this._capturingListeners:this._bubblingListeners;r&&(r.remove(t,e,i),i&&i.__eventTa
rgets&&c.array.fastRemove(i.__eventTargets,this))}else
this._capturingListeners&&this._capturingListeners.removeAll(t),this._bubblingListe
ners&&this._bubblingListeners.removeAll(t)},targetOff:function(t){var
e=this._bubblingListeners;e&&(e.targetOff(t),1&this._eventMask&&!
e.hasEventListener(T.POSITION_CHANGED)&&(this._eventMask&=-2),2&this._eventMask&&!
e.hasEventListener(T.SCALE_CHANGED)&&(this._eventMask&=-3),4&this._eventMask&&!
e.hasEventListener(T.ROTATION_CHANGED)&&(this._eventMask&=-5),8&this._eventMask&&!
e.hasEventListener(T.SIZE_CHANGED)&&(this._eventMask&=-9),16&this._eventMask&&!
e.hasEventListener(T.ANCHOR_CHANGED)&&(this._eventMask&=-17),32&this._eventMask&&!
e.hasEventListener(T.COLOR_CHANGED)&&(this._eventMask&=-
33)),this._capturingListeners&&this._capturingListeners.targetOff(t),this._touchLis
tener&&!
N(this,w)&&(l.removeListener(this._touchListener),this._touchListener=null),this._m
ouseListener&&!
N(this,E)&&(l.removeListener(this._mouseListener),this._mouseListener=null)},hasEve
ntListener:function(t){var e=!1;return
this._bubblingListeners&&(e=this._bubblingListeners.hasEventListener(t)),!
e&&this._capturingListeners&&(e=this._capturingListeners.hasEventListener(t)),e},em
it:function(t,e,i,n,r,s)
{this._bubblingListeners&&this._bubblingListeners.emit(t,e,i,n,r,s)},dispatchEvent:
function(t){k(this,t),A.length=0},pauseSystemEvents:function(t)
{l.pauseTarget(this,t)},resumeSystemEvents:function(t)
{l.resumeTarget(this,t)},_hitTest:function(t,e){var
i=this._contentSize.width,r=this._contentSize.height,s=v,a=y,o=cc.Camera.findCamera
(this);if(o?
o.getCameraToWorldPoint(t,s):s.set(t),this._updateWorldMatrix(),n.mat4.invert(g,thi
s._worldMatrix),n.vec2.transformMat4(a,s,g),a.x+=this._anchorPoint.x*i,a.y+=this._a
nchorPoint.y*r,a.x>=0&&a.y>=0&&a.x<=i&&a.y<=r){if(e&&e.mask){for(var
l=e.mask,h=this,c=0;h&&c<l.index;++c,h=h.parent);if(h===l.node){var
u=h.getComponent(cc.Mask);return!u||!u.enabledInHierarchy||u._hitTest(s)}return
e.mask=null,!0}return!0}return!1},_getCapturingTargets:function(t,e){for(var
i=this.parent;i;)i._capturingListeners&&i._capturingListeners.hasEventListener(t)&&
e.push(i),i=i.parent},_getBubblingTargets:function(t,e){for(var
i=this.parent;i;)i._bubblingListeners&&i._bubblingListeners.hasEventListener(t)&&e.
push(i),i=i.parent},runAction:m?function(t){if(this.active)return
cc.assertID(t,1618),cc.director.getActionManager().addAction(t,this,!
1),t}:p,pauseAllActions:m?function()
{cc.director.getActionManager().pauseTarget(this)}:p,resumeAllActions:m?function()
{cc.director.getActionManager().resumeTarget(this)}:p,stopAllActions:m?function()
{cc.director.getActionManager().removeAllActionsFromTarget(this)}:p,stopAction:m?
function(t){cc.director.getActionManager().removeAction(t)}:p,stopActionByTag:m?
function(t){t!==cc.Action.TAG_INVALID?
cc.director.getActionManager().removeActionByTag(t,this):cc.logID(1612)}:p,getActio
nByTag:m?function(t){return t===cc.Action.TAG_INVALID?
(cc.logID(1613),null):cc.director.getActionManager().getActionByTag(t,this)}:functi
on(){return null},getNumberOfRunningActions:m?function(){return
cc.director.getActionManager().getNumberOfRunningActionsInTarget(this)}:function()
{return 0},getPosition:function(t){return(t=t||
cc.v3()).set(this._position)},setPosition:function(t,e){var i;void 0===e?
(i=t.x,e=t.y):i=t;var n=this._position;n.x===i&&n.y===e||
(n.x=i,n.y=e,this.setLocalDirty(S.POSITION),this._renderFlag|
=_.FLAG_WORLD_TRANSFORM,1&this._eventMask&&this.emit(T.POSITION_CHANGED))},getScale
:function(t){return void 0!==t?t.set(this._scale):
(cc.warnID(1400,"cc.Node.getScale","cc.Node.scale or
cc.Node.getScale(cc.Vec3)"),this._scale.x)},setScale:function(t,e){t&&"number"!
=typeof
t?(e=t.y,t=t.x):void 0===e&&(e=t),this._scale.x===t&&this._scale.y===e||
(this._scale.x=t,this._scale.y=e,this.setLocalDirty(S.SCALE),this._renderFlag|
=_.FLAG_TRANSFORM,2&this._eventMask&&this.emit(T.SCALE_CHANGED))},getRotation:funct
ion(t){return t instanceof cc.Quat?t.set(this._quat):
(cc.warnID(1400,"cc.Node.getRotation","cc.Node.angle or
cc.Node.getRotation(cc.Quat)"),-this.angle)},setRotation:function(t,e,i,n)
{if("number"==typeof t&&void
0===e)cc.warnID(1400,"cc.Node.setRotation(Number)","cc.Node.angle or
cc.Node.setRotation(quat)"),this.angle=-t;else{var r=t;void
0===e&&(r=t.x,e=t.y,i=t.z,n=t.w);var
s=this._quat;s.x===r&&s.y===e&&s.z===i&&s.w===n||
(s.x=r,s.y=e,s.z=i,s.w=n,this.setLocalDirty(S.ROTATION),this._renderFlag|
=_.FLAG_TRANSFORM,4&this._eventMask&&this.emit(T.ROTATION_CHANGED))}},getContentSiz
e:function(){return
cc.size(this._contentSize.width,this._contentSize.height)},setContentSize:function(
t,e){var i=this._contentSize;if(void 0===e)
{if(t.width===i.width&&t.height===i.height)return;0,i.width=t.width,i.height=t.heig
ht}else{if(t===i.width&&e===i.height)return;0,i.width=t,i.height=e}8&this._eventMas
k&&this.emit(T.SIZE_CHANGED)},getAnchorPoint:function(){return
cc.v2(this._anchorPoint)},setAnchorPoint:function(t,e){var
i=this._anchorPoint;if(void 0===e)
{if(t.x===i.x&&t.y===i.y)return;i.x=t.x,i.y=t.y}else{if(t===i.x&&e===i.y)return;i.x
=t,i.y=e}this.setLocalDirty(S.POSITION),16&this._eventMask&&this.emit(T.ANCHOR_CHAN
GED)},_invTransformPoint:function(t,e){return this._parent?
this._parent._invTransformPoint(t,e):n.vec3.copy(t,e),n.vec3.sub(t,t,this._position
),n.quat.conjugate(b,this._quat),n.vec3.transformQuat(t,t,b),n.vec3.inverseSafe(x,t
his._scale),n.vec3.mul(t,t,x),t},getWorldPosition:function(t)
{n.vec3.copy(t,this._position);for(var
e=this._parent;e;)n.vec3.mul(t,t,e._scale),n.vec3.transformQuat(t,t,e._quat),n.vec3
.add(t,t,e._position),e=e._parent;return t},setWorldPosition:function(t)
{this._parent?
this._parent._invTransformPoint(this._position,t):n.vec3.copy(this._position,t),thi
s.setLocalDirty(S.POSITION),1&this._eventMask&&this.emit(T.POSITION_CHANGED)},getWo
rldRotation:function(t){n.quat.copy(t,this._quat);for(var
e=this._parent;e;)n.quat.mul(t,e._quat,t),e=e._parent;return
t},setWorldRotation:function(t){this._parent?
(this._parent.getWorldRotation(this._quat),n.quat.conjugate(this._quat,this._quat),
n.quat.mul(this._quat,this._quat,t)):n.quat.copy(this._quat,n.quat),this._toEuler()
,this.setLocalDirty(S.ROTATION)},getWorldScale:function(t)
{n.vec3.copy(t,this._scale);for(var
e=this._parent;e;)n.vec3.mul(t,t,e._scale),e=e._parent;return
t},setWorldScale:function(t){this._parent?
(this._parent.getWorldScale(this._scale),n.vec3.div(this._scale,t,this._scale)):n.v
ec3.copy(this._scale,t),this.setLocalDirty(S.SCALE)},getWorldRT:function(t){var
e=x,i=b;n.vec3.copy(e,this._position),n.quat.copy(i,this._quat);for(var
r=this._parent;r;)n.vec3.mul(e,e,r._scale),n.vec3.transformQuat(e,e,r._quat),n.vec3
.add(e,e,r._position),n.quat.mul(i,r._quat,i),r=r._parent;return
n.mat4.fromRT(t,i,e),t},lookAt:function(t,e)
{this.getWorldPosition(x),n.vec3.sub(x,x,t),n.vec3.normalize(x,x),n.quat.fromViewUp
(b,x,e),this.setWorldRotation(b)},_updateLocalMatrix:function(){var
t=this._localMatDirty;if(t){var e=this._matrix;if(t&(S.RT|S.SKEW)){var i=-
this._eulerAngles.z,n=this._skewX||
this._skewY,r=this._scale.x,s=this._scale.y;if(i||n){var a=1,o=0,l=0,h=1;if(i){var
c=i*d;l=Math.sin(c),a=h=Math.cos(c),o=-
l}if(e.m00=a*=r,e.m01=o*=r,e.m04=l*=s,e.m05=h*=s,n){var
u=e.m00,_=e.m01,f=e.m04,m=e.m05,p=Math.tan(this._skewX*d),v=Math.tan(this._skewY*d)
;p===1/0&&(p=99999999),v===1/0&&(v=99999999),e.m00=u+f*v,e.m01=_+m*v,e.m04=f+u*p,e.
m05=m+_*p}}else
e.m00=r,e.m01=0,e.m04=0,e.m05=s}e.m12=this._position.x,e.m13=this._position.y,this.
_localMatDirty=0,this._worldMatDirty=!0}},_calculWorldMatrix:function()
{this._localMatDirty&&this._updateLocalMatrix();var t=this._parent;t?
this._mulMat(this._worldMatrix,t._worldMatrix,this._matrix):n.mat4.copy(this._world
Matrix,this._matrix),this._worldMatDirty=!1},_mulMat:function(t,e,i){var
n=e.m00,r=e.m01,s=e.m04,a=e.m05,o=e.m12,l=e.m13,h=i.m00,c=i.m01,u=i.m04,_=i.m05,f=i
.m12,d=i.m13;0!==r||0!==s?
(t.m00=h*n+c*s,t.m01=h*r+c*a,t.m04=u*n+_*s,t.m05=u*r+_*a,t.m12=n*f+s*d+o,t.m13=r*f+
a*d+l):
(t.m00=h*n,t.m01=c*a,t.m04=u*n,t.m05=_*a,t.m12=n*f+o,t.m13=a*d+l)},_updateWorldMatr
ix:function()
{if(this._parent&&this._parent._updateWorldMatrix(),this._worldMatDirty)
{this._calculWorldMatrix();for(var t=this._children,e=0,i=t.length;e<i;e+
+)t[e]._worldMatDirty=!0}},setLocalDirty:function(t)
{this._localMatDirty=this._localMatDirty|t,this._worldMatDirty=!
0},setWorldDirty:function(){this._worldMatDirty=!0},getLocalMatrix:function(t)
{return
this._updateLocalMatrix(),n.mat4.copy(t,this._matrix)},getWorldMatrix:function(t)
{return
this._updateWorldMatrix(),n.mat4.copy(t,this._worldMatrix)},convertToNodeSpace:func
tion(t){this._updateWorldMatrix(),n.mat4.invert(g,this._worldMatrix);var e=new
cc.Vec2;return
n.vec2.transformMat4(e,t,g),e.x+=this._anchorPoint.x*this._contentSize.width,e.y+=t
his._anchorPoint.y*this._contentSize.height,e},convertToWorldSpace:function(t)
{this._updateWorldMatrix();var e=new cc.Vec2(t.x-
this._anchorPoint.x*this._contentSize.width,t.y-
this._anchorPoint.y*this._contentSize.height);return
n.vec2.transformMat4(e,e,this._worldMatrix)},convertToNodeSpaceAR:function(t)
{this._updateWorldMatrix(),n.mat4.invert(g,this._worldMatrix);var e=new
cc.Vec2;return n.vec2.transformMat4(e,t,g)},convertToWorldSpaceAR:function(t)
{this._updateWorldMatrix();var e=new cc.Vec2;return
n.vec2.transformMat4(e,t,this._worldMatrix)},getNodeToParentTransform:function(t)
{t||(t=o.identity()),this._updateLocalMatrix();var e=this._contentSize;return x.x=-
this._anchorPoint.x*e.width,x.y=-
this._anchorPoint.y*e.height,n.mat4.copy(g,this._matrix),n.mat4.translate(g,g,x),o.
fromMat4(t,g)},getNodeToParentTransformAR:function(t){return t||
(t=o.identity()),this._updateLocalMatrix(),o.fromMat4(t,this._matrix)},getNodeToWor
ldTransform:function(t){t||(t=o.identity()),this._updateWorldMatrix();var
e=this._contentSize;return x.x=-this._anchorPoint.x*e.width,x.y=-
this._anchorPoint.y*e.height,n.mat4.copy(g,this._worldMatrix),n.mat4.translate(g,g,
x),o.fromMat4(t,g)},getNodeToWorldTransformAR:function(t){return t||
(t=o.identity()),this._updateWorldMatrix(),o.fromMat4(t,this._worldMatrix)},getPare
ntToNodeTransform:function(t){return t||
(t=o.identity()),this._updateLocalMatrix(),n.mat4.invert(g,this._matrix),o.fromMat4
(t,g)},getWorldToNodeTransform:function(t){return t||
(t=o.identity()),this._updateWorldMatrix(),n.mat4.invert(g,this._worldMatrix),o.fro
mMat4(t,g)},convertTouchToNodeSpace:function(t){return
this.convertToNodeSpace(t.getLocation())},convertTouchToNodeSpaceAR:function(t)
{return this.convertToNodeSpaceAR(t.getLocation())},getBoundingBox:function()
{this._updateLocalMatrix();var
t=this._contentSize.width,e=this._contentSize.height,i=cc.rect(-
this._anchorPoint.x*t,-this._anchorPoint.y*e,t,e);return
i.transformMat4(i,this._matrix)},getBoundingBoxToWorld:function(){return
this._parent?
(this._parent._updateWorldMatrix(),this._getBoundingBoxTo(this._parent._worldMatrix
)):this.getBoundingBox()},_getBoundingBoxTo:function(t)
{this._updateLocalMatrix();var
e=this._contentSize.width,i=this._contentSize.height,r=cc.rect(-
this._anchorPoint.x*e,-
this._anchorPoint.y*i,e,i);t=n.mat4.mul(this._worldMatrix,t,this._matrix);if(r.tran
sformMat4(r,t),!this._children)return r;for(var s=this._children,a=0;a<s.length;a+
+){var o=s[a];if(o&&o.active){var l=o._getBoundingBoxTo(t);l&&r.union(r,l)}}return
r},_updateOrderOfArrival:function(){var t=this._parent?+
+this._parent._childArrivalOrder:0;if(this._localZOrder=4294901760&this._localZOrde
r|t,65535===t){var e=this._parent._children;e.forEach((function(t,e)
{t._localZOrder=4294901760&t._localZOrder|
e+1})),this._parent._childArrivalOrder=e.length}},addChild:function(t,e,i)
{cc.assertID(t,1606),cc.assertID(null===t._parent,1605),t.parent=this,void 0!
==e&&(t.zIndex=e),void 0!==i&&(t.name=i)},cleanup:function()
{m&&cc.director.getActionManager().removeAllActionsFromTarget(this),l.removeListene
rs(this);var t,e,i=this._children.length;for(t=0;t<i;++t)
(e=this._children[t])&&e.cleanup()},sortAllChildren:function()
{if(this._reorderChildDirty){l._setDirtyForNode(this),this._reorderChildDirty=!
1;var t=this._children;if(t.length>1){var e,i,n,r=t.length;for(e=1;e<r;e++)
{for(n=t[e],i=e-
1;i>=0&&n._localZOrder<t[i]._localZOrder;)t[i+1]=t[i],i--;t[i+1]=n}this.emit(T.CHIL
D_REORDER,this)}cc.director.__fastOff(cc.Director.EVENT_AFTER_UPDATE,this.sortAllCh
ildren,this)}},_delaySort:function(){this._reorderChildDirty||
(this._reorderChildDirty=!
0,cc.director.__fastOn(cc.Director.EVENT_AFTER_UPDATE,this.sortAllChildren,this))},
_restoreProperties:!1,onRestore:!1};var
j=cc.Class(U),W=j.prototype;c.getset(W,"position",W.getPosition,W.setPosition,!1,!
0),cc.Node=e.exports=j}),{"./event-manager":130,"./event/event":133,"./event/event-
target":132,"./platform/CCMacro":205,"./platform/js":220,"./renderer/render-
flow":244,"./utils/affine-transform":285,"./utils/base-node":286,"./utils/math-
pools":294,"./utils/prefab-helper":297,"./vmath":316}],53:[(function(t,e,i){"use
strict";var n=t("./CCNode"),r=t("./renderer/render-
flow"),s=(cc.Object.Flags.HideInHierarchy,n._LocalDirtyFlag),a=cc.Class({name:"cc.P
rivateNode",extends:n,properties:{x:{get:function(){return
this._originPos.x},set:function(t){var e=this._originPos;t!
==e.x&&(e.x=t,this._posDirty(!0))},override:!0},y:{get:function(){return
this._originPos.y},set:function(t){var e=this._originPos;t!
==e.y&&(e.y=t,this._posDirty(!0))},override:!0},zIndex:{get:function(){return
cc.macro.MIN_ZINDEX},set:function(){cc.warnID(1638)},override:!0},showInEditor:
{default:!1,editorOnly:!0,override:!0}},ctor:function(t)
{this._localZOrder=cc.macro.MIN_ZINDEX<<16,this._originPos=cc.v2()},_posDirty:funct
ion(t){this.setLocalDirty(s.POSITION),this._renderFlag|=r.FLAG_TRANSFORM,!
0===t&&1&this._eventMask&&this.emit(n.EventType.POSITION_CHAN
GED)},_updateLocalMatrix:function(){if(this._localMatDirty){var
t=this.parent;t&&(this._position.x=this._originPos.x-
(t._anchorPoint.x-.5)*t._contentSize.width,this._position.y=this._originPos.y-
(t._anchorPoint.y-.5)*t._contentSize.height),this._super()}},getPosition:function()
{return new cc.Vec2(this._originPos)},setPosition:function(t,e){void
0===e&&(e=(t=t.x).y);var i=this._originPos;i.x===t&&i.y===e||
(i.x=t,i.y=e,this._posDirty(!0))},setParent:function(t){var
e=this._parent;this._super(t),e!
==t&&(e&&e.off(n.EventType.ANCHOR_CHANGED,this._posDirty,this),t&&t.on(n.EventType.
ANCHOR_CHANGED,this._posDirty,this))},_updateOrderOfArrival:function()
{}});cc.js.getset(a.prototype,"parent",a.prototype.getParent,a.prototype.setParent)
,cc.js.getset(a.prototype,"position",a.prototype.getPosition,a.prototype.setPositio
n),cc.PrivateNode=e.exports=a}),{"./CCNode":52,"./renderer/render-flow":244}],54:
[(function(t,e,i){"use
strict";cc.Scene=cc.Class({name:"cc.Scene",extends:t("./CCNode"),properties:
{_is3DNode:{default:!0,override:!0},autoReleaseAssets:{default:void
0,type:cc.Boolean}},ctor:function()
{this._anchorPoint.x=0,this._anchorPoint.y=0,this._activeInHierarchy=!
1,this._inited=!cc.game._isCloning,this.dependAssets=null},destroy:function()
{if(cc.Object.prototype.destroy.call(this))for(var t=this._children,e=0;e<t.length;
++e)t[e].active=!1;this._active=!1,this._activeInHierarchy=!
1},_onHierarchyChanged:function(){},_instantiate:null,_load:function()
{this._inited||(this._onBatchCreated(),this._inited=!0)},_activate:function(t){t=!
1!==t,cc.director._nodeActivator.activateNode(this,t)}}),e.exports=cc.Scene}),
{"./CCNode":52}],55:[(function(t,e,i){"use strict";var
n=t("./platform/js"),r=new(t("./platform/id-generater"))
("Scheduler"),s=function(t,e,i,n)
{this.target=t,this.priority=e,this.paused=i,this.markedForDeletion=n},a=[];s.get=f
unction(t,e,i,n){var r=a.pop();return r?
(r.target=t,r.priority=e,r.paused=i,r.markedForDeletion=n):r=new
s(t,e,i,n),r},s.put=function(t){a.length<20&&(t.target=null,a.push(t))};var
o=function(t,e,i,n)
{this.list=t,this.entry=e,this.target=i,this.callback=n},l=[];o.get=function(t,e,i,
n){var r=l.pop();return r?(r.list=t,r.entry=e,r.target=i,r.callback=n):r=new
o(t,e,i,n),r},o.put=function(t)
{l.length<20&&(t.list=t.entry=t.target=t.callback=null,l.push(t))};var
h=function(t,e,i,n,r,s){var
a=this;a.timers=t,a.target=e,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged
=r,a.paused=s},c=[];function u(){this._lock=!1,this._scheduler=null,this._elapsed=-
1,this._runForever=!1,this._useDelay=!
1,this._timesExecuted=0,this._repeat=0,this._delay=0,this._interval=0,this._target=
null,this._callback=null}h.get=function(t,e,i,n,r,s){var a=c.pop();return a?
(a.timers=t,a.target=e,a.timerIndex=i,a.currentTimer=n,a.currentTimerSalvaged=r,a.p
aused=s):a=new h(t,e,i,n,r,s),a},h.put=function(t)
{c.length<20&&(t.timers=t.target=t.currentTimer=null,c.push(t))};var
_=u.prototype;_.initWithCallback=function(t,e,i,n,r,s){return this._lock=!
1,this._scheduler=t,this._target=i,this._callback=e,this._elapsed=-
1,this._interval=n,this._delay=s,this._useDelay=this._delay>0,this._repeat=r,this._
runForever=this._repeat===cc.macro.REPEAT_FOREVER,!0},_.getInterval=function()
{return this._interval},_.setInterval=function(t)
{this._interval=t},_.update=function(t){-1===this._elapsed?
(this._elapsed=0,this._timesExecuted=0):(this._elapsed+=t,this._runForever&&!
this._useDelay?this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0):
(this._useDelay?this._elapsed>=this._delay&&(this.trigger(),this._elapsed-
=this._delay,this._timesExecuted+=1,this._useDelay=!
1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecut
ed+=1),this._callback&&!
this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},_.getCallback=
function(){return this._callback},_.trigger=function()
{this._target&&this._callback&&(this._lock=!
0,this._callback.call(this._target,this._elapsed),this._lock=!
1)},_.cancel=function()
{this._scheduler.unschedule(this._callback,this._target)};var f=[];u.get=function()
{return f.pop()||new u},u.put=function(t){f.length<20&&!
t._lock&&(t._scheduler=t._target=t._callback=null,f.push(t))},cc.Scheduler=function
()
{this._timeScale=1,this._updatesNegList=[],this._updates0List=[],this._updatesPosLi
st=[],this._hashForUpdates=n.createMap(!0),this._hashForTimers=n.createMap(!
0),this._currentTarget=null,this._currentTargetSalvaged=!1,this._updateHashLocked=!
1,this._arrayForTimers=[]},cc.Scheduler.prototype={constructor:cc.Scheduler,_remove
HashElement:function(t){delete this._hashForTimers[t.target._id];for(var
e=this._arrayForTimers,i=0,n=e.length;i<n;i++)if(e[i]===t)
{e.splice(i,1);break}h.put(t)},_removeUpdateFromHash:function(t){var
e=t.target._id,i=this._hashForUpdates[e];if(i){for(var
n=i.list,r=i.entry,a=0,l=n.length;a<l;a++)if(n[a]===r){n.splice(a,1);break}delete
this._hashForUpdates[e],s.put(r),o.put(i)}},_priorityIn:function(t,e,i){for(var
n=0;n<t.length;n++)if(i<t[n].priority)return void
t.splice(n,0,e);t.push(e)},_appendIn:function(t,e)
{t.push(e)},enableForTarget:function(t){t._id||(t.__instanceId?
cc.warnID(1513):t._id=r.getNewId())},setTimeScale:function(t)
{this._timeScale=t},getTimeScale:function(){return
this._timeScale},update:function(t){var e,i,n,r;for(this._updateHashLocked=!0,1!
==this._timeScale&&(t*=this._timeScale),e=0,n=(i=this._updatesNegList).length;e<n;e
++)(r=i[e]).paused||r.markedForDeletion||
r.target.update(t);for(e=0,n=(i=this._updates0List).length;e<n;e++)
(r=i[e]).paused||r.markedForDeletion||
r.target.update(t);for(e=0,n=(i=this._updatesPosList).length;e<n;e++)
(r=i[e]).paused||r.markedForDeletion||r.target.update(t);var
s,a=this._arrayForTimers;for(e=0;e<a.length;e++)
{if(s=a[e],this._currentTarget=s,this._currentTargetSalvaged=!1,!
s.paused)for(s.timerIndex=0;s.timerIndex<s.timers.length;+
+s.timerIndex)s.currentTimer=s.timers[s.timerIndex],s.currentTimerSalvaged=!
1,s.currentTimer.update(t),s.currentTimer=null;this._currentTargetSalvaged&&0===thi
s._currentTarget.timers.length&&(this._removeHashElement(this._currentTarget),--
e)}for(e=0,i=this._updatesNegList;e<i.length;)(r=i[e]).markedForDeletion?
this._removeUpdateFromHash(r):e++;for(e=0,i=this._updates0List;e<i.length;)
(r=i[e]).markedForDeletion?this._removeUpdateFromHash(r):e+
+;for(e=0,i=this._updatesPosList;e<i.length;)(r=i[e]).markedForDeletion?
this._removeUpdateFromHash(r):e++;this._updateHashLocked=!
1,this._currentTarget=null},schedule:function(t,e,i,n,r,s){if("function"!=typeof t)
{var a=t;t=e,e=a}4!==arguments.length&&5!==arguments.length||(s=!!
n,n=cc.macro.REPEAT_FOREVER,r=0),cc.assertID(e,1502);var o=e._id;o||
(e.__instanceId?(cc.warnID(1513),o=e._id=e.__instanceId):cc.errorID(1510));var
l,c,_=this._hashForTimers[o];if(_?_.paused!==s&&cc.warnID(1511):
(_=h.get(null,e,0,null,null,s),this._arrayForTimers.push(_),this._hashForTimers[o]=
_),null==_.timers)_.timers=[];else for(c=0;c<_.timers.length;+
+c)if((l=_.timers[c])&&t===l._callback)return
cc.logID(1507,l.getInterval(),i),void(l._interval=i);
(l=u.get()).initWithCallback(this,t,e,i,n,r),_.timers.push(l),this._currentTarget==
=_&&this._currentTargetSalvaged&&(this._currentTargetSalvaged=!
1)},scheduleUpdate:function(t,e,i){var n=t._id;n||(t.__instanceId?
(cc.warnID(1513),n=t._id=t.__instanceId):cc.errorID(1510));var
r=this._hashForUpdates[n];if(r&&r.entry){if(r.entry.priority===e)return
r.entry.markedForDeletion=!
1,void(r.entry.paused=i);if(this._updateHashLocked)return
cc.logID(1506),r.entry.markedForDeletion=!
1,void(r.entry.paused=i);this.unscheduleUpdate(t)}var a,l=s.get(t,e,i,!1);0===e?
(a=this._updates0List,this._appendIn(a,l)):(a=e<0?
this._updatesNegList:this._updatesPosList,this._priorityIn(a,l,e)),this._hashForUpd
ates[n]=o.get(a,l,t,null)},unschedule:function(t,e){if(e&&t){var i=e._id;i||
(e.__instanceId?(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var
n=this._hashForTimers[i];if(n)for(var r=n.timers,s=0,a=r.length;s<a;s++){var
o=r[s];if(t===o._callback)return o!==n.currentTimer||n.currentTimerSalvaged||
(n.currentTimerSalvaged=!
0),r.splice(s,1),u.put(o),n.timerIndex>=s&&n.timerIndex--,void(0===r.length&&(this.
_currentTarget===n?this._currentTargetSalvaged=!
0:this._removeHashElement(n)))}}},unscheduleUpdate:function(t){if(t){var
e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForUpdates[e];i&&(this._updateHashLocked?i.entry.markedForDeletion=!
0:this._removeUpdateFromHash(i.entry))}},unscheduleAllForTarget:function(t){if(t)
{var e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];if(i){var n=i.timers;n.indexOf(i.currentTimer)>-1&&!
i.currentTimerSalvaged&&(i.currentTimerSalvaged=!0);for(var r=0,s=n.length;r<s;r+
+)u.put(n[r]);n.length=0,this._currentTarget===i?this._currentTargetSalvaged=!
0:this._removeHashElement(i)}this.unscheduleUpdate(t)}},unscheduleAll:function()
{this.unscheduleAllWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},unscheduleAllWith
MinPriority:function(t){var e,i,n,r=this._arrayForTimers;for(e=r.length-
1;e>=0;e--)i=r[e],this.unscheduleAllForTarget(i.target);var
s=0;if(t<0)for(e=0;e<this._updatesNegList.length;)s=this._updatesNegList.length,
(n=this._updatesNegList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),s==this
._updatesNegList.length&&e+
+;if(t<=0)for(e=0;e<this._updates0List.length;)s=this._updates0List.length,
(n=this._updates0List[e])&&this.unscheduleUpdate(n.target),s==this._updates0List.le
ngth&&e++;for(e=0;e<this._updatesPosList.length;)s=this._updatesPosList.length,
(n=this._updatesPosList[e])&&n.priority>=t&&this.unscheduleUpdate(n.target),s==this
._updatesPosList.length&&e++},isScheduled:function(t,e)
{cc.assertID(t,1508),cc.assertID(e,1509);var i=e._id;i||(e.__instanceId?
(cc.warnID(1513),i=e._id=e.__instanceId):cc.errorID(1510));var
n=this._hashForTimers[i];if(!n)return!1;if(null==n.timers)return!1;for(var
r=n.timers,s=0;s<r.length;++s){if(t===r[s]._callback)return!0}return!
1},pauseAllTargets:function(){return

this.pauseAllTargetsWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM)},pauseAllTargetsW
ithMinPriority:function(t){var
e,i,n,r,s=[],a=this._arrayForTimers;for(i=0,n=a.length;i<n;i++)
(e=a[i])&&(e.paused=!
0,s.push(e.target));if(t<0)for(i=0;i<this._updatesNegList.length;i++)
(r=this._updatesNegList[i])&&r.priority>=t&&(r.paused=!
0,s.push(r.target));if(t<=0)for(i=0;i<this._updates0List.length;i++)
(r=this._updates0List[i])&&(r.paused=!
0,s.push(r.target));for(i=0;i<this._updatesPosList.length;i++)
(r=this._updatesPosList[i])&&r.priority>=t&&(r.paused=!0,s.push(r.target));return
s},resumeTargets:function(t){if(t)for(var e=0;e<t.length;e+
+)this.resumeTarget(t[e])},pauseTarget:function(t){cc.assertID(t,1503);var
e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];i&&(i.paused=!0);var
n=this._hashForUpdates[e];n&&(n.entry.paused=!0)},resumeTarget:function(t)
{cc.assertID(t,1504);var e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];i&&(i.paused=!1);var
n=this._hashForUpdates[e];n&&(n.entry.paused=!1)},isTargetPaused:function(t)
{cc.assertID(t,1505);var e=t._id;e||(t.__instanceId?
(cc.warnID(1513),e=t._id=t.__instanceId):cc.errorID(1510));var
i=this._hashForTimers[e];if(i)return i.paused;var
n=this._hashForUpdates[e];return!!
n&&n.entry.paused}},cc.Scheduler.PRIORITY_SYSTEM=1<<31,cc.Scheduler.PRIORITY_NON_SY
STEM=cc.Scheduler.PRIORITY_SYSTEM+1,e.exports=cc.Scheduler}),{"./platform/id-
generater":216,"./platform/js":220}],56:[(function(t,e,i){"use strict";var
n=t("./CCRawAsset");cc.Asset=cc.Class({name:"cc.Asset",extends:n,ctor:function()
{this.loaded=!0},properties:{nativeUrl:{get:function(){if(this._native){var
t=this._native;if(47===t.charCodeAt(0))return t.slice(1);if(cc.AssetLibrary){var
e=cc.AssetLibrary.getLibUrlNoExt(this._uuid,!0);return 46===t.charCodeAt(0)?
e+t:e+"/"+t}cc.errorID(6400)}return""},visible:!1},_native:"",_nativeAsset:
{get:function(){return this._$nativeAsset},set:function(t)
{this._$nativeAsset=t}}},statics:{deserialize:!1,preventDeferredLoadDependents:!
1,preventPreloadNativeObject:!1},toString:function(){return
this.nativeUrl},serialize:!1,createNode:null,_setRawAsset:function(t,e)
{this._native=!1!==e?t||void 0:"/"+t}}),e.exports=cc.Asset}),
{"./CCRawAsset":65}],57:[(function(t,e,i){"use strict";var
n=t("./CCAsset"),r=t("../event/event-
target"),s=cc.Enum({WEB_AUDIO:0,DOM_AUDIO:1}),a=cc.Class({name:"cc.AudioClip",exten
ds:n,mixins:[r],ctor:function(){this.loaded=!1,this._audio=null},properties:
{loadMode:{default:s.WEB_AUDIO,type:s},_nativeAsset:{get:function(){return
this._audio},set:function(t){t instanceof cc.AudioClip?
this._audio=t._nativeAsset:this._audio=t,this._audio&&(this.loaded=!
0,this.emit("load"))},override:!0}},statics:{LoadMode:s,_loadByUrl:function(t,e)
{var i=cc.loader.getItem(t)||cc.loader.getItem(t+"?useDom=1");i&&i.complete?
i._owner instanceof a?e(null,i._owner):e(null,i.content):cc.loader.load(t,
(function(n,r){if(n)return e(n);i=cc.loader.getItem(t)||cc.loader.getItem(t+"?
useDom=1"),e(null,i.content)}))}},destroy:function()
{cc.audioEngine.uncache(this),this._super()}});cc.AudioClip=a,e.exports=a}),
{"../event/event-target":132,"./CCAsset":56}],58:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.BitmapFont",extends:cc.Font,properties:{fntDataStr:
{default:""},spriteFrame:{default:null,type:cc.SpriteFrame},fontSize:{default:-
1},_fntConfig:null}});cc.BitmapFont=n,e.exports=n}),{}],59:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.BufferAsset",extends:cc.Asset,ctor:function()
{this._buffer=null},properties:{_nativeAsset:{get:function(){return
this._buffer},set:function(t){this._buffer=t.buffer||t},override:!
0},buffer:function(){return this._buffer}}});cc.BufferAsset=e.exports=n}),{}],60:
[(function(t,e,i){"use strict";var
n=t("./CCAsset"),r=cc.Class({name:"cc.EffectAsset",extends:n,properties:
{properties:Object,techniques:[],shaders:[]},onLoad:function(){for(var
t=cc.renderer._forward._programLib,e=0;e<this.shaders.length;e+
+)t.define(this.shaders[e])}});e.exports=cc.EffectAsset=r}),{"./CCAsset":56}],61:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Font",extends:cc.Asset});cc.Font=e.exports=n}),{}],62:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.JsonAsset",extends:cc.Asset,properties:
{json:null}});e.exports=cc.JsonAsset=n}),{}],63:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.LabelAtlas",extends:cc.BitmapFont});cc.LabelAtlas=n,e.exports=
n}),{}],64:[(function(t,e,i){"use strict";var
n=cc.Enum({AUTO:0,SINGLE_INSTANCE:1,MULTI_INSTANCE:2}),r=cc.Class({name:"cc.Prefab"
,extends:cc.Asset,ctor:function()
{this._createFunction=null,this._instantiatedTimes=0},properties:
{data:null,optimizationPolicy:n.AUTO,asyncLoadAssets:!1,readonly:{default:!
1,editorOnly:!0}},statics:
{OptimizationPolicy:n,OptimizationPolicyThreshold:3},createNode:!
1,compileCreateFunction:function(){var e=t("../platform/instantiate-
jit");this._createFunction=e.compile(this.data)},_doInstantiate:function(t){return
this.data._prefab?this.data._prefab._synced=!
0:cc.warnID(3700),this._createFunction||
this.compileCreateFunction(),this._createFunction(t)},_instantiate:function(){var
t;return this.optimizationPolicy!
==n.SINGLE_INSTANCE&&(this.optimizationPolicy===n.MULTI_INSTANCE||
this._instantiatedTimes+1>=r.OptimizationPolicyThreshold)?
(t=this._doInstantiate(),this.data._instantiate(t)):(this.data._prefab._synced=!
0,t=this.data._instantiate()),+
+this._instantiatedTimes,t}});cc.Prefab=e.exports=r,cc.js.obsolete(cc,"cc._Prefab",
"Prefab")}),{"../platform/instantiate-jit":218}],65:[(function(t,e,i){"use
strict";var
n=t("../platform/CCObject"),r=t("../platform/js");cc.RawAsset=cc.Class({name:"cc.Ra
wAsset",extends:n,ctor:function(){Object.defineProperty(this,"_uuid",
{value:"",writable:!0})}}),r.value(cc.RawAsset,"isRawAssetType",(function(t){return
r.isChildClassOf(t,cc.RawAsset)&&!
r.isChildClassOf(t,cc.Asset)})),r.value(cc.RawAsset,"wasRawAssetType",(function(t)
{return t===cc.Texture2D||t===cc.AudioClip||t===cc.ParticleAsset||
t===cc.Asset})),e.exports=cc.RawAsset}),
{"../platform/CCObject":206,"../platform/js":220}],66:[(function(t,e,i){"use
strict";var n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../renderer/gfx"));var
r=t("../renderer"),s=t("./CCTexture2D"),a=cc.Class({name:"cc.RenderTexture",extends
:s,ctor:function(){this._framebuffer=null},initWithSize:function(t,e,i)
{this.width=Math.floor(t||cc.visibleRect.width),this.height=Math.floor(e||
cc.visibleRect.height),this._resetUnderlyingMipmaps();var s={colors:
[this._texture]};this._depthStencilBuffer&&this._depthStencilBuffer.destroy();var
a=void 0;i&&(a=new
n.default.RenderBuffer(r.device,i,t,e),i===n.default.RB_FMT_D24S8?
s.depthStencil=a:i===n.default.RB_FMT_S8?
s.stencil=a:i===n.default.RB_FMT_D16&&(s.depth=a)),this._depthStencilBuffer=a,this.
_framebuffer&&this._framebuffer.destroy(),this._framebuffer=new
n.default.FrameBuffer(r.device,t,e,s),this.loaded=!
0,this.emit("load")},updateSize:function(t,e){this.width=Math.floor(t||
cc.visibleRect.width),this.height=Math.floor(e||
cc.visibleRect.height),this._resetUnderlyingMipmaps();var
i=this._depthStencilBuffer;i&&i.update(this.width,this.height),this._framebuffer._w
idth=t,this._framebuffer._height=e},drawTextureAt:function(t,e,i)
{t._image&&this._texture.updateSubImage({x:e,y:i,image:t._image,width:t.width,heigh
t:t.height,level:0,flipY:!
1,premultiplyAlpha:t._premultiplyAlpha})},readPixels:function(t,e,i,n,s){if(!
this._framebuffer||!this._texture)return t;e=e||0,i=i||0;var a=n||this.width,o=s||
this.height;t=t||new Uint8Array(a*o*4);var
l=r._forward._device._gl,h=l.getParameter(l.FRAMEBUFFER_BINDING);return
l.bindFramebuffer(l.FRAMEBUFFER,this._framebuffer._glID),l.readPixels(e,i,a,o,l.RGB
A,l.UNSIGNED_BYTE,t),l.bindFramebuffer(l.FRAMEBUFFER,h),t},destroy:function()
{this._super(),this._framebuffer&&this._framebuffer.destroy()}});cc.RenderTexture=e
.exports=a}),{"../../renderer/gfx":348,"../renderer":243,"./CCTexture2D":73}],67:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.SceneAsset",extends:cc.Asset,properties:
{scene:null,asyncLoadAssets:void 0}});cc.SceneAsset=n,e.exports=n}),{}],68:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Script",extends:cc.Asset});cc._Script=n;var
r=cc.Class({name:"cc.JavaScript",extends:n});cc._JavaScript=r;var
s=cc.Class({name:"cc.CoffeeScript",extends:n});cc._CoffeeScript=s;var
a=cc.Class({name:"cc.TypeScript",extends:n});cc._TypeScript=a}),{}],69:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.SpriteAtlas",extends:cc.Asset,properties:{_spriteFrames:
{default:{}}},getTexture:function(){var
t=Object.keys(this._spriteFrames);if(t.length>0){var
e=this._spriteFrames[t[0]];return e?e.getTexture():null}return
null},getSpriteFrame:function(t){var e=this._spriteFrames[t];return e?(e.name||
(e.name=t),e):null},getSpriteFrames:function(){var
t=[],e=this._spriteFrames;for(var i in e)t.push(this.getSpriteFrame(i));return
t}});cc.SpriteAtlas=n,e.exports=n}),{}],70:[(function(t,e,i){"use strict";var
n=t("../event/event-target"),r=t("../utils/texture-util"),s=[{u:0,v:0},{u:0,v:0},
{u:0,v:0},
{u:0,v:0}],a=cc.Class({name:"cc.SpriteFrame",extends:t("../assets/CCAsset"),mixins:
[n],properties:{_textureSetter:{set:function(t){t&&(this._texture!
==t&&this._refreshTexture(t),this._textureFilename=t.url)}},insetTop:
{get:function(){return this._capInsets[1]},set:function(t)
{this._capInsets[1]=t,this._texture&&this._calculateSlicedUV()}},insetBottom:
{get:function(){return this._capInsets[3]},set:function(t)
{this._capInsets[3]=t,this._texture&&this._calculateSlicedUV()}},insetLeft:
{get:function(){return this._capInsets[0]},set:function(t)
{this._capInsets[0]=t,this._texture&&this._calculateSlicedUV()}},insetRight:
{get:function(){return this._capInsets[2]},set:function(t)
{this._capInsets[2]=t,this._texture&&this._calculateSlicedUV()}}},ctor:function()
{n.call(this);var

t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3],s=arguments[4];this._re
ct=null,this.uv=[],this._texture=null,this._original=null,this._offset=null,this._o
riginalSize=null,this._rotated=!
1,this.vertices=null,this._capInsets=[0,0,0,0],this.uvSliced=[],this._textureFilena
me="",void 0!==t&&this.setTexture(t,e,i,r,s)},textureLoaded:function(){return
this._texture&&this._texture.loaded},isRotated:function(){return
this._rotated},setRotated:function(t)
{this._rotated=t,this._texture&&this._calculateUV()},getRect:function(){return
cc.rect(this._rect)},setRect:function(t)
{this._rect=t,this._texture&&this._calculateUV()},getOriginalSize:function(){return
cc.size(this._originalSize)},setOriginalSize:function(t){this._originalSize?
(this._originalSize.width=t.width,this._originalSize.height=t.height):this._origina
lSize=cc.size(t)},getTexture:function(){return
this._texture},_textureLoadedCallback:function(){var t=this._texture;if(t){var
e=t.width,i=t.height;this._rotated&&cc.game.renderType===cc.game.RENDER_TYPE_CANVAS
&&(this._rotated=!
1,e=this._texture.width,i=this._texture.height,this._rect=cc.rect(0,0,e,i)),this._r
ect?this._checkRect(this._texture):this._rect=cc.rect(0,0,e,i),this._originalSize||
this.setOriginalSize(cc.size(e,i)),this._offset||
this.setOffset(cc.v2(0,0)),this._calculateUV(),this.emit("load")}},_refreshTexture:
function(t){this._texture=t,t.loaded?
this._textureLoadedCallback():t.once("load",this._textureLoadedCallback,this)},getO
ffset:function(){return cc.v2(this._offset)},setOffset:function(t)
{this._offset=cc.v2(t)},clone:function(){return new a(this._texture||
this._textureFilename,this._rect,this._rotated,this._offset,this._originalSize)},se
tTexture:function(t,e,i,n,r){this._rect=e||null,n?
this.setOffset(n):this._offset=null,r?
this.setOriginalSize(r):this._originalSize=null,this._rotated=i||!1;var
s=t;return"string"==typeof s&&s&&(this._textureFilename=s,this._loadTexture()),s
instanceof cc.Texture2D&&this._texture!==s&&this._refreshTexture(s),!
0},_loadTexture:function(){if(this._textureFilename){var
t=r.loadImage(this._textureFilename);this._refreshTexture(t)}},ensureLoadTexture:fu
nction(){this._texture?this._texture.loaded||
(this._refreshTexture(this._texture),r.postLoadTexture(this._texture)):this._textur
eFilename&&this._loadTexture()},clearTexture:function()
{this._texture=null},_checkRect:function(t){var
e=this._rect,i=e.x,n=e.y;this._rotated?(i+=e.height,n+=e.width):
(i+=e.width,n+=e.height),i>t.width&&cc.errorID(3300,t.url+"/"+this.name,i,t.width),
n>t.height&&cc.errorID(3400,t.url+"/"+this.name,n,t.height)},_calculateSlicedUV:fun
ction(){var
t=this._rect,e=this._texture.width,i=this._texture.height,n=this._capInsets[0],r=th
is._capInsets[2],a=t.width-n-
r,o=this._capInsets[1],l=this._capInsets[3],h=t.height-o-
l,c=this.uvSliced;if(c.length=0,this._rotated)
{s[0].u=t.x/e,s[1].u=(t.x+l)/e,s[2].u=(t.x+l+h)/e,s[3].u=(t.x+t.height)/e,s[3].v=t.
y/i,s[2].v=(t.y+n)/i,s[1].v=(t.y+n+a)/i,s[0].v=(t.y+t.width)/i;for(var u=0;u<4;+
+u)for(var _=s[u],f=0;f<4;++f){var d=s[3-
f];c.push({u:_.u,v:d.v})}}else{s[0].u=t.x/e,s[1].u=(t.x+n)/e,s[2].u=(t.x+n+a)/e,s[3
].u=(t.x+t.width)/e,s[3].v=t.y/i,s[2].v=(t.y+o)/i,s[1].v=(t.y+o+h)/i,s[0].v=(t.y+t.
height)/i;for(var m=0;m<4;++m)for(var p=s[m],v=0;v<4;++v){var
y=s[v];c.push({u:y.u,v:p.v})}}},_setDynamicAtlasFrame:function(t)
{t&&(this._original={_texture:this._texture,_x:this._rect.x,_y:this._rect.y},this._
texture=t.texture,this._rect.x=t.x,this._rect.y=t.y,this._calculateUV())},_resetDyn
amicAtlasFrame:function()
{this._original&&(this._rect.x=this._original._x,this._rect.y=this._original._y,thi
s._texture=this._original._texture,this._original=null,this._calculateUV())},_calcu
lateUV:function(){var
t=this._rect,e=this._texture,i=this.uv,n=e.width,r=e.height;if(this._rotated){var
s=0===n?0:t.x/n,a=0===n?0:(t.x+t.height)/n,o=0===r?0:(t.y+t.width)/r,l=0===r?
0:t.y/r;i[0]=s,i[1]=l,i[2]=s,i[3]=o,i[4]=a,i[5]=l,i[6]=a,i[7]=o}else{var h=0===n?
0:t.x/n,c=0===n?0:(t.x+t.width)/n,u=0===r?0:(t.y+t.height)/r,_=0===r?
0:t.y/r;i[0]=h,i[1]=u,i[2]=c,i[3]=u,i[4]=h,i[5]=_,i[6]=c,i[7]=_}var
f=this.vertices;if(f){f.nu.length=0,f.nv.length=0;for(var d=0;d<f.u.length;d+
+)f.nu[d]=f.u[d]/n,f.nv[d]=f.v[d]/r}this._calculateSlicedUV()},_serialize:!
1,_deserialize:function(t,e){var i=t.rect;i&&(this._rect=new
cc.Rect(i[0],i[1],i[2],i[3])),t.offset&&this.setOffset(new
cc.Vec2(t.offset[0],t.offset[1])),t.originalSize&&this.setOriginalSize(new
cc.Size(t.originalSize[0],t.originalSize[1])),this._rotated=1===t.rotated,this._nam
e=t.name;var
n=t.capInsets;n&&(this._capInsets[0]=n[0],this._capInsets[1]=n[1],this._capInsets[2
]=n[2],this._capInsets[3]=n[3]),this.vertices=t.vertices,this.vertices&&(this.verti
ces.nu=[],this.vertices.nv=[]);var
r=t.texture;r&&e.result.push(this,"_textureSetter",r)}}),o=a.prototype;o.copyWithZo
ne=o.clone,o.copy=o.clone,o.initWithTexture=o.setTexture,cc.SpriteFrame=a,e.exports
=a}),{"../assets/CCAsset":56,"../event/event-target":132,"../utils/texture-
util":302}],71:[(function(t,e,i){"use strict";var
n=t("./CCFont"),r=cc.Class({name:"cc.TTFFont",extends:n,properties:
{_fontFamily:null,_nativeAsset:{type:cc.String,get:function(){return
this._fontFamily},set:function(t){this._fontFamily=t||"Arial"},override:!
0}}});cc.TTFFont=e.exports=r}),{"./CCFont":61}],72:[(function(t,e,i){"use
strict";var n=cc.Class({name:"cc.TextAsset",extends:cc.Asset,properties:
{text:""},toString:function(){return this.text}});e.exports=cc.TextAsset=n}),
{}],73:[(function(t,e,i){"use strict";var n=(function(t){return t&&t.__esModule?t:
{default:t}})(t("../../renderer/gfx"));var r=t("../event/event-
target"),s=t("../renderer");t("../platform/CCClass");var a=new(t("../platform/id-
generater"))
("Tex"),o=cc.Enum({RGB565:n.default.TEXTURE_FMT_R5_G6_B5,RGB5A1:n.default.TEXTURE_F
MT_R5_G5_B5_A1,RGBA4444:n.default.TEXTURE_FMT_R4_G4_B4_A4,RGB888:n.default.TEXTURE_
FMT_RGB8,RGBA8888:n.default.TEXTURE_FMT_RGBA8,RGBA32F:n.default.TEXTURE_FMT_RGBA32F
,A8:n.default.TEXTURE_FMT_A8,I8:n.default.TEXTURE_FMT_L8,AI8:n.default.TEXTURE_FMT_
L8_A8,RGB_PVRTC_2BPPV1:n.default.TEXTURE_FMT_RGB_PVRTC_2BPPV1,RGBA_PVRTC_2BPPV1:n.d
efault.TEXTURE_FMT_RGBA_PVRTC_2BPPV1,RGB_PVRTC_4BPPV1:n.default.TEXTURE_FMT_RGB_PVR
TC_4BPPV1,RGBA_PVRTC_4BPPV1:n.default.TEXTURE_FMT_RGBA_PVRTC_4BPPV1,RGB_ETC1:n.defa
ult.TEXTURE_FMT_RGB_ETC1,RGBA_ETC1:1024,RGB_ETC2:n.default.TEXTURE_FMT_RGB_ETC2,RGB
A_ETC2:n.default.TEXTURE_FMT_RGBA_ETC2}),l=cc.Enum({REPEAT:10497,CLAMP_TO_EDGE:3307
1,MIRRORED_REPEAT:33648}),h=cc.Enum({LINEAR:9729,NEAREST:9728}),c={9728:0,9729:1},u
=[],_={width:void 0,height:void 0,minFilter:void 0,magFilter:void 0,wrapS:void
0,wrapT:void 0,format:void 0,mipmap:void 0,images:void 0,image:void 0,flipY:void
0,premultiplyAlpha:void 0};function f(){for(var t in _)_[t]=void 0;return
u.length=0,_.images=u,_.flipY=!1,_}var
d=cc.Class({name:"cc.Texture2D",extends:t("../assets/CCAsset"),mixins:
[r],properties:{_nativeAsset:{get:function(){return this._image},set:function(t)
{t._compressed&&t._data?
this.initWithData(t._data,this._format,t.width,t.height):this.initWithElement(t)},o
verride:!0},_hasMipmap:!1,_format:o.RGBA8888,_premultiplyAlpha:!1,_flipY:!
1,_minFilter:h.LINEAR,_magFilter:h.LINEAR,_mipFilter:h.LINEAR,_wrapS:l.CLAMP_TO_EDG
E,_wrapT:l.CLAMP_TO_EDGE},statics:
{PixelFormat:o,WrapMode:l,Filter:h,_FilterIndex:c,extnames:
[".png",".jpg",".jpeg",".bmp",".webp",".pvr",".pkm"]},ctor:function()
{this._id=a.getNewId(),this.url="",this.loaded=!
1,this.width=0,this.height=0,this._hashDirty=!
0,this._hash=0,this._texture=null},getImpl:function(){return
this._texture},getId:function(){return this._id},toString:function(){return
this.url||""},update:function(t){if(t){var e=!1;void 0!
==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height),void 0!
==t.minFilter&&(this._minFilter=t.minFilter,t.minFilter=c[t.minFilter]),void 0!
==t.magFilter&&(this._magFilter=t.magFilter,t.magFilter=c[t.magFilter]),void 0!
==t.mipFilter&&(this._mipFilter=t.mipFilter,t.mipFilter=c[t.mipFilter]),void 0!
==t.wrapS&&(this._wrapS=t.wrapS),void 0!==t.wrapT&&(this._wrapT=t.wrapT),void 0!
==t.format&&(this._format=t.format),void 0!==t.flipY&&(this._flipY=t.flipY,e=!
0),void 0!==t.premultiplyAlpha&&(this._premultiplyAlpha=t.premultiplyAlpha,e=!
0),void 0!
==t.mipmap&&(this._hasMipmap=t.mipmap),e&&this._image&&(t.image=this._image),t.imag
es&&t.images.length>0?this._image=t.images[0]:void 0!
==t.image&&(this._image=t.image,t.images||
(u.length=0,t.images=u),t.images.push(t.image)),t.images&&t.images.length>0&&this._
texture.update(t),this._hashDirty=!0}},initWithElement:function(t)
{if(t)if(this._image=t,t.complete||t instanceof
HTMLCanvasElement)this.handleLoadedTexture();else{var
e=this;t.addEventListener("load",(function()
{e.handleLoadedTexture()})),t.addEventListener("error",(function(t)
{cc.warnID(3119,t.message)}))}},initWithData:function(t,e,i,n){var r=f();return
r.image=t,r.images=[r.image],r.hasMipmap=this._hasMipmap,r.premultiplyAlpha=this._p
remultiplyAlpha,r.flipY=this._flipY,r.minFilter=c[this._minFilter],r.magFilter=c[th
is._magFilter],r.wrapS=this._wrapS,r.wrapT=this._wrapT,r.format=e,e===o.RGBA_ETC1&&
(r.format=o.RGB_ETC1),r.width=i,r.height=n,this._texture?
this._texture.update(r):this._texture=new
s.Texture2D(s.device,r),this.width=i,this.height=n,this.loaded=!
0,this.emit("load"),!0},getHtmlElementObj:function(){return
this._image},destroy:function()
{this._image=null,this._texture&&this._texture.destroy(),this._super()},getPixelFor
mat:function(){return this._format},hasPremultipliedAlpha:function(){return
this._premultiplyAlpha||!1},hasMipmap:function(){return this._hasMipmap||!
1},handleLoadedTexture:function()
{if(this._image&&this._image.width&&this._image.height)
{this.width=this._image.width,this.height=this._image.height;var
t=f();t.image=this._image,t.images=[t.image],t.width=this.width,t.height=this.heigh
t,t.hasMipmap=this._hasMipmap,t.format=this._format,this._format===o.RGBA_ETC1&&(t.
format=o.RGB_ETC1),t.premultiplyAlpha=this._premultiplyAlpha,t.flipY=this._flipY,t.
minFilter=c[this._minFilter],
t.magFilter=c[this._magFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,this._textur
e?this._texture.update(t):this._texture=new s.Texture2D(s.device,t),this.loaded=!
0,this.emit("load"),cc.macro.CLEANUP_IMAGE_CACHE&&this._image instanceof
HTMLImageElement&&this._clearImage()}},description:function(){return"<cc.Texture2D
| Name = "+this.url+" | Dimensions = "+this.width+" x
"+this.height+">"},releaseTexture:function()
{this._image=null,this._texture&&this._texture.destroy()},setWrapMode:function(t,e)
{if(this._wrapS!==t||this._wrapT!==e){var
i=f();i.wrapS=t,i.wrapT=e,this.update(i)}},setFilters:function(t,e)
{if(this._minFilter!==t||this._magFilter!==e){var
i=f();i.minFilter=t,i.magFilter=e,this.update(i)}},setFlipY:function(t)
{if(this._flipY!==t){var
e=f();e.flipY=t,this.update(e)}},setPremultiplyAlpha:function(t)
{if(this._premultiplyAlpha!==t){var
e=f();e.premultiplyAlpha=t,this.update(e)}},setMipmap:function(t)
{if(this._hasMipmap!==t){var e=f();e.mipmap=t,this.update(e)}},_getOpts:function()
{var t=f();return
t.width=this.width,t.height=this.height,t.mipmap=this._genMipmap,t.format=this._for
mat,t.premultiplyAlpha=this._premultiplyAlpha,t.anisotropy=this._anisotropy,t.flipY
=this._flipY,t.minFilter=c[this._minFilter],t.magFilter=c[this._magFilter],t.mipFil
ter=c[this._mipFilter],t.wrapS=this._wrapS,t.wrapT=this._wrapT,t},_resetUnderlyingM
ipmaps:function(t){var e=this._getOpts();e.images=t||[null],this._texture?
this._texture.update(e):this._texture=new s.Texture2D(s.device,e)},_serialize:!
1,_deserialize:function(t,e){var i=cc.renderer.device,n=t.split(","),r=n[0];if(r)
{for(var
s=r.split("_"),a=999,l="",h=this._format,c=cc.macro.SUPPORT_TEXTURE_FORMATS,u=0;u<s
.length;u++){var _=s[u].split("@"),f=_[0];f=f.charCodeAt(0)-48,f=d.extnames[f]||
_;var m=c.indexOf(f);if(-1!==m&&m<a){var p=_[1]?
parseInt(_[1]):this._format;if(".pvr"===f&&!
i.ext("WEBGL_compressed_texture_pvrtc"))continue;if(!(p!==o.RGB_ETC1&&p!
==o.RGBA_ETC1||
i.ext("WEBGL_compressed_texture_etc1")))continue;if((p===o.RGB_ETC2||
p===o.RGBA_ETC2)&&!
i.ext("WEBGL_compressed_texture_etc"))continue;a=m,l=f,h=p}}l&&(this._setRawAsset(l
),this._format=h);var v=e.customEnv,y=v&&v.uuid;if(y){this._uuid=y;var
g=this.nativeUrl;this.url=g}}6===n.length&&(this._minFilter=parseInt(n[1]),this._ma
gFilter=parseInt(n[2]),this._wrapS=parseInt(n[3]),this._wrapT=parseInt(n[4]),this._
premultiplyAlpha=49===n[5].charCodeAt(0))},_getHash:function(){if(!
this._hashDirty)return this._hash;var t=this._hasMipmap?
1:0,e=this._premultiplyAlpha?1:0,i=this._flipY?1:0,n=this._minFilter===h.LINEAR?
1:2,r=this._magFilter===h.LINEAR?1:2,s=this._wrapS===l.REPEAT?
1:this._wrapS===l.CLAMP_TO_EDGE?2:3,a=this._wrapT===l.REPEAT?
1:this._wrapT===l.CLAMP_TO_EDGE?2:3,o=this._format;this._image;return
this._hash=Number(""+n+r+o+s+a+t+e+i),this._hashDirty=!
1,this._hash},_isCompressed:function(){return
this._texture&&this._texture._compressed},_clearImage:function()
{cc.loader.removeItem(this._image.id||
this._image.src),this._image.src=""}});cc.Texture2D=e.exports=d}),
{"../../renderer/gfx":348,"../assets/CCAsset":56,"../event/event-
target":132,"../platform/CCClass":200,"../platform/id-
generater":216,"../renderer":243}],74:[(function(t,e,i){"use
strict";t("./CCRawAsset"),t("./CCAsset"),t("./CCFont"),t("./CCPrefab"),t("./CCAudio
Clip"),t("./CCScripts"),t("./CCSceneAsset"),t("./CCSpriteFrame"),t("./CCTexture2D")
,t("./CCRenderTexture"),t("./CCTTFFont"),t("./CCSpriteAtlas"),t("./CCBitmapFont"),t
("./CCLabelAtlas"),t("./CCTextAsset"),t("./CCJsonAsset"),t("./CCBufferAsset"),t("./
CCEffectAsset"),t("./material/CCMaterial")}),
{"./CCAsset":56,"./CCAudioClip":57,"./CCBitmapFont":58,"./CCBufferAsset":59,"./CCEf
fectAsset":60,"./CCFont":61,"./CCJsonAsset":62,"./CCLabelAtlas":63,"./CCPrefab":64,
"./CCRawAsset":65,"./CCRenderTexture":66,"./CCSceneAsset":67,"./CCScripts":68,"./CC
SpriteAtlas":69,"./CCSpriteFrame":70,"./CCTTFFont":71,"./CCTextAsset":72,"./CCTextu
re2D":73,"./material/CCMaterial":75}],75:[(function(t,e,i){"use strict";var
n=a(t("../../../renderer/core/effect")),r=a(t("./murmurhash2_gc")),s=a(t("./utils")
);function a(t){return t&&t.__esModule?t:{default:t}}var
o=t("../CCAsset"),l=t("../CCTexture2D"),h=l.PixelFormat,c=t("../CCEffectAsset"),u=c
c.Class({name:"cc.Material",extends:o,ctor:function(){this._dirty=!
0,this._effect=null,this._owner=null},properties:{_effectAsset:
{type:c,default:null},_defines:{default:{},type:Object},_props:{default:
{},type:Object},effectName:void 0,effectAsset:{get:function(){return
this._effectAsset},set:function(t){this._effectAsset=t,t?
this._effect=n.default.parseEffect(t):cc.error("Can not set an empty effect
asset.")}},effect:{get:function(){return this._effect}},owner:{get:function()
{return this._owner}}},statics:{getBuiltinMaterial:function(t){return
cc.AssetLibrary.getBuiltin("material","builtin-"+t)},getInstantiatedBuiltinMaterial
:function(t,e){var i=this.getBuiltinMaterial(t);return
u.getInstantiatedMaterial(i,e)},getInstantiatedMaterial:function(t,e)
{if(t._owner===e)return t;var i=new u;return i.copy(t),i._name=t._name+"
(Instance)",i._uuid=t._uuid,i._owner=e,i._objFlags|
=cc.Object.Flags.DontSave,i}},copy:function(t){for(var e in
this.effectAsset=t.effectAsset,t._defines)this.define(e,t._defines[e]);for(var i in
t._props)this.setProperty(i,t._props[i])},setProperty:function(t,e,i)
{(this._props[t]!==e||i)&&(this._props[t]=e,this._dirty=!0,this._effect&&(e
instanceof l?
(this._effect.setProperty(t,e.getImpl()),e.getPixelFormat()===h.RGBA_ETC1&&this.def
ine("_USE_ETC1_"+t.toUpperCase(),!
0)):this._effect.setProperty(t,e)))},getProperty:function(t){return
this._props[t]},define:function(t,e,i){(this._defines[t]!==e||
i)&&(this._defines[t]=e,this._dirty=!
0,this._effect&&this._effect.define(t,e))},getDefine:function(t){return
this._defines[t]},setDirty:function(t){this._dirty=t},updateHash:function(t)
{this._dirty=!1,this._hash=t},getHash:function(){if(!this._dirty)return
this._hash;this._dirty=!1;var t=this._effect,e="";return
t&&(e+=s.default.serializeDefines(t._defines),e+=s.default.serializeTechniques(t._t
echniques),e+=s.default.serializeUniforms(t._properties)),this._hash=(0,r.default)
(e,666)},onLoad:function(){if(this.effectAsset=this._effectAsset,this._effect)
{for(var t in this._defines)this.define(t,this._defines[t],!0);for(var e in
this._props)this.setProperty(e,this._props[e],!0)}}});e.exports=cc.Material=u}),
{"../../../renderer/core/effect":337,"../CCAsset":56,"../CCEffectAsset":60,"../CCTe
xture2D":73,"./murmurhash2_gc":77,"./utils":78}],76:[(function(t,e,i){"use
strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var
n=(function(){function t(t,e){for(var i=0;i<e.length;i++){var
n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!
0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return
i&&t(e.prototype,i),n&&t(e,n),e}})
(),r=t("../../../renderer/types"),s=o(t("./murmurhash2_gc")),a=o(t("./utils"));func
tion o(t){return t&&t.__esModule?t:{default:t}}function l(t,e){if(!(t instanceof
e))throw new TypeError("Cannot call a class as a function")}var h=(function()
{function t(){l(this,t),this._properties={},this._defines={},this._dirty=!1}return
n(t,[{key:"setProperty",value:function(t,e){var i=this._properties[t];if(i)
{if(i.value===e)return}else(i=Object.create(null)).name=t,i.type=r.ctor2enums[e.con
structor],this._properties[t]=i;this._dirty=!0,i.value=e}},
{key:"getProperty",value:function(t){var e=this._properties[t];return e?
e.value:null}},{key:"define",value:function(t,e){this._defines[t]!
==e&&(this._dirty=!0,this._defines[t]=e)}},{key:"getDefine",value:function(t)
{return this._defines[t]}},{key:"extractProperties",value:function(){var
t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return
Object.assign(t,this._properties),t}},{key:"extractDefines",value:function(){var
t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return
Object.assign(t,this._defines),t}},{key:"getHash",value:function(){if(!
this._dirty)return this._hash;this._dirty=!1;var t="";return
t+=a.default.serializeDefines(this._defines),t+=a.default.serializeUniforms(this._p
roperties),this._hash=(0,s.default)(t,666)}}]),t})
();i.default=h,e.exports=i.default}),
{"../../../renderer/types":374,"./murmurhash2_gc":77,"./utils":78}],77:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.default=function(t,e){var
i,n=t.length,r=e^n,s=0;for(;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(s)|
(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(+
+s))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+
((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+
((1540483477*(i>>>16)&65535)<<16)),n-=4,++s;switch(n){case
3:r^=(255&t.charCodeAt(s+2))<<16;case 2:r^=(255&t.charCodeAt(s+1))<<8;case
1:r=1540483477*(65535&(r^=255&t.charCodeAt(s)))+
((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+
((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0},e.exports=i.default}),{}],78:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var
n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../../renderer/enums"));function r(t){var
e=t._programName+t._cullMode;return
t._blend&&(e+=t._blendEq+t._blendAlphaEq+t._blendSrc+t._blendDst+t._blendSrcAlpha+t
._blendDstAlpha+t._blendColor),t._depthTest&&(e+=t._depthWrite+t._depthFunc),t._ste
ncilTest&&(e+=t._stencilFuncFront+t._stencilRefFront+t._stencilMaskFront+t._stencil
FailOpFront+t._stencilZFailOpFront+t._stencilZPassOpFront+t._stencilWriteMaskFront+
t._stencilFuncBack+t._stencilRefBack+t._stencilMaskBack+t._stencilFailOpBack+t._ste
ncilZFailOpBack+t._stencilZPassOpBack+t._stencilWriteMaskBack),e}i.default={seriali
zeDefines:function(t){var e="";for(var i in t)e+=i+t[i];return
e},serializeTechniques:function(t){for(var e="",i=0;i<t.length;i++){var
n=t[i];e+=n.stageIDs;for(var s=0;s<n.passes.length;s++)e+=r(n.passes[s])}return
e},serializeUniforms:function(t){var e="";for(var i in t){var
r=t[i],s=r.value;if(s)switch(r.type){case n.default.PARAM_INT:case
n.default.PARAM_FLOAT:e+=s+";";break;case n.default.PARAM_INT2:case
n.default.PARAM_FLOAT2:e+=s.x+","+s.y+";";break;case n.default.PARAM_INT4:case
n.default.PARAM_FLOAT4:e+=s.x+","+s.y+","+s.z+","+s.w+";";break;case
n.default.PARAM_COLOR4:e+=s.r+","+s.g+","+s.b+","+s.a+";";break;case
n.default.PARAM_MAT2:e+=s.m00+","+s.m01+","+s.m02+","+s.m03+";";break;case
n.default.PARAM_TEXTURE_2D:case
n.default.PARAM_TEXTURE_CUBE:e+=s._id+";";break;case n.default.PARAM_INT3:case
n.default.PARAM_FLOAT3:case n.default.PARAM_COLOR3:case n.default.PARAM_MAT3:case
n.default.PARAM_MAT4:e+=JSON.stringify(s)+";"}}return e}},e.exports=i.default}),
{"../../../renderer/enums":343}],79:[(function(t,e,i){"use
strict";t("../CCNode").EventType;var
n=56,r=7,s=cc.Enum({ONCE:0,ON_WINDOW_RESIZE:1,ALWAYS:2});function a(t){return t
instanceof cc.Scene?cc.visibleRect:t._contentSize}function o(t,e,i,n){for(var
r=t._parent._scale.x,s=t._parent._scale.y,a=0,o=0,l=t._parent;;){var
h=l._position;if(a+=h.x,o+=h.y,!(l=l._parent))return
i.x=i.y=0,void(n.x=n.y=1);if(l===e)break;var
c=l._scale.x,u=l._scale.y;a*=c,o*=u,r*=c,s*=u}n.x=0!==r?1/r:1,n.y=0!==s?1/s:1,i.x=-
a,i.y=-o}var l=cc.Vec2.ZERO,h=cc.Vec2.ONE;function c(t,e){var i,s,c,u=e._target;u?
o(t,i=u,s=l,c=h):i=t._parent;var _=a(i),f=i._anchorPoint,d=i instanceof
cc.Scene,m=t._position.x,p=t._position.y,v=t._anchorPoint;if(e._alignFlags&n){var
y,g,x=_.width;d?(y=cc.visibleRect.left.x,g=cc.visibleRect.right.x):g=(y=-f.x*x)
+x,y+=e._isAbsLeft?e._left:e._left*x,g-=e._isAbsRight?
e._right:e._right*x,u&&(y+=s.x,y*=c.x,g+=s.x,g*=c.x);var
b,A=v.x,C=t._scale.x;if(C<0&&(A=1-A,C=-C),e.isStretchWidth)b=g-y,0!
==C&&(t.width=b/C),m=y+A*b;else if(b=t.width*C,e.isAlignHorizontalCenter){var
S=e._isAbsHorizontalCenter?e._horizontalCenter:e._horizontalCenter*x,T=(.5-
f.x)*_.width;u&&(S*=c.x,T+=s.x,T*=c.x),m=T+(A-.5)*b+S}else m=e.isAlignLeft?y+A*b:g+
(A-1)*b}if(e._alignFlags&r){var w,E,M=_.height;d?
(E=cc.visibleRect.bottom.y,w=cc.visibleRect.top.y):w=(E=-f.y*M)
+M,E+=e._isAbsBottom?e._bottom:e._bottom*M,w-=e._isAbsTop?
e._top:e._top*M,u&&(E+=s.y,E*=c.y,w+=s.y,w*=c.y);var
D,B=v.y,P=t._scale.y;if(P<0&&(B=1-B,P=-P),e.isStretchHeight)D=w-E,0!
==P&&(t.height=D/P),p=E+B*D;else if(D=t.height*P,e.isAlignVerticalCenter){var
I=e._isAbsVerticalCenter?e._verticalCenter:e._verticalCenter*M,R=(.5-
f.y)*_.height;u&&(I*=c.y,R+=s.y,R*=c.y),p=R+(B-.5)*D+I}else p=e.isAlignBottom?
E+B*D:w+(B-1)*D}t.setPosition(m,p)}function u(t){var
e=t._widget;e&&(c(t,e),e.alignMode!==s.ALWAYS?e.enabled=!1:f.push(e));for(var
i=t._children,n=0;n<i.length;n++){var r=i[n];r._active&&u(r)}}function _(){var
t=cc.director.getScene();if(t){if(d.isAligning=!
0,d._nodesOrderDirty)f.length=0,u(t),d._nodesOrderDirty=!1;else{var
e,i=d._activeWidgetsIterator;for(i.i=0;i.i<f.length;+
+i.i)c((e=f[i.i]).node,e)}d.isAligning=!1}}var f=[];var
d=cc._widgetManager=e.exports={_AlignFlags:
{TOP:1,MID:2,BOT:4,LEFT:8,CENTER:16,RIGHT:32},isAligning:!1,_nodesOrderDirty:!
1,_activeWidgetsIterator:new cc.js.array.MutableForwardIterator(f),init:function(t)
{t.on(cc.Director.EVENT_AFTER_UPDATE,_),cc.sys.isMobile?
window.addEventListener("resize",this.onResized.bind(this)):cc.view.on("canvas-
resize",this.onResized,this)},add:function(t)
{t.node._widget=t,this._nodesOrderDirty=!0},remove:function(t)
{t.node._widget=null,this._activeWidgetsIterator.remove(t)},onResized:function()
{var
t=cc.director.getScene();t&&this.refreshWidgetOnResized(t)},refreshWidgetOnResized:
function(t){var
e=cc.Node.isNode(t)&&t.getComponent(cc.Widget);e&&e.alignMode===s.ON_WINDOW_RESIZE&
&(e.enabled=!0);for(var i=t._children,n=0;n<i.length;n++){var
r=i[n];this.refreshWidgetOnResized(r)}},updateAlignment:function t(e){var
i=e._parent;cc.Node.isNode(i)&&t(i);var n=e._widget||
e.getComponent(cc.Widget);n&&i&&c(e,n)},AlignMode:s}}),{"../CCNode":52}],80:
[(function(t,e,i){"use strict";var n=s(t("../geom-
utils")),r=s(t("../../renderer/scene/camera"));s(t("../../renderer/core/view"));fun
ction s(t){return t&&t.__esModule?t:{default:t}}var a=t("../utils/affine-
transform"),o=t("../renderer/index"),l=t("../renderer/render-
flow"),h=t("../CCGame"),c=cc.vmath.mat4,u=cc.vmath.vec2,_=cc.vmath.vec3,f=c.create(
),d=c.create(),m=_.create(),p=_.create(),v=_.create(),y=[],g=null;function x()
{if(g){var
t=g.getNode(),e=cc.game.canvas;t.z=e.height/1.1566,t.x=e.width/2,t.y=e.height/2}}va
r
b=cc.Enum({COLOR:1,DEPTH:2,STENCIL:4}),A=cc.Enum({OPAQUE:1,TRANSPARENT:2}),C=cc.Cla
ss({name:"cc.Camera",extends:cc.Component,ctor:function(){if(h.renderType!
==h.RENDER_TYPE_CANVAS){var t=new r.default;t.setStages(["opaque"]),t.dirty=!
0,this._inited=!1,this._camera=t}else this._inited=!0},editor:!1,properties:
{_cullingMask:4294967295,_clearFlags:b.DEPTH|
b.STENCIL,_backgroundColor:cc.color(0,0,0,255),_depth:0,_zoomRatio:1,_targetTexture
:null,_fov:60,_orthoSize:10,_nearClip:.1,_farClip:4096,_ortho:!
0,_rect:cc.rect(0,0,1,1),_renderStages:1,zoomRatio:{get:function(){return
this._zoomRatio},set:function(t){this._zoomRatio=t}},fov:{get:function(){return
this._fov},set:function(t){this._fov=t}},orthoSize:{get:function(){return
this._orthoSize},set:function(t){this._orthoSize=t}},nearClip:{get:function()
{return this._nearClip},set:function(t)
{this._nearClip=t,this._updateClippingpPlanes()}},farClip:{get:function(){return
this._farClip},set:function(t)
{this._farClip=t,this._updateClippingpPlanes()}},ortho:{get:function(){return
this._ortho},set:function(t){this._ortho=t,this._updateProjection()}},rect:
{get:function(){return this._rect},set:function(t)
{this._rect=t,this._updateRect()}},cullingMask:{get:function(){return
this._cullingMask},set:function(t)
{this._cullingMask=t,this._updateCameraMask()}},clearFlags:{get:function(){return
this._clearFlags},set:function(t)
{this._clearFlags=t,this._camera&&this._camera.setClearFlags(t)}},backgroundColor:
{get:function(){return this._backgroundColor},set:function(t)
{this._backgroundColor=t,this._updateBackgroundColor()}},depth:{get:function()
{return this._depth},set:function(t)
{this._depth=t,this._camera&&(this._camera._priority=t)}},targetTexture:
{get:function(){return this._targetTexture},set:function(t)
{this._targetTexture=t,this._updateTargetTexture()}},renderStages:{get:function()
{return this._renderStages},set:function(t)
{this._renderStages=t,this._updateStages()}},_is3D:{get:function(){return
this.node._is3DNode}}},statics:
{main:null,cameras:y,ClearFlags:b,findCamera:function(t){for(var
e=0,i=y.length;e<i;e++){var n=y[e];if(n.containsNode(t))return n}return
null},_setupDebugCamera:function(){if(!g&&h.renderType!==h.RENDER_TYPE_CANVAS){var
t=new
r.default;g=t,t.setStages(["opaque"]),t.setFov(60*Math.PI/180),t.setNear(.1),t.setF
ar(4096),t.dirty=!
0,t._cullingMask=1<<cc.Node.BuiltinGroupIndex.DEBUG,t._priority=cc.macro.MAX_ZINDEX
,t.setClearFlags(0),t.setColor(0,0,0,0);var e=new
cc.Node;t.setNode(e),x(),cc.view.on("design-resolution-
changed",x),o.scene.addCamera(t)}}},_updateCameraMask:function(){if(this._camera)
{var
t=this._cullingMask&~(1<<cc.Node.BuiltinGroupIndex.DEBUG);this._camera._cullingMask
=t}},_updateBackgroundColor:function(){if(this._camera){var
t=this._backgroundColor;this._camera.setColor(t.r/255,t.g/255,t.b/255,t.a/255)}},_u
pdateTargetTexture:function(){if(this._camera){var
t=this._targetTexture;this._camera._framebuffer=t?
t._framebuffer:null}},_updateClippingpPlanes:function()
{this._camera&&(this._camera.setNear(this._nearClip),this._camera.setFar(this._farC
lip))},_updateProjection:function(){if(this._camera){var t=this._ortho?
1:0;this._camera.setType(t)}},_updateRect:function()
{this._camera&&this._camera.setRect(this._rect)},_updateStages:function(){var
t=this._renderStages,e=this._camera._stages;e.length=0,t&A.OPAQUE&&e.push("opaque")
,t&A.TRANSPARENT&&e.push("transparent")},_init:function(){if(!this._inited)
{this._inited=!0;var
t=this._camera;t&&(t.setNode(this.node),t.setClearFlags(this._clearFlags),t._priori
ty=this._depth,this._updateBackgroundColor(),this._updateCameraMask(),this._updateT
argetTexture(),this._updateClippingpPlanes(),this._updateProjection(),this._updateS
tages())}},onLoad:function(){this._init()},onEnable:function(){h.renderType!
==h.RENDER_TYPE_CANVAS&&(cc.director.on(cc.Director.EVENT_BEFORE_DRAW,this.beforeDr
aw,this),o.scene.addCamera(this._camera)),y.push(this)},onDisable:function()
{h.renderType!
==h.RENDER_TYPE_CANVAS&&(cc.director.off(cc.Director.EVENT_BEFORE_DRAW,this.beforeD
raw,this),o.scene.removeCamera(this._camera)),cc.js.array.remove(y,this)},getNodeTo
CameraTransform:function(t){var e=a.identity();return
t.getWorldMatrix(d),this.containsNode(t)&&(this.getWorldToCameraMatrix(f),c.mul(d,d
,f)),a.fromMat4(e,d),e},getCameraToWorldPoint:function(t,e){return e=e||
cc.v2(),this.getCameraToWorldMatrix(f),u.transformMat4(e,t,f),e},getWorldToCameraPo
int:function(t,e){return e=e||
cc.v2(),this.getWorldToCameraMatrix(f),u.transformMat4(e,t,f),e},getCameraToWorldMa
trix:function(t){return
this.getWorldToCameraMatrix(t),c.invert(t,t),t},getWorldToCameraMatrix:function(t)
{this.node.getWorldRT(f);var
e=this.zoomRatio;f.m00*=e,f.m01*=e,f.m04*=e,f.m05*=e;var
i=f.m12,n=f.m13,r=cc.visibleRect.center;return f.m12=r.x-
(f.m00*i+f.m04*n),f.m13=r.y-(f.m01*i+f.m05*n),t!
==f&&c.copy(t,f),t},getRay:function(t){return n.default?
(_.set(v,t.x,t.y,1),this._camera.screenToWorld(p,v,cc.visibleRect.width,cc.visibleR
ect.height),this.ortho?(_.set(v,t.x,t.y,-
1),this._camera.screenToWorld(m,v,cc.visibleRect.width,cc.visibleRect.height)):this
.node.getWorldPosition(m),n.default.Ray.fromPoints(n.default.Ray.create(),m,p)):t},
containsNode:function(t){return t._cullingMask&this.cullingMask},render:function(t)
{if(!(t=t||cc.director.getScene()))return
null;this.node.getWorldMatrix(f),this.beforeDraw(),l.visit(t),o._forward.renderCame
ra(this._camera,o.scene)},_layout:function(){var
t=cc.game.canvas.height/cc.view._scaleY,e=this._targetTexture;e&&(t=e.height);var

i=this._fov*cc.macro.RAD;this.node.z=t/(2*Math.tan(i/2)),i=2*Math.atan(Math.tan(i/2
)/this.zoomRatio),this._camera.setFov(i),this._camera.setOrthoHeight(t/2/this.zoomR
atio)},beforeDraw:function(){this._camera&&(this.node._is3DNode?
(this._camera.setFov(this._fov*cc.macro.RAD),this._camera.setOrthoHeight(this._orth
oSize)):this._layout(),this._camera.dirty=!0)}});e.exports=cc.Camera=C}),
{"../../renderer/core/view":342,"../../renderer/scene/camera":370,"../CCGame":51,".
./geom-utils":137,"../renderer/index":243,"../renderer/render-
flow":244,"../utils/affine-transform":285}],81:[(function(t,e,i){"use
strict";cc.Collider.Box=cc.Class({properties:
{_offset:cc.v2(0,0),_size:cc.size(100,100),offset:{tooltip:!1,get:function(){return
this._offset},set:function(t){this._offset=t},type:cc.Vec2},size:{tooltip:!
1,get:function(){return this._size},set:function(t){this._size.width=t.width<0?
0:t.width,this._size.height=t.height<0?0:t.height},type:cc.Size}},resetInEditor:!
1});var n=cc.Class({name:"cc.BoxCollider",extends:cc.Collider,mixins:
[cc.Collider.Box],editor:!1});cc.BoxCollider=e.exports=n}),{}],82:[(function(t,e,i)
{"use strict";cc.Collider.Circle=cc.Class({properties:
{_offset:cc.v2(0,0),_radius:50,offset:{get:function(){return
this._offset},set:function(t){this._offset=t},type:cc.Vec2},radius:{tooltip:!
1,get:function(){return this._radius},set:function(t){this._radius=t<0?
0:t}}},resetInEditor:!1});var
n=cc.Class({name:"cc.CircleCollider",extends:cc.Collider,mixins:
[cc.Collider.Circle],editor:!1});cc.CircleCollider=e.exports=n}),{}],83:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.Collider",extends:cc.Component,properties:{editing:{default:!
1,serializable:!1,tooltip:!1},tag:{tooltip:!1,default:0,range:
[0,1e7],type:cc.Integer}},onDisable:function()
{cc.director.getCollisionManager().removeCollider(this)},onEnable:function()
{cc.director.getCollisionManager().addCollider(this)}});cc.Collider=e.exports=n}),
{}],84:[(function(t,e,i){"use strict";var
n=t("./CCContact"),r=n.CollisionType,s=t("../CCNode").EventType,a=cc.vmath,o=cc.v2(
);function l(t,e,i,n,r,s){var
a=t.x,o=t.y,l=t.width,h=t.height,c=e.m00,u=e.m01,_=e.m04,f=e.m05,d=c*a+_*o+e.m12,m=
u*a+f*o+e.m13,p=c*l,v=u*l,y=_*h,g=f*h;n.x=d,n.y=m,r.x=p+d,r.y=v+m,i.x=y+d,i.y=g+m,s
.x=p+y+d,s.y=v+g+m}var h=cc.Class({mixins:[cc.EventTarget],properties:{enabled:!
1,enabledDrawBoundingBox:!1},ctor:function()
{this._contacts=[],this._colliders=[],this._debugDrawer=null,this._enabledDebugDraw
=!
1,cc.director._scheduler&&cc.director._scheduler.enableForTarget(this)},update:func
tion(t){if(this.enabled){var e=void 0,i=void
0,n=this._colliders;for(e=0,i=n.length;e<i;e++)this.updateCollider(n[e]);var
s=this._contacts,a=[];for(e=0,i=s.length;e<i;e++){var o=s[e].updateState();o!
==r.None&&a.push([o,s[e]])}for(e=0,i=a.length;e<i;e++){var
l=a[e];this._doCollide(l[0],l[1])}this.drawColliders()}},_doCollide:function(t,e)
{var i=void 0;switch(t){case r.CollisionEnter:i="onCollisionEnter";break;case
r.CollisionStay:i="onCollisionStay";break;case
r.CollisionExit:i="onCollisionExit"}var
n=e.collider1,s=e.collider2,a=n.node._components,o=s.node._components,l=void
0,h=void 0,c=void 0;for(l=0,h=a.length;l<h;l++)(c=a[l])[i]&&c[i]
(s,n);for(l=0,h=o.length;l<h;l++)(c=o[l])[i]&&c[i]
(n,s)},shouldCollide:function(t,e){var
i=t.node,n=e.node,r=cc.game.collisionMatrix;return i!==n&&r[i.groupIndex]
[n.groupIndex]},initCollider:function(t){if(!t.world){var
e=t.world={};e.aabb=cc.rect(),e.preAabb=cc.rect(),e.matrix=a.mat4.create(),e.radius
=0,t instanceof cc.BoxCollider?
(e.position=null,e.points=[cc.v2(),cc.v2(),cc.v2(),cc.v2()]):t instanceof
cc.PolygonCollider?(e.position=null,e.points=t.points.map((function(t){return
cc.v2(t.x,t.y)}))):t instanceof
cc.CircleCollider&&(e.position=cc.v2(),e.points=null)}},updateCollider:function(t)
{var e=t.offset,i=t.world,n=i.aabb,r=i.matrix;t.node.getWorldMatrix(r);var
s=i.preAabb;if(s.x=n.x,s.y=n.y,s.width=n.width,s.height=n.height,t instanceof
cc.BoxCollider){var h=t.size;n.x=e.x-h.width/2,n.y=e.y-
h.height/2,n.width=h.width,n.height=h.height;var
c=i.points,u=c[0],_=c[1],f=c[2],d=c[3];l(n,r,u,_,f,d);var
m=Math.min(u.x,_.x,f.x,d.x),p=Math.min(u.y,_.y,f.y,d.y),v=Math.max(u.x,_.x,f.x,d.x)
,y=Math.max(u.y,_.y,f.y,d.y);n.x=m,n.y=p,n.width=v-m,n.height=y-p}else if(t
instanceof cc.CircleCollider)
{a.vec2.transformMat4(o,t.offset,r),i.position.x=o.x,i.position.y=o.y;var
g=r.m12,x=r.m13;r.m12=r.m13=0,o.x=t.radius,o.y=0,a.vec2.transformMat4(o,o,r);var
b=Math.sqrt(o.x*o.x+o.y*o.y);i.radius=b,n.x=i.position.x-b,n.y=i.position.y-
b,n.width=2*b,n.height=2*b,r.m12=g,r.m13=x}else if(t instanceof cc.PolygonCollider)
{var A=t.points,C=i.points;C.length=A.length;for(var S=1e6,T=1e6,w=-1e6,E=-
1e6,M=0,D=A.length;M<D;M++){C[M]||
(C[M]=cc.v2()),o.x=A[M].x+e.x,o.y=A[M].y+e.y,a.vec2.transformMat4(o,o,r);var
B=o.x,P=o.y;C[M].x=B,C[M].y=P,B>w&&(w=B),B<S&&(S=B),P>E&&(E=P),P<T&&(T=P)}n.x=S,n.y
=T,n.width=w-S,n.height=E-T}},addCollider:function(t){var e=this._colliders;if(-
1===e.indexOf(t)){for(var i=0,r=e.length;i<r;i++){var
a=e[i];if(this.shouldCollide(t,a)){var o=new
n(t,a);this._contacts.push(o)}}e.push(t),this.initCollider(t)}t.node.on(s.GROUP_CHA
NGED,this.onNodeGroupChanged,this)},removeCollider:function(t){var
e=this._colliders,i=e.indexOf(t);if(i>=0){e.splice(i,1);for(var
n=this._contacts,a=n.length-1;a>=0;a--){var o=n[a];o.collider1!==t&&o.collider2!
==t||
(o.touching&&this._doCollide(r.CollisionExit,o),n.splice(a,1))}t.node.off(s.GROUP_C
HANGED,this.onNodeGroupChanged,this)}else
cc.errorID(6600)},onNodeGroupChanged:function(t){for(var
e=t.getComponents(cc.Collider),i=0,n=e.length;i<n;i+
+)this.removeCollider(e[i]),this.addCollider(e[i])},drawColliders:function()
{if(this._enabledDebugDraw){this._checkDebugDrawValid();var
t=this._debugDrawer;t.clear();for(var e=this._colliders,i=0,n=e.length;i<n;i++){var
r=e[i];if(t.strokeColor=cc.Color.WHITE,r instanceof cc.BoxCollider||r instanceof
cc.PolygonCollider){var s=r.world.points;if(s.length>0)
{t.moveTo(s[0].x,s[0].y);for(var a=1;a<s.length;a+
+)t.lineTo(s[a].x,s[a].y);t.close(),t.stroke()}}else r instanceof
cc.CircleCollider&&(t.circle(r.world.position.x,r.world.position.y,r.world.radius),
t.stroke());if(this.enabledDrawBoundingBox){var
o=r.world.aabb;t.strokeColor=cc.Color.BLUE,t.moveTo(o.xMin,o.yMin),t.lineTo(o.xMin,
o.yMax),t.lineTo(o.xMax,o.yMax),t.lineTo(o.xMax,o.yMin),t.close(),t.stroke()}}}},_c
heckDebugDrawValid:function(){if(!this._debugDrawer||!this._debugDrawer.isValid)
{var t=new
cc.Node("COLLISION_MANAGER_DEBUG_DRAW");t.zIndex=cc.macro.MAX_ZINDEX,cc.game.addPer
sistRootNode(t),this._debugDrawer=t.addComponent(cc.Graphics)}}});cc.js.getset(h.pr
ototype,"enabledDebugDraw",(function(){return this._enabledDebugDraw}),(function(t)
{t&&!this._enabledDebugDraw?
(this._checkDebugDrawValid(),this._debugDrawer.node.active=!0):!
t&&this._enabledDebugDraw&&(this._debugDrawer.clear(!
0),this._debugDrawer.node.active=!
1),this._enabledDebugDraw=t})),cc.CollisionManager=e.exports=h}),
{"../CCNode":52,"./CCContact":85}],85:[(function(t,e,i){"use strict";var
n=t("./CCIntersection"),r=cc.Enum({None:0,CollisionEnter:1,CollisionStay:2,Collisio
nExit:3});function s(t,e){this.collider1=t,this.collider2=e,this.touching=!1;var
i=t instanceof cc.BoxCollider||t instanceof cc.PolygonCollider,r=e instanceof
cc.BoxCollider||e instanceof cc.PolygonCollider,s=t instanceof
cc.CircleCollider,a=e instanceof cc.CircleCollider;i&&r?
this.testFunc=n.polygonPolygon:s&&a?this.testFunc=n.circleCircle:i&&a?
this.testFunc=n.polygonCircle:s&&r?
(this.testFunc=n.polygonCircle,this.collider1=e,this.collider2=t):cc.errorID(6601,c
c.js.getClassName(t),cc.js.getClassName(e))}s.prototype.test=function(){var
t=this.collider1.world,e=this.collider2.world;return!!
t.aabb.intersects(e.aabb)&&(this.testFunc===n.polygonPolygon?
this.testFunc(t.points,e.points):this.testFunc===n.circleCircle?
this.testFunc(t,e):this.testFunc===n.polygonCircle&&this.testFunc(t.points,e))},s.p
rototype.updateState=function(){var t=this.test(),e=r.None;return t&&!
this.touching?(this.touching=!0,e=r.CollisionEnter):t&&this.touching?
e=r.CollisionStay:!t&&this.touching&&(this.touching=!
1,e=r.CollisionExit),e},s.CollisionType=r,e.exports=s}),
{"./CCIntersection":86}],86:[(function(t,e,i){"use strict";var n={};function
r(t,e,i,n){var r=(n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x),s=(e.x-t.x)*(t.y-i.y)-
(e.y-t.y)*(t.x-i.x),a=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);if(0!==a){var
o=r/a,l=s/a;if(0<=o&&o<=1&&0<=l&&l<=1)return!0}return!1}function s(t,e,i){for(var
n=i.length,s=0;s<n;++s){if(r(t,e,i[s],i[(s+1)%n]))return!0}return!1}function a(t,e)
{for(var i=!1,n=t.x,r=t.y,s=e.length,a=0,o=s-1;a<s;o=a++){var
l=e[a].x,h=e[a].y,c=e[o].x,u=e[o].y;h>r!=u>r&&n<(c-l)*(r-h)/(u-h)+l&&(i=!i)}return
i}function o(t,e,i,n){var r,s=i.x-e.x,a=i.y-e.y,o=s*s+a*a,l=((t.x-e.x)*s+(t.y-
e.y)*a)/o;return r=n?o?l<0?e:l>1?
i:cc.v2(e.x+l*s,e.y+l*a):e:cc.v2(e.x+l*s,e.y+l*a),s=t.x-r.x,a=t.y-
r.y,Math.sqrt(s*s+a*a)}n.lineLine=r,n.lineRect=function(t,e,i){var n=new
cc.Vec2(i.x,i.y),s=new cc.Vec2(i.x,i.yMax),a=new cc.Vec2(i.xMax,i.yMax),o=new
cc.Vec2(i.xMax,i.y);return!!(r(t,e,n,s)||r(t,e,s,a)||r(t,e,a,o)||
r(t,e,o,n))},n.linePolygon=s,n.rectRect=function(t,e){var
i=t.x,n=t.y,r=t.x+t.width,s=t.y+t.height,a=e.x,o=e.y,l=e.x+e.width,h=e.y+e.height;r
eturn i<=l&&r>=a&&n<=h&&s>=o},n.rectPolygon=function(t,e){var i,n,r=new
cc.Vec2(t.x,t.y),o=new cc.Vec2(t.x,t.yMax),l=new cc.Vec2(t.xMax,t.yMax),h=new
cc.Vec2(t.xMax,t.y);if(s(r,o,e))return!0;if(s(o,l,e))return!0;if(s(l,h,e))return!
0;if(s(h,r,e))return!0;for(i=0,n=e.length;i<n;++i)if(a(e[i],t))return!0;return!!
(a(r,e)||a(o,e)||a(l,e)||a(h,e))},n.polygonPolygon=function(t,e){var
i,n;for(i=0,n=t.length;i<n;++i)if(s(t[i],t[(i+1)%n],e))return!
0;for(i=0,n=e.length;i<n;++i)if(a(e[i],t))return!0;for(i=0,n=t.length;i<n;+
+i)if(a(t[i],e))return!0;return!1},n.circleCircle=function(t,e){return
t.position.sub(e.position).mag()<t.radius+e.radius},n.polygonCircle=function(t,e)
{var i=e.position;if(a(i,t))return!0;for(var
n=0,r=t.length;n<r;n++)if(o(i,0===n?t[t.length-1]:t[n-1],t[n],!0)<e.radius)return!
0;return!1},n.pointInPolygon=a,n.pointLineDistance=o,cc.Intersection=e.exports=n}),
{}],87:[(function(t,e,i){"use strict";cc.Collider.Polygon=cc.Class({properties:
{threshold:{default:1,serializable:!1,visible:!1},_offset:cc.v2(0,0),offset:
{get:function(){return this._offset},set:function(t)
{this._offset=t},type:cc.Vec2},points:{tooltip:!1,default:function(){return[cc.v2(-
50,-50),cc.v2(50,-50),cc.v2(50,50),cc.v2(-50,50)]},type:
[cc.Vec2]}},resetPointsByContour:!1});var
n=cc.Class({name:"cc.PolygonCollider",extends:cc.Collider,mixins:
[cc.Collider.Polygon],editor:!1});cc.PolygonCollider=e.exports=n}),{}],88:
[(function(t,e,i){"use
strict";t("./CCCollisionManager"),t("./CCCollider"),t("./CCBoxCollider"),t("./CCCir
cleCollider"),t("./CCPolygonCollider")}),
{"./CCBoxCollider":81,"./CCCircleCollider":82,"./CCCollider":83,"./CCCollisionManag
er":84,"./CCPolygonCollider":87}],89:[(function(t,e,i){"use
strict";t("./platform/CCClass");var
n=t("./platform/CCObject").Flags,r=t("./platform/js").array,s=n.IsStartCalled,a=n.I
sOnEnableCalled,o=(n.IsEditorOnEnableCalled,"c.start();c._objFlags|
="+s),l="c.update(dt)",h="c.lateUpdate(dt)";function c(t,e){for(var
i=e.constructor._executionOrder,n=e._id,r=0,s=t.length-1,a=s>>>1;r<=s;a=r+s>>>1)
{var o=t[a],l=o.constructor._executionOrder;if(l>i)s=a-1;else if(l<i)r=a+1;else{var
h=o._id;if(h>n)s=a-1;else{if(!(h<n))return a;r=a+1}}}return~r}function u(t,e)
{for(var i=t.array,n=t.i+1;n<i.length;){var
r=i[n];r._enabled&&r.node._activeInHierarchy?++n:
(t.removeAt(n),e&&(r._objFlags&=~e))}}var _=cc.Class({__ctor__:function(t){var
e=r.MutableForwardIterator;this._zero=new e([]),this._neg=new e([]),this._pos=new
e([]),this._invoke=t},statics:
{stableRemoveInactive:u},add:null,remove:null,invoke:null});function f(t,e){return
t.constructor._executionOrder-e.constructor._executionOrder}var
d=cc.Class({extends:_,add:function(t){var e=t.constructor._executionOrder;(0===e?
this._zero:e<0?this._neg:this._pos).array.push(t)},remove:function(t){var
e=t.constructor._executionOrder;(0===e?this._zero:e<0?
this._neg:this._pos).fastRemove(t)},cancelInactive:function(t)
{u(this._zero,t),u(this._neg,t),u(this._pos,t)},invoke:function(){var
t=this._neg;t.array.length>0&&(t.array.sort(f),this._invoke(t),t.array.length=0),th
is._invoke(this._zero),this._zero.array.length=0;var
e=this._pos;e.array.length>0&&(e.array.sort(f),this._invoke(e),e.array.length=0)}})
,m=cc.Class({extends:_,add:function(t){var
e=t.constructor._executionOrder;if(0===e)this._zero.array.push(t);else{var i=e<0?
this._neg.array:this._pos.array,n=c(i,t);n<0&&i.splice(~n,0,t)}},remove:function(t)
{var e=t.constructor._executionOrder;if(0===e)this._zero.fastRemove(t);else{var
i=e<0?this._neg:this._pos,n=c(i.array,t);n>=0&&i.removeAt(n)}},invoke:function(t)
{this._neg.array.length>0&&this._invoke(this._neg,t),this._invoke(this._zero,t),thi
s._pos.array.length>0&&this._invoke(this._pos,t)}});function p(t,e)
{if("function"==typeof t)return e?function(e,i){var
n=e.array;for(e.i=0;e.i<n.length;++e.i){var r=n[e.i];t(r,i)}}:function(e){var
i=e.array;for(e.i=0;e.i<i.length;++e.i){var n=i[e.i];t(n)}};var i="var
a=it.array;for(it.i=0;it.i<a.length;++it.i){var c=a[it.i];"+t+"}";return e?
Function("it","dt",i):Function("it",i)}function v(){this.startInvoker=new
d(p(o)),this.updateInvoker=new m(p(l,!0)),this.lateUpdateInvoker=new m(p(h,!
0)),this.scheduleInNextFrame=[],this._updating=!1}var
y=cc.Class({ctor:v,unscheduleAll:v,statics:
{LifeCycleInvoker:_,OneOffInvoker:d,createInvokeImpl:p,invokeOnEnable:function(t)
{var e=cc.director._compScheduler,i=t.array;for(t.i=0;t.i<i.length;++t.i){var
n=i[t.i];if(n._enabled)n.onEnable(),!n.node._activeInHierarchy||
e._onEnabled(n)}}},_onEnabled:function(t)
{cc.director.getScheduler().resumeTarget(t),t._objFlags|=a,this._updating?
this.scheduleInNextFrame.push(t):this._scheduleImmediate(t)},_onDisabled:function(t
){cc.director.getScheduler().pauseTarget(t),t._objFlags&=~a;var
e=this.scheduleInNextFrame.indexOf(t);e>=0?
r.fastRemoveAt(this.scheduleInNextFrame,e):(!t.start||t._objFlags&s||
this.startInvoker.remove(t),t.update&&this.updateInvoker.remove(t),t.lateUpdate&&th
is.lateUpdateInvoker.remove(t))},enableComp:function(t,e){if(!(t._objFlags&a))
{if(t.onEnable){if(e)return void e.add(t);if(t.onEnable(),!
t.node._activeInHierarchy)return}this._onEnabled(t)}},disableComp:function(t)
{t._objFlags&a&&(t.onDisable&&t.onDisable(),this._onDisabled(t))},_scheduleImmediat
e:function(t){!t.start||t._objFlags&s||
this.startInvoker.add(t),t.update&&this.updateInvoker.add(t),t.lateUpdate&&this.lat
eUpdateInvoker.add(t)},_deferredSchedule:function(){for(var
t=this.scheduleInNextFrame,e=0,i=t.length;e<i;e++){var
n=t[e];this._scheduleImmediate(n)}t.length=0},startPhase:function()
{this._updating=!
0,this.scheduleInNextFrame.length>0&&this._deferredSchedule(),this.startInvoker.inv
oke()},updatePhase:function(t)
{this.updateInvoker.invoke(t)},lateUpdatePhase:function(t)
{this.lateUpdateInvoker.invoke(t),this._updating=!1}});e.exports=y}),
{"./platform/CCClass":200,"./platform/CCObject":206,"./platform/js":220,"./utils/mi
sc":295}],90:[(function(t,e,i){"use strict";var n=t("../../animation/animation-
animator"),r=t("../../animation/animation-clip"),s=t("../event/event-
target"),a=t("../platform/js");function o(t,e){return t===e||
t&&e&&(t.name===e.name||t._uuid===e._uuid)}var
l=cc.Enum({PLAY:"play",STOP:"stop",PAUSE:"pause",RESUME:"resume",LASTFRAME:"lastfra
me",FINISHED:"finished"}),h=cc.Class({name:"cc.Animation",extends:t("./CCComponent"
),mixins:[s],editor:!1,statics:{EventType:l},ctor:function()
{cc.EventTarget.call(this),this._animator=null,this._nameToState=a.createMap(!
0),this._didInit=!1,this._currentClip=null},properties:{_defaultClip:
{default:null,type:r},defaultClip:{type:r,get:function(){return
this._defaultClip},set:function(t){},tooltip:!1},currentClip:{get:function(){return
this._currentClip},set:function(t){this._currentClip=t},type:r,visible:!1},_clips:
{default:[],type:[r],tooltip:!1,visible:!0},playOnLoad:{default:!1,tooltip:!
1}},start:function(){if(this.playOnLoad&&this._defaultClip&&!
(this._animator&&this._animator.isPlaying)){var
t=this.getAnimationState(this._defaultClip.name);this._animator.playState(t)}},onEn
able:function(){this._animator&&this._animator.resume()},onDisable:function()
{this._animator&&this._animator.pause()},onDestroy:function()
{this.stop()},getClips:function(){return this._clips},play:function(t,e){var
i=this.playAdditive(t,e);return
this._animator.stopStatesExcept(i),i},playAdditive:function(t,e){this._init();var
i=this.getAnimationState(t||this._defaultClip&&this._defaultClip.name);if(i)
{this.enabled=!0;var n=this._animator;n.isPlaying&&i.isPlaying?i.isPaused?
n.resumeState(i):
(n.stopState(i),n.playState(i,e)):n.playState(i,e),this.enabledInHierarchy||
n.pause(),this.currentClip=i.clip}return i},stop:function(t){if(this._didInit)if(t)
{var e=this._nameToState[t];e&&this._animator.stopState(e)}else
this._animator.stop()},pause:function(t){if(this._didInit)if(t){var
e=this._nameToState[t];e&&this._animator.pauseState(e)}else this.enabled=!
1},resume:function(t){if(this._didInit)if(t){var
e=this._nameToState[t];e&&this._animator.resumeState(e)}else this.enabled=!
0},setCurrentTime:function(t,e){if(this._init(),e){var
i=this._nameToState[e];i&&this._animator.setStateTime(i,t)}else
this._animator.setStateTime(t)},getAnimationState:function(t){this._init();var
e=this._nameToState[t];return e&&!e.curveLoaded&&this._animator._reloadClip(e),e||
null},addClip:function(t,e){if(t)
{this._init(),cc.js.array.contains(this._clips,t)||this._clips.push(t),e=e||
t.name;var i=this._nameToState[e];if(i){if(i.clip===t)return i;var
n=this._clips.indexOf(i.clip);-1!==n&&this._clips.splice(n,1)}var r=new
cc.AnimationState(t,e);return
this._nameToState[e]=r,r}cc.warnID(3900)},removeClip:function(t,e){if(t)
{this._init();var i=void 0;for(var n in this._nameToState)
{if((i=this._nameToState[n]).clip===t)break}if(t===this._defaultClip){if(!e)return
void cc.warnID(3902);this._defaultClip=null}if(i&&i.isPlaying){if(!e)return void
cc.warnID(3903);this.stop(i.name)}this._clips=this._clips.filter((function(e)
{return e!==t})),i&&delete this._nameToState[i.name]}else
cc.warnID(3901)},sample:function(t){if(this._init(),t){var
e=this._nameToState[t];e&&e.sample()}else
this._animator.sample()},on:function(t,e,i,n){this._init();var
r=this._EventTargetOn(t,e,i,n);if("lastframe"===t)for(var
s=this._animator._anims.array,a=0;a<s.length;++a){s[a]._lastframeEventOn=!0}return
r},off:function(t,e,i,n){if(this._init(),"lastframe"===t){var
r=this._nameToState;for(var s in r){r[s]._lastframeEventOn=!
1}}this._EventTargetOff(t,e,i,n)},_init:function(){this._didInit||(this._didInit=!
0,this._animator=new
n(this.node,this),this._createStates())},_createStates:function()
{this._nameToState=a.createMap(!0);for(var t=null,e=!1,i=0;i<this._clips.length;+
+i){var n=this._clips[i];n&&(t=new
cc.AnimationState(n),this._nameToState[t.name]=t,o(this._defaultClip,n)&&(e=t))}thi
s._defaultClip&&!e&&(t=new
cc.AnimationState(this._defaultClip),this._nameToState[t.name]=t)}});h.prototype._E
ventTargetOn=s.prototype.on,h.prototype._EventTargetOff=s.prototype.off,cc.Animatio
n=e.exports=h}),{"../../animation/animation-animator":9,"../../animation/animation-
clip":10,"../event/event-target":132,"../platform/js":220,"./CCComponent":95}],91:
[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("./CCComponent"),s=t("../assets/CCAudioClip"),a=cc.Class({
name:"cc.AudioSource",extends:r,editor:!1,ctor:function(){this.audio=new
cc.Audio},properties:{_clip:{default:null,type:s},_volume:1,_mute:!1,_loop:!
1,_pausedFlag:{default:!1,serializable:!1},isPlaying:{get:function(){return
this.audio.getState()===cc.Audio.State.PLAYING},visible:!1},clip:{get:function()
{return this._clip},set:function(t){if("string"!=typeof t)t!
==this._clip&&(this._clip=t,this.audio.stop(),this.preload&&(this.audio.src=this._c
lip));else{cc.warnID(8401,"cc.AudioSource","cc.Audi
oClip","AudioClip","cc.AudioClip","audio");var e=this;s._loadByUrl(t,(function(t,i)
{i&&(e.clip=i)}))}},type:s,tooltip:!1,animatable:!1},volume:{get:function(){return
this._volume},set:function(t){return t=n.clamp01(t),this._volume=t,this._mute||
this.audio.setVolume(t),t},tooltip:!1},mute:{get:function(){return
this._mute},set:function(t){return this._mute=t,this.audio.setVolume(t?
0:this._volume),t},animatable:!1,tooltip:!1},loop:{get:function(){return
this._loop},set:function(t){return
this._loop=t,this.audio.setLoop(t),t},animatable:!1,tooltip:!1},playOnLoad:
{default:!1,tooltip:!1,animatable:!1},preload:{default:!1,animatable:!
1}},_ensureDataLoaded:function(){this.audio.src!
==this._clip&&(this.audio.src=this._clip)},_pausedCallback:function()
{this.audio.getState()===cc.Audio.State.PLAYING&&(this.audio.pause(),this._pausedFl
ag=!0)},_restoreCallback:function()
{this._pausedFlag&&this.audio.resume(),this._pausedFlag=!1},onLoad:function()
{this.audio.setVolume(this._mute?
0:this._volume),this.audio.setLoop(this._loop)},onEnable:function()
{this.preload&&(this.audio.src=this._clip),this.playOnLoad&&this.play(),cc.game.on(
cc.game.EVENT_HIDE,this._pausedCallback,this),cc.game.on(cc.game.EVENT_SHOW,this._r
estoreCallback,this)},onDisable:function()
{this.stop(),cc.game.off(cc.game.EVENT_HIDE,this._pausedCallback,this),cc.game.off(
cc.game.EVENT_SHOW,this._restoreCallback,this)},onDestroy:function()
{this.stop(),this.audio.destroy(),cc.audioEngine.uncache(this._clip)},play:function
(){if(this._clip){var
t=this.audio;this._clip.loaded&&t.stop(),this._ensureDataLoaded(),t.setCurrentTime(
0),t.play()}},stop:function(){this.audio.stop()},pause:function()
{this.audio.pause()},resume:function()
{this._ensureDataLoaded(),this.audio.resume()},rewind:function()
{this.audio.setCurrentTime(0)},getCurrentTime:function(){return
this.audio.getCurrentTime()},setCurrentTime:function(t){return
this.audio.setCurrentTime(t),t},getDuration:function(){return
this.audio.getDuration()}});cc.AudioSource=e.exports=a}),
{"../assets/CCAudioClip":57,"../utils/misc":295,"./CCComponent":95}],92:
[(function(t,e,i){"use strict";var
n=["touchstart","touchmove","touchend","mousedown","mousemove","mouseup","mouseente
r","mouseleave","mousewheel"];function r(t){t.stopPropagation()}var
s=cc.Class({name:"cc.BlockInputEvents",extends:t("./CCComponent"),editor:
{menu:"i18n:MAIN_MENU.component.ui/Block Input
Events",inspector:"packages://inspector/inspectors/comps/block-input-
events.js",help:"i18n:COMPONENT.help_url.block_input_events"},onEnable:function()
{for(var t=0;t<n.length;t++)this.node.on(n[t],r,this)},onDisable:function(){for(var
t=0;t<n.length;t++)this.node.off(n[t],r,this)}});cc.BlockInputEvents=e.exports=s}),
{"./CCComponent":95}],93:[(function(t,e,i){"use strict";var
n=t("./CCComponent"),r=t("../utils/gray-sprite-
state"),s=cc.Enum({NONE:0,COLOR:1,SPRITE:2,SCALE:3}),a=cc.Enum({NORMAL:0,HOVER:1,PR
ESSED:2,DISABLED:3}),o=cc.Class({name:"cc.Button",extends:n,mixins:
[r],ctor:function(){this._pressed=!1,this._hovered=!
1,this._fromColor=null,this._toColor=null,this._time=0,this._transitionFinished=!
0,this._fromScale=cc.Vec2.ZERO,this._toScale=cc.Vec2.ZERO,this._originalScale=null,
this._graySpriteMaterial=null,this._spriteMaterial=null,this._sprite=null},editor:!
1,properties:{interactable:{default:!0,tooltip:!1,notify:function()
{this._updateState(),this.interactable||this._resetState()},animatable:!
1},_resizeToTarget:{animatable:!1,set:function(t)
{t&&this._resizeNodeToTargetNode()}},enableAutoGrayEffect:{default:!1,tooltip:!
1,notify:function(){this._updateDisabledState()}},transition:
{default:s.NONE,tooltip:!1,type:s,animatable:!1,notify:function(t)
{this._updateTransition(t)},formerlySerializedAs:"transition"},normalColor:
{default:cc.color(214,214,214),displayName:"Normal",tooltip:!1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.NORMAL&&(this._getTarget().o
pacity=this.normalColor.a),this._updateState()}},pressedColor:
{default:cc.color(211,211,211),displayName:"Pressed",tooltip:!1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.PRESSED&&(this._getTarget().
opacity=this.pressedColor.a),this._updateState()},formerlySerializedAs:"pressedColo
r"},hoverColor:{default:cc.Color.WHITE,displayName:"Hover",tooltip:!
1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.HOVER&&(this._getTarget().op
acity=this.hoverColor.a),this._updateState()},formerlySerializedAs:"hoverColor"},di
sabledColor:{default:cc.color(124,124,124),displayName:"Disabled",tooltip:!
1,notify:function()
{this.transition===s.Color&&this._getButtonState()===a.DISABLED&&(this._getTarget()
.opacity=this.disabledColor.a),this._updateState()}},duration:{default:.1,range:
[0,10],tooltip:!1},zoomScale:{default:1.2,tooltip:!1},normalSprite:
{default:null,type:cc.SpriteFrame,displayName:"Normal",tooltip:!1,notify:function()
{this._updateState()}},pressedSprite:
{default:null,type:cc.SpriteFrame,displayName:"Pressed",tooltip:!
1,formerlySerializedAs:"pressedSprite",notify:function()
{this._updateState()}},hoverSprite:
{default:null,type:cc.SpriteFrame,displayName:"Hover",tooltip:!
1,formerlySerializedAs:"hoverSprite",notify:function()
{this._updateState()}},disabledSprite:
{default:null,type:cc.SpriteFrame,displayName:"Disabled",tooltip:!
1,notify:function(){this._updateState()}},target:
{default:null,type:cc.Node,tooltip:!1,notify:function(t)
{this._applyTarget(),t&&this.target!
==t&&this._unregisterTargetEvent(t)}},clickEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1}},statics:
{Transition:s},__preload:function()
{this._applyTarget(),this._updateState()},_resetState:function(){this._pressed=!
1,this._hovered=!1;var
t=this._getTarget(),e=this.transition,i=this._originalScale;e===s.COLOR&&this.inter
actable?
this._setTargetColor(this.normalColor):e===s.SCALE&&i&&t.setScale(i.x,i.y),this._tr
ansitionFinished=!0},onEnable:function()
{this.normalSprite&&this.normalSprite.ensureLoadTexture(),this.hoverSprite&&this.ho
verSprite.ensureLoadTexture(),this.pressedSprite&&this.pressedSprite.ensureLoadText
ure(),this.disabledSprite&&this.disabledSprite.ensureLoadTexture(),this._registerNo
deEvent()},onDisable:function()
{this._resetState(),this._unregisterNodeEvent()},_getTarget:function(){return
this.target?this.target:this.node},_onTargetSpriteFrameChanged:function(t)
{this.transition===s.SPRITE&&this._setCurrentStateSprite(t.spriteFrame)},_onTargetC
olorChanged:function(t)
{this.transition===s.COLOR&&this._setCurrentStateColor(t)},_onTargetScaleChanged:fu
nction(){var t=this._getTarget();this._originalScale&&(this.transition!==s.SCALE||
this._transitionFinished)&&(this._originalScale.x=t.scaleX,this._originalScale.y=t.
scaleY)},_setTargetColor:function(t){var
e=this._getTarget();e.color=t,e.opacity=t.a},_getStateColor:function(t){switch(t)
{case a.NORMAL:return this.normalColor;case a.HOVER:return this.hoverColor;case
a.PRESSED:return this.pressedColor;case a.DISABLED:return
this.disabledColor}},_getStateSprite:function(t){switch(t){case a.NORMAL:return
this.normalSprite;case a.HOVER:return this.hoverSprite;case a.PRESSED:return
this.pressedSprite;case a.DISABLED:return
this.disabledSprite}},_setCurrentStateColor:function(t)
{switch(this._getButtonState()){case a.NORMAL:this.normalColor=t;break;case
a.HOVER:this.hoverColor=t;break;case a.PRESSED:this.pressedColor=t;break;case
a.DISABLED:this.disabledColor=t}},_setCurrentStateSprite:function(t)
{switch(this._getButtonState()){case a.NORMAL:this.normalSprite=t;break;case
a.HOVER:this.hoverSprite=t;break;case a.PRESSED:this.pressedSprite=t;break;case
a.DISABLED:this.disabledSprite=t}},update:function(t){var e=this._getTarget();if(!
this._transitionFinished&&(this.transition===s.COLOR||this.transition===s.SCALE))
{this.time+=t;var
i=1;if(this.duration>0&&(i=this.time/this.duration),i>=1&&(i=1),this.transition===s
.COLOR){var n=this._fromColor.lerp(this._toColor,i);this._setTargetColor(n)}else
this.transition===s.SCALE&&this._originalScale&&(e.scale=this._fromScale.lerp(this.
_toScale,i));1===i&&(this._transitionFinished=!0)}},_registerNodeEvent:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(c
c.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.on(cc.Node.EventType.
TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this
._onTouchCancel,this),this.node.on(cc.Node.EventType.MOUSE_ENTER,this._onMouseMoveI
n,this),this.node.on(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)},_unr
egisterNodeEvent:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off
(cc.Node.EventType.TOUCH_MOVE,this._onTouchMove,this),this.node.off(cc.Node.EventTy
pe.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL,
this._onTouchCancel,this),this.node.off(cc.Node.EventType.MOUSE_ENTER,this._onMouse
MoveIn,this),this.node.off(cc.Node.EventType.MOUSE_LEAVE,this._onMouseMoveOut,this)
},_registerTargetEvent:function(t)
{t.on(cc.Node.EventType.SCALE_CHANGED,this._onTargetScaleChanged,this)},_unregister
TargetEvent:function(t)
{t.off(cc.Node.EventType.SCALE_CHANGED,this._onTargetScaleChanged,this)},_getTarget
Sprite:function(t){var e=null;return
t&&(e=t.getComponent(cc.Sprite)),e},_applyTarget:function(){var
t=this._getTarget();this._sprite=this._getTargetSprite(t),this._originalScale||
(this._originalScale=cc.Vec2.ZERO),this._originalScale.x=t.scaleX,this._originalSca
le.y=t.scaleY,this._registerTargetEvent(t)},_onTouchBegan:function(t)
{this.interactable&&this.enabledInHierarchy&&(this._pressed=!
0,this._updateState(),t.stopPropagation())},_onTouchMove:function(t)
{if(this.interactable&&this.enabledInHierarchy&&this._pressed){var
e=t.touch,i=this.node._hitTest(e.getLocation()),n=this._getTarget(),r=this._origina
lScale;if(this.transition===s.SCALE&&r)i?
(this._fromScale.x=r.x,this._fromScale.y=r.y,this._toScale.x=r.x*this.zoomScale,thi
s._toScale.y=r.y*this.zoomScale,this._transitionFinished=!1):
(this.time=0,this._transitionFinished=!0,n.setScale(r.
x,r.y));else{var o=void 0;o=i?
a.PRESSED:a.NORMAL,this._applyTransition(o)}t.stopPropagation()}},_onTouchEnded:fun
ction(t)
{this.interactable&&this.enabledInHierarchy&&(this._pressed&&(cc.Component.EventHan
dler.emitEvents(this.clickEvents,t),this.node.emit("click",this)),this._pressed=!
1,this._updateState(),t.stopPropagation())},_onTouchCancel:function()
{this.interactable&&this.enabledInHierarchy&&(this._pressed=!
1,this._updateState())},_onMouseMoveIn:function(){!
this._pressed&&this.interactable&&this.enabledInHierarchy&&(this.transition!
==s.SPRITE||this.hoverSprite)&&(this._hovered||(this._hovered=!
0,this._updateState()))},_onMouseMoveOut:function(){this._hovered&&(this._hovered=!
1,this._updateState())},_updateState:function(){var
t=this._getButtonState();this._applyTransition(t),this._updateDisabledState()},_get
ButtonState:function(){return this.interactable?this._pressed?
a.PRESSED:this._hovered?
a.HOVER:a.NORMAL:a.DISABLED},_updateColorTransitionImmediately:function(t){var
e=this._getStateColor(t);this._setTargetColor(e)},_updateColorTransition:function(t
){if(t===a.DISABLED)this._updateColorTransitionImmediately(t);else{var
e=this._getTarget(),i=this._getStateColor(t);this._fromColor=e.color.clone(),this._
toColor=i,this.time=0,this._transitionFinished=!
1}},_updateSpriteTransition:function(t){var
e=this._getStateSprite(t);this._sprite&&e&&(this._sprite.spriteFrame=e)},_updateSca
leTransition:function(t){t===a.PRESSED?
this._zoomUp():this._zoomBack()},_zoomUp:function()
{this._originalScale&&(this._fromScale.x=this._originalScale.x,this._fromScale.y=th
is._originalScale.y,this._toScale.x=this._originalScale.x*this.zoomScale,this._toSc
ale.y=this._originalScale.y*this.zoomScale,this.time=0,this._transitionFinished=!
1)},_zoomBack:function(){if(this._originalScale){var
t=this._getTarget();this._fromScale.x=t.scaleX,this._fromScale.y=t.scaleY,this._toS
cale.x=this._originalScale.x,this._toScale.y=this._originalScale.y,this.time=0,this
._transitionFinished=!1}},_updateTransition:function(t){t===s.COLOR?
this._updateColorTransitionImmediately(a.NORMAL):t===s.SPRITE&&this._updateSpriteTr
ansition(a.NORMAL),this._updateState()},_applyTransition:function(t){var
e=this.transition;e===s.COLOR?this._updateColorTransition(t):e===s.SPRITE?
this._updateSpriteTransition(t):e===s.SCALE&&this._updateScaleTransition(t)},_resiz
eNodeToTargetNode:!1,_updateDisabledState:function(){if(this._sprite){var t=!
1;this.enableAutoGrayEffect&&(this.transition===s.SPRITE&&this.disabledSprite||
this.interactable||(t=!
0)),this._switchGrayMaterial(t,this._sprite)}}});cc.Button=e.exports=o}),
{"../utils/gray-sprite-state":291,"./CCComponent":95}],94:[(function(t,e,i){"use
strict";var
n=t("../camera/CCCamera"),r=t("./CCComponent"),s=cc.Class({name:"cc.Canvas",extends
:r,editor:!1,resetInEditor:!1,statics:{instance:null},properties:
{_designResolution:cc.size(960,640),designResolution:{get:function(){return
cc.size(this._designResolution)},set:function(t)
{this._designResolution.width=t.width,this._designResolution.height=t.height,this.a
pplySettings(),this.alignWithScreen()},tooltip:!1},_fitWidth:!1,_fitHeight:!
0,fitHeight:{get:function(){return this._fitHeight},set:function(t)
{this._fitHeight!
==t&&(this._fitHeight=t,this.applySettings(),this.alignWithScreen())},tooltip:!
1},fitWidth:{get:function(){return this._fitWidth},set:function(t){this._fitWidth!
==t&&(this._fitWidth=t,this.applySettings(),this.alignWithScreen())},tooltip:!
1}},ctor:function()
{this._thisOnResized=this.alignWithScreen.bind(this)},__preload:function()
{if(s.instance)return
cc.errorID(6700,this.node.name,s.instance.node.name);s.instance=this,cc.sys.isMobil
e?window.addEventListener("resize",this._thisOnResized):cc.view.on("canvas-
resize",this._thisOnResized),this.applySettings(),this.alignWithScreen();var
t=cc.find("Main Camera",this.node);t||((t=new cc.Node("Main
Camera")).parent=this.node,t.setSiblingIndex(0));var e=t.getComponent(n);if(!e)
{e=t.addComponent(n);var i=n.ClearFlags;e.clearFlags=i.COLOR|i.DEPTH|
i.STENCIL,e.depth=-1}n.main=e},onDestroy:function(){cc.sys.isMobile?
window.removeEventListener("resize",this._thisOnResized):cc.view.off("canvas-
resize",this._thisOnResized),s.instance===this&&(s.instance=null)},alignWithScreen:
function(){var t,e,i=e=cc.visibleRect;t=cc.view.getDesignResolutionSize();var
n=0,r=0;!this.fitHeight&&!this.fitWidth&&(n=.5*(t.width-i.width),r=.5*(t.height-
i.height)),this.node.setPosition(.5*i.width+n,.5*i.height+r),this.node.width=e.widt
h,this.node.height=e.height},applySettings:function(){var
t,e=cc.ResolutionPolicy;t=this.fitHeight&&this.fitWidth?e.SHOW_ALL:this.fitHeight||
this.fitWidth?this.fitWidth?e.FIXED_WIDTH:e.FIXED_HEIGHT:e.NO_BORDER;var param=new
URLSearchParams(window.location.search),isExactFit=!1;if(param){var
infoParam=param.get("RP");infoParam&&"exactfit"==infoParam.toLowerCase()&&(isExactF
it=!0)}isExactFit&&(t=e.EXACT_FIT);var
i=this._designResolution;cc.view.setDesignResolutionSize(i.width,i.height,t)}});cc.
Canvas=e.exports=s}),{"../camera/CCCamera":80,"./CCComponent":95}],95:
[(function(t,e,i){"use strict";var
n=t("../platform/CCObject"),r=t("../platform/js"),s=new(t("../platform/id-
generater"))
("Comp"),a=(n.Flags.IsOnEnableCalled,n.Flags.IsOnLoadCalled),o=cc.Class({name:"cc.C
omponent",extends:n,ctor:function()
{this._id=s.getNewId(),this.__eventTargets=[]},properties:{node:
{default:null,visible:!1},name:{get:function(){if(this._name)return this._name;var
t=cc.js.getClassName(this),e=t.lastIndexOf(".");return
e>=0&&(t=t.slice(e+1)),this.node.name+"<"+t+">"},set:function(t)
{this._name=t},visible:!1},uuid:{get:function(){return this._id},visible:!
1},__scriptAsset:!1,_enabled:!0,enabled:{get:function(){return
this._enabled},set:function(t){if(this._enabled!
==t&&(this._enabled=t,this.node._activeInHierarchy)){var
e=cc.director._compScheduler;t?e.enableComp(this):e.disableComp(this)}},visible:!
1,animatable:!0},enabledInHierarchy:{get:function(){return
this._enabled&&this.node._activeInHierarchy},visible:!1},_isOnLoadCalled:
{get:function(){return
this._objFlags&a}}},update:null,lateUpdate:null,__preload:null,onLoad:null,start:nu
ll,onEnable:null,onDisable:null,onDestroy:null,onFocusInEditor:null,onLostFocusInEd
itor:null,resetInEditor:null,addComponent:function(t){return
this.node.addComponent(t)},getComponent:function(t){return
this.node.getComponent(t)},getComponents:function(t){return
this.node.getComponents(t)},getComponentInChildren:function(t){return
this.node.getComponentInChildren(t)},getComponentsInChildren:function(t){return
this.node.getComponentsInChildren(t)},_getLocalBounds:null,onRestore:null,destroy:f
unction()
{this._super()&&this._enabled&&this.node._activeInHierarchy&&cc.director._compSched
uler.disableComp(this)},_onPreDestroy:function()
{this.unscheduleAllCallbacks();for(var t=this.__eventTargets,e=0,i=t.length;e<i;+
+e){var
n=t[e];n&&n.targetOff(this)}t.length=0,cc.director._nodeActivator.destroyComp(this)
,this.node._removeComponent(this)},_instantiate:function(t){return t||
(t=cc.instantiate._clone(this,this)),t.node=null,t},schedule:function(t,e,i,n)
{cc.assertID(t,1619),cc.assertID(e>=0,1620),e=e||0,i=isNaN(i)?
cc.macro.REPEAT_FOREVER:i,n=n||0;var
r=cc.director.getScheduler(),s=r.isTargetPaused(this);r.schedule(t,this,e,i,n,s)},s
cheduleOnce:function(t,e){this.schedule(t,0,0,e)},unschedule:function(t)
{t&&cc.director.getScheduler().unschedule(t,this)},unscheduleAllCallbacks:function(
)
{cc.director.getScheduler().unscheduleAllForTarget(this)}});o._requireComponent=nul
l,o._executionOrder=0,r.value(o,"_registerEditorProps",(function(t,e){var
i=e.requireComponent;i&&(t._requireComponent=i);var
n=e.executionOrder;n&&"number"==typeof
n&&(t._executionOrder=n)})),o.prototype.__scriptUuid="",cc.Component=e.exports=o}),
{"../platform/CCObject":206,"../platform/id-
generater":216,"../platform/js":220}],96:[(function(t,e,i){"use
strict";cc.Component.EventHandler=cc.Class({name:"cc.ClickEvent",properties:
{target:{default:null,type:cc.Node},component:"",_componentId:"",_componentName:
{get:function(){return
this._genCompIdIfNeeded(),this._compId2Name(this._componentId)},set:function(t)
{this._componentId=this._compName2Id(t)}},handler:{default:""},customEventData:
{default:""}},statics:{emitEvents:function(t){var e=void
0;if(arguments.length>0)for(var i=0,n=(e=new Array(arguments.length-
1)).length;i<n;i++)e[i]=arguments[i+1];for(var r=0,s=t.length;r<s;r++){var a=t[r];a
instanceof cc.Component.EventHandler&&a.emit(e)}}},emit:function(t){var
e=this.target;if(cc.isValid(e)){this._genCompIdIfNeeded();var
i=cc.js._getClassById(this._componentId),n=e.getComponent(i);if(cc.isValid(n)){var
r=n[this.handler];"function"==typeof r&&(null!=this.customEventData&&""!
==this.customEventData&&(t=t.slice()).push(this.customEventData),r.apply(n,t))}}},_
compName2Id:function(t){var e=cc.js.getClassByName(t);return
cc.js._getClassId(e)},_compId2Name:function(t){var e=cc.js._getClassById(t);return
cc.js.getClassName(e)},_genCompIdIfNeeded:function(){this._componentId||
(this._componentName=this.component,this.component="")}})}),{}],97:
[(function(t,e,i){"use strict";var
n=t("../platform/CCMacro"),r=t("./CCRenderComponent"),s=t("../assets/material/CCMat
erial"),a=t("../renderer/utils/label/label-frame"),o=t("../renderer/render-
flow"),l=(o.FLAG_COLOR,o.FLAG_OPACITY,n.TextAlignment),h=n.VerticalTextAlignment,c=
cc.Enum({NONE:0,CLAMP:1,SHRINK:2,RESIZE_HEIGHT:3}),u=cc.Enum({NONE:0,BITMAP:1,CHAR:
2}),_=cc.Class({name:"cc.Label",extends:r,ctor:function()
{this._actualFontSize=0,this._assemblerData=null,this._frame=null,this._ttfTexture=
null,this._letterTexture=null},editor:!1,properties:{_useOriginalSize:!0,_string:
{default:"",formerlySerializedAs:"_N$string"},string:{get:function(){return
this._string},set:function(t){var
e=this._string;this._string=t.toString(),this.string!
==e&&this._updateRenderData(),this._checkStringEmpty()},multiline:!0,tooltip:!
1},horizontalAlign:{default:l.LEFT,type:l,tooltip:!1,notify:function(t)
{this.horizontalAlign!==t&&this._updateRenderData()},animatable:!1},verticalA
lign:{default:h.TOP,type:h,tooltip:!1,notify:function(t){this.verticalAlign!
==t&&this._updateRenderData()},animatable:!1},actualFontSize:{displayName:"Actual
Font Size",animatable:!1,readonly:!0,get:function(){return
this._actualFontSize},tooltip:!1},_fontSize:40,fontSize:{get:function(){return
this._fontSize},set:function(t){this._fontSize!
==t&&(this._fontSize=t,this._updateRenderData())},range:[0,512],tooltip:!
1},fontFamily:{default:"Arial",tooltip:!1,notify:function(t){this.fontFamily!
==t&&this._updateRenderData()},animatable:!1},_lineHeight:40,lineHeight:
{get:function(){return this._lineHeight},set:function(t){this._lineHeight!
==t&&(this._lineHeight=t,this._updateRenderData())},tooltip:!1},overflow:
{default:c.NONE,type:c,tooltip:!1,notify:function(t){this.overflow!
==t&&this._updateRenderData()},animatable:!1},_enableWrapText:!0,enableWrapText:
{get:function(){return this._enableWrapText},set:function(t){this._enableWrapText!
==t&&(this._enableWrapText=t,this._updateRenderData())},animatable:!1,tooltip:!
1},_N$file:null,font:{get:function(){return this._N$file},set:function(t)
{this.font!==t&&(t||(this._isSystemFontUsed=!
0),this._N$file=t,t&&this._isSystemFontUsed&&(this._isSystemFontUsed=!
1),"string"==typeof
t&&cc.warnID(4e3),this._renderData&&(this.destroyRenderData(this._renderData),this.
_renderData=null),this._fontAtlas=null,this._updateAssembler(),this._applyFontTextu
re(!0),this._updateRenderData())},type:cc.Font,tooltip:!1,animatable:!
1},_isSystemFontUsed:!0,useSystemFont:{get:function(){return
this._isSystemFontUsed},set:function(t){this._isSystemFontUsed!
==t&&(this.destroyRenderData(this._renderData),this._renderData=null,this._isSystem
FontUsed=!!t,t?
(this.font=null,this._updateAssembler(),this._updateRenderData(),this._checkStringE
mpty()):this._userDefinedFont||this.disableRender())},animatable:!1,tooltip:!
1},_bmFontOriginalSize:{displayName:"BMFont Original Size",get:function(){return
this._N$file instanceof cc.BitmapFont?this._N$file.fontSize:-1},visible:!
0,animatable:!1},_spacingX:0,spacingX:{get:function(){return
this._spacingX},set:function(t)
{this._spacingX=t,this._updateRenderData()},tooltip:!1},_batchAsBitmap:!
1,cacheMode:{default:u.NONE,type:u,tooltip:!1,notify:function(t){this.cacheMode!
==t&&(t!==u.BITMAP||this.font instanceof cc.BitmapFont||
this._frame._resetDynamicAtlasFrame(),t===u.CHAR&&(this._ttfTexture=null),this._upd
ateRenderData(!0))},animatable:!1},_isBold:{default:!1,serializable:!1},_isItalic:
{default:!1,serializable:!1},_isUnderline:{default:!1,serializable:!1}},statics:
{HorizontalAlign:l,VerticalAlign:h,Overflow:c,CacheMode:u},onLoad:function()
{this._batchAsBitmap&&this.cacheMode===u.NONE&&(this.cacheMode=u.BITMAP,this._batch
AsBitmap=!1)},onEnable:function(){this._super(),this.font||this._isSystemFontUsed||
(this.useSystemFont=!0),this.useSystemFont&&!
this.fontFamily&&(this.fontFamily="Arial"),this.node.on(cc.Node.EventType.SIZE_CHAN
GED,this._updateRenderData,this),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this
._updateRenderData,this),this.node.on(cc.Node.EventType.COLOR_CHANGED,this._updateC
olor,this),this._checkStringEmpty(),this._updateRenderData(!
0)},onDisable:function()
{this._super(),this.node.off(cc.Node.EventType.SIZE_CHANGED,this._updateRenderData,
this),this.node.off(cc.Node.EventType.ANCHOR_CHANGED,this._updateRenderData,this),t
his.node.off(cc.Node.EventType.COLOR_CHANGED,this._updateColor,this)},onDestroy:fun
ction()
{this._assembler&&this._assembler._resetAssemblerData&&this._assembler._resetAssemb
lerData(this._assemblerData),this._assemblerData=null,this._letterTexture=null,this
._ttfTexture&&(this._ttfTexture.destroy(),this._ttfTexture=null),this._super()},_ca
nRender:function(){var t=this._super(),e=this.font;if(e instanceof cc.BitmapFont)
{var i=e.spriteFrame;i&&i.textureLoaded()||(t=!1)}return
t},_checkStringEmpty:function(){this.markForRender(!!
this.string)},_on3DNodeChanged:function()
{this._updateAssembler(),this._applyFontTexture(!0)},_updateAssembler:function()
{var t=_._assembler.getAssembler(this);this._assembler!
==t&&(this._assembler=t,this._renderData=null,this._frame=null),this._renderData||
(this._renderData=this._assembler.createData(this),this.markForUpdateRenderData(!
0))},_applyFontTexture:function(t){var e=this.font;if(e instanceof cc.BitmapFont)
{var i=e.spriteFrame;this._frame=i;var n=this,r=function()
{n._frame._texture=i._texture,n._activateMaterial(t),t&&n._assembler&&n._assembler.
updateRenderData(n)};i&&i.textureLoaded()?r():
(this.disableRender(),i&&(i.once("load",r,this),i.ensureLoadTexture()))}else
this._frame||(this._frame=new a),this.cacheMode===u.CHAR&&cc.sys.browserType!
==cc.sys.BROWSER_TYPE_WECHAT_GAME_SUB?
(this._letterTexture=this._assembler._getAssemblerData(),this._frame._refreshTextur
e(this._letterTexture)):this._ttfTexture||(this._ttfTexture=new
cc.Texture2D,this._assemblerData=this._assembler._getAssemblerData(),this._ttfTextu
re.initWithElement(this._assemblerData.canvas)),this.cacheMode!
==u.CHAR&&this._frame._refreshTexture(this._ttfTexture),this._activateMaterial(t),t
&&this._assembler&&this._assembler.updateRenderData(this)},_updateColor:function()
{this.font instanceof cc.BitmapFont||
(this._updateRenderData(),this.node._renderFlag&=~o.FLAG_COLOR)},_activateMaterial:
function(t){if(t)
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS)this._frame._texture.url=this.u
uid+"_texture";else{var e=this.sharedMaterials[0];e?
e=s.getInstantiatedMaterial(e,this):
(e=s.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!
0),e.setProperty("texture",this._frame._texture),this.setMaterial(0,e)}this.markFor
UpdateRenderData(!0),this.markForRender(!0)}},_updateRenderData:function(t){var
e=this._renderData;e&&(e.vertDirty=!0,e.uvDirty=!0,this.markForUpdateRenderData(!
0)),t&&(this._updateAssembler(),this._applyFontTexture(t))},_enableBold:function(t)
{this._isBold=!!t},_enableItalics:function(t){this._isItalic=!!
t},_enableUnderline:function(t){this._isUnderline=!!t}});cc.Label=e.exports=_}),
{"../assets/material/CCMaterial":75,"../platform/CCMacro":205,"../renderer/render-
flow":244,"../renderer/utils/label/label-frame":248,"./CCRenderComponent":106}],98:
[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.LabelOutline",extends:t("./CCComponent"),editor:!1,properties:
{_color:cc.Color.WHITE,_width:1,color:{tooltip:!1,get:function(){return
this._color},set:function(t){this._color=t,this._updateRenderData()}},width:
{tooltip:!1,get:function(){return this._width},set:function(t)
{this._width=t,this._updateRenderData()},range:[0,512]}},onEnable:function()
{this._updateRenderData()},onDisable:function()
{this._updateRenderData()},_updateRenderData:function(){var
t=this.node.getComponent(cc.Label);t&&t._updateRenderData()}});cc.LabelOutline=e.ex
ports=n}),{"./CCComponent":95}],99:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.LabelShadow",extends:t("./CCComponent"),editor:!1,properties:
{_color:cc.Color.WHITE,_offset:cc.v2(2,2),_blur:2,color:{tooltip:!1,get:function()
{return this._color},set:function(t)
{this._color=t,this._updateRenderData()}},offset:{tooltip:!1,get:function(){return
this._offset},set:function(t){this._offset=t,this._updateRenderData()}},blur:
{tooltip:!1,get:function(){return this._blur},set:function(t)
{this._blur=t,this._updateRenderData()},range:[0,1024]}},onEnable:function()
{this._updateRenderData()},onDisable:function()
{this._updateRenderData()},_updateRenderData:function(){var
t=this.node.getComponent(cc.Label);t&&t._updateRenderData()}});cc.LabelShadow=e.exp
orts=n}),{"./CCComponent":95}],100:[(function(t,e,i){"use strict";var
n=t("../CCNode").EventType,r=cc.Enum({NONE:0,HORIZONTAL:1,VERTICAL:2,GRID:3}),s=cc.
Enum({NONE:0,CONTAINER:1,CHILDREN:2}),a=cc.Enum({HORIZONTAL:0,VERTICAL:1}),o=cc.Enu
m({BOTTOM_TO_TOP:0,TOP_TO_BOTTOM:1}),l=cc.Enum({LEFT_TO_RIGHT:0,RIGHT_TO_LEFT:1}),h
=cc.Class({name:"cc.Layout",extends:t("./CCComponent"),editor:!1,properties:
{_layoutSize:cc.size(300,200),_layoutDirty:{default:!0,serializable:!
1},_resize:s.NONE,_N$layoutType:r.NONE,type:{type:r,get:function(){return
this._N$layoutType},set:function(t)
{this._N$layoutType=t,this._doLayoutDirty()},tooltip:!1,animatable:!1},resizeMode:
{type:s,tooltip:!1,animatable:!1,get:function(){return
this._resize},set:function(t){this.type===r.NONE&&t===s.CHILDREN||
(this._resize=t,this._doLayoutDirty())}},cellSize:{default:cc.size(40,40),tooltip:!
1,type:cc.Size,notify:function(){this._doLayoutDirty()}},startAxis:
{default:a.HORIZONTAL,tooltip:!1,type:a,notify:function()
{this._doLayoutDirty()},animatable:!1},_N$padding:{default:0},paddingLeft:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingRight:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingTop:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},paddingBottom:
{default:0,tooltip:!1,notify:function(){this._doLayoutDirty()}},spacingX:
{default:0,notify:function(){this._doLayoutDirty()},tooltip:!1},spacingY:
{default:0,notify:function(){this._doLayoutDirty()},tooltip:!1},verticalDirection:
{default:o.TOP_TO_BOTTOM,type:o,notify:function(){this._doLayoutDirty()},tooltip:!
1,animatable:!1},horizontalDirection:
{default:l.LEFT_TO_RIGHT,type:l,notify:function(){this._doLayoutDirty()},tooltip:!
1,animatable:!1},affectedByScale:{default:!1,notify:function()
{this._doLayoutDirty()},animatable:!1,tooltip:!1}},statics:
{Type:r,VerticalDirection:o,HorizontalDirection:l,ResizeMode:s,AxisDirection:a},_mi
gratePaddingData:function()
{this.paddingLeft=this._N$padding,this.paddingRight=this._N$padding,this.paddingTop
=this._N$padding,this.paddingBottom=this._N$padding,this._N$padding=0},onEnable:fun
ction()
{this._addEventListeners(),this.node.getContentSize().equals(cc.size(0,0))&&this.no
de.setContentSize(this._layoutSize),0!
==this._N$padding&&this._migratePaddingData(),this._doLayoutDirty()},onDisable:func
tion(){this._removeEventListeners()},_doLayoutDirty:function(){this._layoutDirty=!
0},_doScaleDirty:function(){this._layoutDirty=this._layoutDirty||
this.affectedByScale},_addEventListeners:f
unction()
{cc.director.on(cc.Director.EVENT_AFTER_UPDATE,this.updateLayout,this),this.node.on
(n.SIZE_CHANGED,this._resized,this),this.node.on(n.ANCHOR_CHANGED,this._doLayoutDir
ty,this),this.node.on(n.CHILD_ADDED,this._childAdded,this),this.node.on(n.CHILD_REM
OVED,this._childRemoved,this),this.node.on(n.CHILD_REORDER,this._doLayoutDirty,this
),this._addChildrenEventListeners()},_removeEventListeners:function()
{cc.director.off(cc.Director.EVENT_AFTER_UPDATE,this.updateLayout,this),this.node.o
ff(n.SIZE_CHANGED,this._resized,this),this.node.off(n.ANCHOR_CHANGED,this._doLayout
Dirty,this),this.node.off(n.CHILD_ADDED,this._childAdded,this),this.node.off(n.CHIL
D_REMOVED,this._childRemoved,this),this.node.off(n.CHILD_REORDER,this._doLayoutDirt
y,this),this._removeChildrenEventListeners()},_addChildrenEventListeners:function()
{for(var t=this.node.children,e=0;e<t.length;++e){var
i=t[e];i.on(n.SCALE_CHANGED,this._doScaleDirty,this),i.on(n.SIZE_CHANGED,this._doLa
youtDirty,this),i.on(n.POSITION_CHANGED,this._doLayoutDirty,this),i.on(n.ANCHOR_CHA
NGED,this._doLayoutDirty,this),i.on("active-in-hierarchy-
changed",this._doLayoutDirty,this)}},_removeChildrenEventListeners:function()
{for(var t=this.node.children,e=0;e<t.length;++e){var
i=t[e];i.off(n.SCALE_CHANGED,this._doScaleDirty,this),i.off(n.SIZE_CHANGED,this._do
LayoutDirty,this),i.off(n.POSITION_CHANGED,this._doLayoutDirty,this),i.off(n.ANCHOR
_CHANGED,this._doLayoutDirty,this),i.off("active-in-hierarchy-
changed",this._doLayoutDirty,this)}},_childAdded:function(t)
{t.on(n.SCALE_CHANGED,this._doScaleDirty,this),t.on(n.SIZE_CHANGED,this._doLayoutDi
rty,this),t.on(n.POSITION_CHANGED,this._doLayoutDirty,this),t.on(n.ANCHOR_CHANGED,t
his._doLayoutDirty,this),t.on("active-in-hierarchy-
changed",this._doLayoutDirty,this),this._doLayoutDirty()},_childRemoved:function(t)
{t.off(n.SCALE_CHANGED,this._doScaleDirty,this),t.off(n.SIZE_CHANGED,this._doLayout
Dirty,this),t.off(n.POSITION_CHANGED,this._doLayoutDirty,this),t.off(n.ANCHOR_CHANG
ED,this._doLayoutDirty,this),t.off("active-in-hierarchy-
changed",this._doLayoutDirty,this),this._doLayoutDirty()},_resized:function()
{this._layoutSize=this.node.getContentSize(),this._doLayoutDirty()},_doLayoutHorizo
ntally:function(t,e,i,n){var
a=this.node.getAnchorPoint(),h=this.node.children,c=1,u=this.paddingLeft,_=-
a.x*t;this.horizontalDirection===l.RIGHT_TO_LEFT&&(c=-1,_=(1-
a.x)*t,u=this.paddingRight);for(var f=_+c*u-
c*this.spacingX,d=0,m=0,p=0,v=0,y=0,g=0,x=0,b=0;b<h.length;++b)
{(C=h[b]).activeInHierarchy&&x++}var A=this.cellSize.width;this.type!
==r.GRID&&this.resizeMode===s.CHILDREN&&(A=(t-(this.paddingLeft+this.paddingRight)-
(x-1)*this.spacingX)/x);for(b=0;b<h.length;++b){var
C=h[b],S=this._getUsedScaleValue(C.scaleX),T=this._getUsedScaleValue(C.scaleY);if(C
.activeInHierarchy)
{this._resize===s.CHILDREN&&(C.width=A/S,this.type===r.GRID&&(C.height=this.cellSiz
e.height/T));var
w=C.anchorX,E=C.width*S,M=C.height*T;p>m&&(m=p),M>=m&&(p=m,m=M,g=C.getAnchorPoint()
.y),this.horizontalDirection===l.RIGHT_TO_LEFT&&(w=1-
C.anchorX),f=f+c*w*E+c*this.spacingX;var D=c*(1-w)*E;if(e){var B=f+D+c*(c>0?
this.paddingRight:this.paddingLeft),P=this.horizontalDirection===l.LEFT_TO_RIGHT&&B
>(1-a.x)*t,I=this.horizontalDirection===l.RIGHT_TO_LEFT&&B<-a.x*t;(P||I)&&(M>=m?
(0===p&&(p=m),d+=p,p=m):(d+=m,p=M,m=0),f=_+c*(u+w*E),v++)}var
R=i(C,d,v);t>=E+this.paddingLeft+this.paddingRight&&n&&C.setPosition(cc.v2(f,R));va
r O,L=1,F=0===m?M:m;this.verticalDirection===o.TOP_TO_BOTTOM?(y=y||
this.node._contentSize.height,(O=R+(L=-1)*(F*g+this.paddingBottom))<y&&(y=O)):
(y=y||-this.node._contentSize.height,
(O=R+L*(F*g+this.paddingTop))>y&&(y=O)),f+=D}}return
y},_getVerticalBaseHeight:function(t){var e=0,i=0;if(this.resizeMode===s.CONTAINER)
{for(var n=0;n<t.length;++n){var r=t[n];r.activeInHierarchy&&(i+
+,e+=r.height*this._getUsedScaleValue(r.scaleY))}e+=(i-
1)*this.spacingY+this.paddingBottom+this.paddingTop}else
e=this.node.getContentSize().height;return e},_doLayoutVertically:function(t,e,i,n)
{var a=this.node.getAnchorPoint(),h=this.node.children,c=1,u=this.paddingBottom,_=-
a.y*t;this.verticalDirection===o.TOP_TO_BOTTOM&&(c=-1,_=(1-
a.y)*t,u=this.paddingTop);for(var f=_+c*u-
c*this.spacingY,d=0,m=0,p=0,v=0,y=0,g=0,x=0,b=0;b<h.length;++b)
{(C=h[b]).activeInHierarchy&&x++}var A=this.cellSize.height;this.type!
==r.GRID&&this.resizeMode===s.CHILDREN&&(A=(t-(this.paddingTop+this.paddingBottom)-
(x-1)*this.spacingY)/x);for(b=0;b<h.length;++b){var
C=h[b],S=this._getUsedScaleValue(C.scaleX),T=this._getUsedScaleValue(C.scaleY);if(C
.activeInHierarchy)
{this.resizeMode===s.CHILDREN&&(C.height=A/T,this.type===r.GRID&&(C.width=this.cell
Size.width/S));var
w=C.anchorY,E=C.width*S,M=C.height*T;p>m&&(m=p),E>=m&&(p=m,m=E,g=C.getAnchorPoint()
.x),this.verticalDirection===o.TOP_TO_BOTTOM&&(w=1-
C.anchorY),f=f+c*w*M+c*this.spacingY;var D=c*(1-w)*M;if(e){var B=f+D+c*(c>0?
this.paddingTop:this.paddingBottom),P=this.verticalDirection===o.BOTTOM_TO_TOP&&B>(
1-a.y)*t,I=this.verticalDirection===o.TOP_TO_BOTTOM&&B<-a.y*t;(P||I)&&(E>=m?
(0===p&&(p=m),d+=p,p=m):(d+=m,p=E,m=0),f=_+c*(u+w*M),v++)}var R=i(C,d,v);t>=M+
(this.paddingTop+this.paddingBottom)&&n&&C.setPosition(cc.v2(R,f));var
O,L=1,F=0===m?E:m;this.horizontalDirection===l.RIGHT_TO_LEFT?(L=-1,y=y||
this.node._contentSize.width,(O=R+L*(F*g+this.paddingLeft))<y&&(y=O)):(y=y||-
this.node._contentSize.width,(O=R+L*(F*g+this.paddingRight))>y&&(y=O)),f+=D}}return
y},_doLayoutBasic:function(){for(var t=this.node.children,e=null,i=0;i<t.length;+
+i){var n=t[i];n.activeInHierarchy&&(e?
e.union(e,n.getBoundingBoxToWorld()):e=n.getBoundingBoxToWorld())}if(e){var
r=this.node.parent.convertToNodeSpaceAR(cc.v2(e.x,e.y));r=cc.v2(r.x-
this.paddingLeft,r.y-this.paddingBottom);var
s=this.node.parent.convertToNodeSpaceAR(cc.v2(e.x+e.width,e.y+e.height));s=cc.v2(s.
x+this.paddingRight,s.y+this.paddingTop);var a=cc.size(parseFloat((s.x-
r.x).toFixed(2)),parseFloat((s.y-r.y).toFixed(2))),o=this.node.getPosition();if(0!
==a.width){var l=(o.x-r.x)/a.width;this.node.anchorX=parseFloat(l.toFixed(2))}if(0!
==a.height){var h=(o.y-
r.y)/a.height;this.node.anchorY=parseFloat(h.toFixed(2))}this.node.setContentSize(a
)}},_doLayoutGridAxisHorizontal:function(t,e){var i=e.width,n=1,r=-
t.y*e.height,a=this.paddingBottom;this.verticalDirection===o.TOP_TO_BOTTOM&&(n=-
1,r=(1-t.y)*e.height,a=this.paddingTop);var l=function(t,e,i){return
r+n*(e+t.anchorY*t.height*this._getUsedScaleValue(t.scaleY)
+a+i*this.spacingY)}.bind(this),h=0;if(this.resizeMode===s.CONTAINER){var
c=this._doLayoutHorizontally(i,!0,l,!1);(h=r-c)<0&&(h*=-1),r=-
t.y*h,this.verticalDirection===o.TOP_TO_BOTTOM&&(n=-1,r=(1-
t.y)*h)}this._doLayoutHorizontally(i,!0,l,!
0),this.resizeMode===s.CONTAINER&&this.node.setContentSize(i,h)},_doLayoutGridAxisV
ertical:function(t,e){var i=e.height,n=1,r=-
t.x*e.width,a=this.paddingLeft;this.horizontalDirection===l.RIGHT_TO_LEFT&&(n=-
1,r=(1-t.x)*e.width,a=this.paddingRight);var o=function(t,e,i){return
r+n*(e+t.anchorX*t.width*this._getUsedScaleValue(t.scaleX)
+a+i*this.spacingX)}.bind(this),h=0;if(this.resizeMode===s.CONTAINER){var
c=this._doLayoutVertically(i,!0,o,!1);(h=r-c)<0&&(h*=-1),r=-
t.x*h,this.horizontalDirection===l.RIGHT_TO_LEFT&&(n=-1,r=(1-
t.x)*h)}this._doLayoutVertically(i,!0,o,!
0),this.resizeMode===s.CONTAINER&&this.node.setContentSize(h,i)},_doLayoutGrid:func
tion(){var
t=this.node.getAnchorPoint(),e=this.node.getContentSize();this.startAxis===a.HORIZO
NTAL?
this._doLayoutGridAxisHorizontal(t,e):this.startAxis===a.VERTICAL&&this._doLayoutGr
idAxisVertical(t,e)},_getHorizontalBaseWidth:function(t){var
e=0,i=0;if(this.resizeMode===s.CONTAINER){for(var n=0;n<t.length;++n){var
r=t[n];r.activeInHierarchy&&(i+
+,e+=r.width*this._getUsedScaleValue(r.scaleX))}e+=(i-
1)*this.spacingX+this.paddingLeft+this.paddingRight}else
e=this.node.getContentSize().width;return e},_doLayout:function()
{if(this.type===r.HORIZONTAL){var
t=this._getHorizontalBaseWidth(this.node.children);this._doLayoutHorizontally(t,!1,
(function(t){return t.y}),!0),this.node.width=t}else if(this.type===r.VERTICAL){var
e=this._getVerticalBaseHeight(this.node.children);this._doLayoutVertically(e,!1,
(function(t){return t.x}),!0),this.node.height=e}else this.type===r.NONE?
this.resizeMode===s.CONTAINER&&this._doLayoutBasic():this.type===r.GRID&&this._doLa
youtGrid()},_getUsedScaleValue:function(t){return this.affectedByScale?
Math.abs(t):1},updateLayout:function()
{this._layoutDirty&&this.node.children.length>0&&(this._doLayout(),this._layoutDirt
y=!1)}});Object.defineProperty(h.prototype,"padding",{get:function(){return
cc.warnID(4100),this.paddingLeft},set:function(t)
{this._N$padding=t,this._migratePaddingData(),this._doLayoutDirty()}}),cc.Layout=e.
exports=h}),{"../CCNode":52,"./CCComponent":95}],101:[(function(t,e,i){"use
strict";var n=(function(t){return t&&t.__esModule?t:{default:t}})
(t("../../renderer/gfx")),r=t("../vmath");var
s=t("../utils/misc"),a=t("../assets/material/CCMaterial"),o=t("./CCRenderComponent"
),l=t("../renderer/render-
flow"),h=t("../graphics/graphics"),c=(t("../CCNode"),cc.v2()),u=r.mat4.create(),_=[
];function f(t,e,i){_.length=0;for(var n=2*Math.PI/i,r=0;r<i;+
+r)_.push(cc.v2(e.x*Math.cos(n*r)+t.x,e.y*Math.sin(n*r)+t.y));return _}var
d=cc.Enum({RECT:0,ELLIPSE:1,IMAGE_STENCIL:2}),m=cc.Class({name:"cc.Mask",extends:o,
editor:!1,ctor:function()
{this._graphics=null,this._enableMaterial=null,this._exitMaterial=null,this._clearM
aterial=null},properties:{_spriteFrame:
{default:null,type:cc.SpriteFrame},_type:d.RECT,type:{get:function(){return
this._type},set:function(t){this._type=t,this._type!
==d.IMAGE_STENCIL&&(this.spriteFrame=null,this.alphaThreshold=0,this._updateGraphic
s()),this._renderData&&(this.destroyRenderData(this._renderData),this._renderData=n
ull),this._activateMaterial()},type:d,tooltip:!1},spriteFrame:
{type:cc.SpriteFrame,tooltip:!1,get:function(){return
this._spriteFrame},set:function(t){var e=this._spriteFrame;e!
==t&&(this._spriteFrame=t,this._applySpriteFrame(e))}},alphaThreshold:
{default:0,type:cc.Float,range:[0,1,.1],slide:!0,tooltip:!1,notif
y:function(){if(cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS){var
t=this.sharedMaterials[0];t&&t.setProperty("alphaThreshold",this.alphaThreshold)}el
se cc.warnID(4201)}},inverted:{default:!1,type:cc.Boolean,tooltip:!
1,notify:function(){cc.game.renderType!==cc.game.RENDER_TYPE_CANVAS||
cc.warnID(4202)}},_segments:64,segements:{get:function(){return
this._segments},set:function(t)
{this._segments=s.clampf(t,3,1e4),this._updateGraphics()},type:cc.Integer,tooltip:!
1},_resizeToTarget:{animatable:!1,set:function(t)
{t&&this._resizeNodeToTargetNode()}}},statics:{Type:d},onLoad:function()
{this._createGraphics()},onRestore:function(){this._createGraphics(),this._type!
==d.IMAGE_STENCIL?
this._updateGraphics():this._applySpriteFrame()},onEnable:function()
{this._super(),this._type===d.IMAGE_STENCIL?
this._spriteFrame&&this._spriteFrame.textureLoaded()||(this.markForRender(!
1),this._spriteFrame&&(this.markForUpdateRenderData(!
1),this._spriteFrame.once("load",this._onTextureLoaded,this),this._spriteFrame.ensu
reLoadTexture())):this._updateGraphics(),this.node.on(cc.Node.EventType.POSITION_CH
ANGED,this._updateGraphics,this),this.node.on(cc.Node.EventType.ROTATION_CHANGED,th
is._updateGraphics,this),this.node.on(cc.Node.EventType.SCALE_CHANGED,this._updateG
raphics,this),this.node.on(cc.Node.EventType.SIZE_CHANGED,this._updateGraphics,this
),this.node.on(cc.Node.EventType.ANCHOR_CHANGED,this._updateGraphics,this),this.nod
e._renderFlag|=l.FLAG_POST_RENDER,this._activateMaterial()},onDisable:function()
{this._super(),this.node.off(cc.Node.EventType.POSITION_CHANGED,this._updateGraphic
s,this),this.node.off(cc.Node.EventType.ROTATION_CHANGED,this._updateGraphics,this)
,this.node.off(cc.Node.EventType.SCALE_CHANGED,this._updateGraphics,this),this.node
.off(cc.Node.EventType.SIZE_CHANGED,this._updateGraphics,this),this.node.off(cc.Nod
e.EventType.ANCHOR_CHANGED,this._updateGraphics,this),this.node._renderFlag&=~l.FLA
G_POST_RENDER},onDestroy:function()
{this._super(),this._removeGraphics()},_resizeNodeToTargetNode:!
1,_onTextureLoaded:function(){this._renderData&&(this._renderData.uvDirty=!
0,this._renderData.vertDirty=!0,this.markForUpdateRenderData(!
0)),this.enabledInHierarchy&&this._activateMaterial()},_applySpriteFrame:function(t
){t&&t.off&&t.off("load",this._onTextureLoaded,this);var e=this._spriteFrame;e?
e.textureLoaded()?this._onTextureLoaded(null):
(e.once("load",this._onTextureLoaded,this),e.ensureLoadTexture()):this.disableRende
r()},_activateMaterial:function(){if(this._type!==d.IMAGE_STENCIL||
this.spriteFrame&&this.spriteFrame.textureLoaded()){if(cc.game.renderType!
==cc.game.RENDER_TYPE_CANVAS){var t=this.sharedMaterials[0];if(t||
(t=a.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_ALPHA_TEST",!
0),this._type===d.IMAGE_STENCIL){var
e=this.spriteFrame.getTexture();t.define("_USE_MODEL",!1),t.define("USE_TEXTURE",!
0),t.setProperty("texture",e),t.setProperty("alphaThreshold",this.alphaThreshold)}e
lse t.define("_USE_MODEL",!0),t.define("USE_TEXTURE",!1);if(this._enableMaterial||
(this._enableMaterial=a.getInstantiatedBuiltinMaterial("sprite",this)),!
this._exitMaterial)
{this._exitMaterial=a.getInstantiatedBuiltinMaterial("sprite",this);for(var
i=this._exitMaterial.effect.getDefaultTechnique().passes,r=0;r<i.length;r+
+)i[r].setStencilEnabled(n.default.STENCIL_DISABLE)}this._clearMaterial||
(this._clearMaterial=a.getInstantiatedBuiltinMaterial("clear-
stencil",this)),this.setMaterial(0,t)}this.markForRender(!0)}else
this.markForRender(!1)},_createGraphics:function(){this._graphics||
(this._graphics=new
h,this._graphics.node=this.node,this._graphics.lineWidth=0,this._graphics.strokeCol
or=cc.color(0,0,0,0))},_updateGraphics:function(){var
t=this.node,e=this._graphics;e.clear(!1);var
i=t._contentSize.width,n=t._contentSize.height,r=-i*t._anchorPoint.x,s=-
n*t._anchorPoint.y;if(this._type===d.RECT)e.rect(r,s,i,n);else
if(this._type===d.ELLIPSE){for(var a=f(cc.v2(r+i/2,s+n/2),
{x:i/2,y:n/2},this._segments),o=0;o<a.length;++o){var l=a[o];0===o?
e.moveTo(l.x,l.y):e.lineTo(l.x,l.y)}e.close()}cc.game.renderType===cc.game.RENDER_T
YPE_CANVAS?e.stroke():e.fill()},_removeGraphics:function()
{this._graphics&&(this._graphics.destroy(),this._graphics=null),this._clearGraphics
&&(this._clearGraphics.destroy(),this._clearGraphics=null)},_hitTest:function(t)
{var
e=this.node,i=e.getContentSize(),n=i.width,s=i.height,a=c;e._updateWorldMatrix(),r.
mat4.invert(u,e._worldMatrix),r.vec2.transformMat4(a,t,u),a.x+=e._anchorPoint.x*n,a
.y+=e._anchorPoint.y*s;var o=!1;if(this.type===d.RECT||
this.type===d.IMAGE_STENCIL)o=a.x>=0&&a.y>=0&&a.x<=n&&a.y<=s;else
if(this.type===d.ELLIPSE){var
l=n/2,h=s/2,_=a.x-.5*n,f=a.y-.5*s;o=_*_/(l*l)+f*f/(h*h)<1}return
this.inverted&&(o=!o),o},markForUpdateRenderData:function(t)
{t&&this.enabledInHierarchy?this.node._renderFlag|=l.FLAG_UPDATE_RENDER_DATA:t||
(this.node._renderFlag&=~l.FLAG_UPDATE_RENDER_DATA)},markForRender:function(t)
{t&&this.enabledInHierarchy?this.node._renderFlag|=l.FLAG_RENDER|
l.FLAG_UPDATE_RENDER_DATA|l.FLAG_POST_RENDER:t||
(this.node._renderFlag&=~(l.FLAG_RENDER|
l.FLAG_POST_RENDER))},disableRender:function()
{this.node._renderFlag&=~(l.FLAG_RENDER|l.FLAG_UPDATE_RENDER_DATA|
l.FLAG_POST_RENDER)}});cc.Mask=e.exports=m}),
{"../../renderer/gfx":348,"../CCNode":52,"../assets/material/CCMaterial":75,"../gra
phics/graphics":141,"../renderer/render-
flow":244,"../utils/misc":295,"../vmath":316,"./CCRenderComponent":106}],102:
[(function(t,e,i){"use strict";var
n=t("../components/CCRenderComponent"),r=t("../assets/material/CCMaterial"),s=t("..
/utils/texture-util"),a=t("../../core/utils/blend-
func"),o=cc.Class({name:"cc.MotionStreak",extends:n,mixins:[a],editor:!
1,ctor:function(){this._points=[]},properties:{preview:{default:!1,editorOnly:!
0,notify:!1,animatable:!1},_fadeTime:1,fadeTime:{get:function(){return
this._fadeTime},set:function(t){this._fadeTime=t,this.reset()},animatable:!
1,tooltip:!1},_minSeg:1,minSeg:{get:function(){return this._minSeg},set:function(t)
{this._minSeg=t},animatable:!1,tooltip:!1},_stroke:64,stroke:{get:function(){return
this._stroke},set:function(t){this._stroke=t},animatable:!1,tooltip:!1},_texture:
{default:null,type:cc.Texture2D},texture:{get:function(){return
this._texture},set:function(t){this._texture!==t&&(this._texture=t,t&&t.loaded?
this._activateMaterial():
(this.disableRender(),this._ensureLoadTexture()))},type:cc.Texture2D,animatable:!
1,tooltip:!1},_color:cc.Color.WHITE,color:{get:function(){return
this._color},set:function(t){this._color=t},type:cc.Color,tooltip:!1},_fastMode:!
1,fastMode:{get:function(){return this._fastMode},set:function(t)
{this._fastMode=t},animatable:!1,tooltip:!1}},onEnable:function()
{this._super(),this._texture&&this._texture.loaded?this._activateMaterial():
(this.disableRender(),this._ensureLoadTexture()),this.reset()},_ensureLoadTexture:f
unction(){if(this._texture&&!this._texture.loaded){var
t=this;s.postLoadTexture(this._texture,(function()
{t._activateMaterial()}))}},_activateMaterial:function()
{if(this._texture&&this._texture.loaded){var t=this.sharedMaterials[0];t?
t=r.getInstantiatedMaterial(t,this):
(t=r.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!
0),t.setProperty("texture",this._texture),this.setMaterial(0,t),this.markForRender(
!0)}else this.disableRender()},onFocusInEditor:!1,onLostFocusInEditor:!
1,reset:function(){this._points.length=0;var
t=this._renderData;t&&(t.dataLength=0,t.vertexCount=0,t.indiceCount=0)}});cc.Motion
Streak=e.exports=o}),{"../../core/utils/blend-
func":288,"../assets/material/CCMaterial":75,"../components/CCRenderComponent":106,
"../utils/texture-util":302}],103:[(function(t,e,i){"use strict";var
n=cc.Enum({Unified:0,Free:1}),r=cc.Enum({Horizontal:0,Vertical:1}),s=cc.Enum({PAGE_
TURNING:0}),a=cc.Class({name:"cc.PageView",extends:cc.ScrollView,editor:!
1,ctor:function()
{this._curPageIdx=0,this._lastPageIdx=0,this._pages=[],this._scrollCenterOffsetX=[]
,this._scrollCenterOffsetY=[]},properties:{sizeMode:
{default:n.Unified,type:n,tooltip:!1,notify:function()
{this._syncSizeMode()}},direction:{default:r.Horizontal,type:r,tooltip:!
1,notify:function(){this._syncScrollDirection()}},scrollThreshold:
{default:.5,type:cc.Float,slide:!0,range:[0,1,.01],tooltip:!
1},autoPageTurningThreshold:{default:100,type:cc.Float,tooltip:!
1},pageTurningEventTiming:{default:.1,type:cc.Float,range:[0,1,.01],tooltip:!
1},indicator:{default:null,type:cc.PageViewIndicator,tooltip:!1,notify:function()
{this.indicator&&this.indicator.setPageView(this)}},pageTurningSpeed:
{default:.3,type:cc.Float,tooltip:!1},pageEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1}},statics:
{SizeMode:n,Direction:r,EventType:s},__preload:function()
{this.node.on(cc.Node.EventType.SIZE_CHANGED,this._updateAllPagesSize,this)},onEnab
le:function(){this._super(),this.node.on("scroll-ended-with-
threshold",this._dispatchPageTurningEvent,this)},onDisable:function()
{this._super(),this.node.off("scroll-ended-with-
threshold",this._dispatchPageTurningEvent,this)},onLoad:function()
{this._initPages(),this.indicator&&this.indicator.setPageView(this)},onDestroy:func
tion()
{this.node.off(cc.Node.EventType.SIZE_CHANGED,this._updateAllPagesSize,this)},getCu
rrentPageIndex:function(){return this._curPageIdx},setCurrentPageIndex:function(t)
{this.scrollToPage(t,!0)},getPages:function(){return
this._pages},addPage:function(t){t&&-
1===this._pages.indexOf(t)&&this.content&&(this.content.addChild(t),this._pages.pus
h(t),this._updatePageView())},insertPage:function(t,e){e<0||!t||-1!
==this._pages.indexOf(t)||!this.content||(e>=this._pages.length?this.addPage(t):
(this._pages.splice(e,0,t),this.content.addChild(t),this._updatePageView()))},remov
ePage:function(t){if(t&&this.content){var e=this._pages.indexOf(t);-1!==e?
this.removePageAtIndex(e):cc.warnID(4300,t.name)}},removePageAtIndex:function(t)
{var e=this._pages;if(!(t<0||t>=e.length)){var
i=e[t];i&&(this.content.removeChild(i),e.splice(t,1),this._updatePageView())}},remo
veAllPages:function(){if(this.content){for(var
t=this._pages,e=0,i=t.length;e<i;e+
+)this.content.removeChild(t[e]);this._pages.length=0,this._updatePageView()}},scro
llToPage:function(t,e){t<0||t>=this._pages.length||(e=void 0!==e?
e:.3,this._curPageIdx=t,this.scrollToOffset(this._moveOffsetValue(t),e,!
0),this.indicator&&this.indicator._changedState())},getScrollEndedEventTiming:funct
ion(){return this.pageTurningEventTiming},_syncScrollDirection:function()
{this.horizontal=this.direction===r.Horizontal,this.vertical=this.direction===r.Ver
tical},_syncSizeMode:function(){if(this.content){var
t=this.content.getComponent(cc.Layout);if(t)
{if(0===this._pages.length)t.padding=0;else{var e=this._pages[this._pages.length-
1];this.sizeMode===n.Free&&(this.direction===r.Horizontal?
(t.paddingLeft=(this._view.width-
this._pages[0].width)/2,t.paddingRight=(this._view.width-
e.width)/2):this.direction===r.Vertical&&(t.paddingTop=(this._view.height-
this._pages[0].height)/2,t.paddingBottom=(this._view.height-
e.height)/2))}t.updateLayout()}}},_updatePageView:function(){var
t=this.content.getComponent(cc.Layout);t&&t.enabled&&t.updateLayout();var
e=this._pages.length;this._curPageIdx>=e&&(this._curPageIdx=0===e?0:e-
1,this._lastPageIdx=this._curPageIdx);for(var i=0;i<e;+
+i)this._pages[i].setSiblingIndex(i),this.direction===r.Horizontal?
this._scrollCenterOffsetX[i]=Math.abs(this.content.x+this._pages[i].x):this._scroll
CenterOffsetY[i]=Math.abs(this.content.y+this._pages[i].y);this.indicator&&this.ind
icator._refresh()},_updateAllPagesSize:function()
{if(this.sizeMode===n.Unified)for(var
t=this._pages,e=this._view.getContentSize(),i=0,r=t.length;i<r;i+
+)t[i].setContentSize(e)},_initPages:function(){if(this.content){for(var
t=this.content.children,e=0;e<t.length;++e){var i=t[e];this._pages.indexOf(i)>=0||
this._pages.push(i)}this._syncScrollDirection(),this._syncSizeMode(),this._updatePa
geView()}},_dispatchPageTurningEvent:function(){this._lastPageIdx!
==this._curPageIdx&&(this._lastPageIdx=this._curPageIdx,cc.Component.EventHandler.e
mitEvents(this.pageEvents,this,s.PAGE_TURNING),this.node.emit("page-
turning",this))},_isScrollable:function(t,e,i){if(this.sizeMode===n.Free){var
s,a;if(this.direction===r.Horizontal)return
s=this._scrollCenterOffsetX[e],a=this._scrollCenterOffsetX[i],Math.abs(t.x)>=Math.a
bs(s-a)*this.scrollThreshold;if(this.direction===r.Vertical)return
s=this._scrollCenterOffsetY[e],a=this._scrollCenterOffsetY[i],Math.abs(t.y)>=Math.a
bs(s-a)*this.scrollThreshold}else{if(this.direction===r.Horizontal)return
Math.abs(t.x)>=this._view.width*this.scrollThreshold;if(this.direction===r.Vertical
)return
Math.abs(t.y)>=this._view.height*this.scrollThreshold}},_isQuicklyScrollable:functi
on(t){if(this.direction===r.Horizontal)
{if(Math.abs(t.x)>this.autoPageTurningThreshold)return!0}else
if(this.direction===r.Vertical&&Math.abs(t.y)>this.autoPageTurningThreshold)return!
0;return!1},_moveOffsetValue:function(t){var e=cc.v2(0,0);return
this.sizeMode===n.Free?this.direction===r.Horizontal?
e.x=this._scrollCenterOffsetX[t]:this.direction===r.Vertical&&(e.y=this._scrollCent
erOffsetY[t]):this.direction===r.Horizontal?
e.x=t*this._view.width:this.direction===r.Vertical&&(e.y=t*this._view.height),e},_g
etDragDirection:function(t){return this.direction===r.Horizontal?0===t.x?0:t.x>0?
1:-1:this.direction===r.Vertical?0===t.y?0:t.y<0?1:-1:void
0},_handleReleaseLogic:function(t)
{this._autoScrollToPage(),this._scrolling&&(this._scrolling=!
1,this._autoScrolling||this._dispatchEvent("scroll-
ended"))},_autoScrollToPage:function(){var
t=this._startBounceBackIfNeeded(),e=this._touchBeganPosition.sub(this._touchEndPosi
tion);if(t){var i=this._getDragDirection(e);if(0===i)return;this._curPageIdx=i>0?
this._pages.length-1:0,this.indicator&&this.indicator._changedState()}else{var
n=this._curPageIdx,r=n+this._getDragDirection(e),s=this.pageTurningSpeed*Math.abs(n
-r);if(r<this._pages.length){if(this._isScrollable(e,n,r))return void
this.scrollToPage(r,s);var
a=this._calculateTouchMoveVelocity();if(this._isQuicklyScrollable(a))return void
this.scrollToPage(r,s)}this.scrollToPage(n,s)}},_onTouchBegan:function(t,e)
{this._touchBeganPosition=t.touch.getLocation(),this._super(t,e)},_onTouchMoved:fun
ction(t,e){this._super(t,e)},_onTouchEnded:function(t,e)
{this._touchEndPosition=t.touch.getLocation(),this._super(t,e)},_onTouchCancelled:f
unction(t,e)
{this._touchEndPosition=t.touch.getLocation(),this._super(t,e)},_onMouseWheel:funct
ion(){}});cc.PageView=e.exports=a}),{}],104:[(function(t,e,i){"use strict";var
n=cc.Enum({HORIZONTAL:0,VERTICAL:1}),r=cc.Class({name:"cc.PageViewIndicator",extend
s:t("./CCComponent"),editor:!1,properties:{_layout:null,_pageView:null,_indicators:
[],spriteFrame:{default:null,type:cc.SpriteFrame,tooltip:!1},direction:
{default:n.HORIZONTAL,type:n,tooltip:!1},cellSize:{default:cc.size(20,20),tooltip:!
1},spacing:{default:0,tooltip:!1}},statics:{Direction:n},onLoad:function()
{this._updateLayout()},setPageView:function(t)
{this._pageView=t,this._refresh()},_updateLayout:function()
{this._layout=this.getComponent(cc.Layout),this._layout||
(this._layout=this.addComponent(cc.Layout)),this.direction===n.HORIZONTAL?
(this._layout.type=cc.Layout.Type.HORIZONTAL,this._layout.spacingX=this.spacing):th
is.direction===n.VERTICAL&&(this._layout.type=cc.Layout.Type.VERTICAL,this._layout.
spacingY=this.spacing),this._layout.resizeMode=cc.Layout.ResizeMode.CONTAINER},_cre
ateIndicator:function(){var t=new cc.Node;return
t.addComponent(cc.Sprite).spriteFrame=this.spriteFrame,t.parent=this.node,t.width=t
his.cellSize.width,t.height=this.cellSize.height,t},_changedState:function(){var
t=this._indicators;if(0!==t.length){var e=this._pageView._curPageIdx;if(!
(e>=t.length)){for(var i=0;i<t.length;++i)
{t[i].opacity=127.5}t[e].opacity=255}}},_refresh:function(){if(this._pageView){var
t=this._indicators,e=this._pageView.getPages();if(e.length!==t.length){var
i=0;if(e.length>t.length)for(i=0;i<e.length;++i)t[i]||
(t[i]=this._createIndicator());else for(i=t.length-e.length;i>0;--i){var n=t[i-
1];this.node.removeChild(n),t.splice(i-
1,1)}this._layout&&this._layout.enabledInHierarchy&&this._layout.updateLayout(),thi
s._changedState()}}}});cc.PageViewIndicator=e.exports=r}),
{"./CCComponent":95}],105:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("./CCComponent"),s=cc.Enum({HORIZONTAL:0,VERTICAL:1,FILLED
:2}),a=cc.Class({name:"cc.ProgressBar",extends:r,editor:!
1,_initBarSprite:function(){if(this.barSprite){var t=this.barSprite.node;if(!
t)return;var
e=this.node.getContentSize(),i=this.node.getAnchorPoint(),n=t.getContentSize();t.pa
rent===this.node&&this.node.setContentSize(n),this.barSprite.fillType===cc.Sprite.F
illType.RADIAL&&(this.mode=s.FILLED);var
r=t.getContentSize();if(this.mode===s.HORIZONTAL?
this.totalLength=r.width:this.mode===s.VERTICAL?
this.totalLength=r.height:this.totalLength=this.barSprite.fillRange,t.parent===this
.node){var a=-e.width*i.x;t.setPosition(cc.v2(a,0))}}},_updateBarStatus:function()
{if(this.barSprite){var t=this.barSprite.node;if(!t)return;var
e,i,r,a=t.getAnchorPoint(),o=t.getContentSize(),l=t.getPosition(),h=cc.v2(0,.5),c=n
.clamp01(this.progress),u=this.totalLength*c;switch(this.mode){case
s.HORIZONTAL:this.reverse&&(h=cc.v2(1,.5)),e=cc.size(u,o.height),i=this.totalLength
,r=o.height;break;case s.VERTICAL:h=this.reverse?
cc.v2(.5,1):cc.v2(.5,0),e=cc.size(o.width,u),i=o.width,r=this.totalLength}if(this.m
ode===s.FILLED)this.barSprite.type!==cc.Sprite.Type.FILLED?cc.warn("ProgressBar
FILLED mode only works when barSprite's Type is FILLED!"):(this.reverse&&(u*=-
1),this.barSprite.fillRange=u);else if(this.barSprite.type!==cc.Sprite.Type.FILLED)
{var _=h.x-a.x,f=h.y-
a.y,d=cc.v2(i*_,r*f);t.setPosition(l.x+d.x,l.y+d.y),t.setAnchorPoint(h),t.setConten
tSize(e)}else cc.warn("ProgressBar non-FILLED mode only works when barSprite's Type
is non-FILLED!")}},properties:{barSprite:{default:null,type:cc.Sprite,tooltip:!
1,notify:function(){this._initBarSprite()},animatable:!1},mode:
{default:s.HORIZONTAL,type:s,tooltip:!1,notify:function(){if(this.barSprite){var
t=this.barSprite.node;if(!t)return;var
e=t.getContentSize();this.mode===s.HORIZONTAL?
this.totalLength=e.width:this.mode===s.VERTICAL?
this.totalLength=e.height:this.mode===s.FILLED&&(this.totalLength=this.barSprite.fi
llRange)}},animatable:!1},_N$totalLength:1,totalLength:{range:
[0,Number.MAX_VALUE],tooltip:!1,get:function(){return
this._N$totalLength},set:function(t)
{this.mode===s.FILLED&&(t=n.clamp01(t)),this._N$totalLength=t,this._updateBarStatus
()}},progress:{default:1,type:"Float",range:[0,1,.1],slide:!0,tooltip:!
1,notify:function(){this._updateBarStatus()}},reverse:{default:!1,tooltip:!
1,notify:function(){this.barSprite&&(this.barSprite.fillStart=1-
this.barSprite.fillStart),this._updateBarStatus()},animatable:!1}},statics:
{Mode:s}});cc.ProgressBar=e.exports=a}),
{"../utils/misc":295,"./CCComponent":95}],106:[(function(t,e,i){"use
strict";r(t("../../renderer/gfx"));var n=r(t("../../renderer/render-data/render-
data"));function r(t){return t&&t.__esModule?t:{default:t}}var
s=t("./CCComponent"),a=t("../renderer/render-
flow"),o=(t("../platform/CCMacro").BlendFactor,t("../assets/material/CCMaterial")),
l=cc.Class({name:"RenderComponent",extends:s,editor:!1,properties:{_materials:
{default:[],type:o},sharedMaterials:{get:function(){return
this._materials},set:function(t){this._materials=t,this._activateMaterial(!
0)},type:[o],displayName:"Materials"}},ctor:function()
{this._renderData=null,this.__allocedDatas=[],this._vertexFormat=null,this._toPostH
andle=!
1,this._assembler=this.constructor._assembler,this._postAssembler=this.constructor.
_postAssembler},onEnable:function()
{this.node._renderComponent&&(this.node._renderComponent.enabled=!
1),this.node._renderComponent=this,this.node._renderFlag|=a.FLAG_RENDER|
a.FLAG_UPDATE_RENDER_DATA},onDisable:function()
{this.node._renderComponent=null,this.disableRender()},onDestroy:function(){for(var
t=0,e=this.__allocedDatas.length;t<e;t+
+)n.default.free(this.__allocedDatas[t]);this.__allocedDatas.length=0,this._materia
ls.length=0,this._ren
derData=null;var i=this._uniforms;for(var r in
i)_uniformPool.remove(_uniformPool._data.indexOf(i[r]));this._uniforms=null,this._d
efines=null},_canRender:function(){return
this._enabled&&this.node._activeInHierarchy},markForUpdateRenderData:function(t)
{t&&this._canRender()?this.node._renderFlag|=a.FLAG_UPDATE_RENDER_DATA:t||
(this.node._renderFlag&=~a.FLAG_UPDATE_RENDER_DATA)},markForRender:function(t)
{t&&this._canRender()?this.node._renderFlag|=a.FLAG_RENDER:t||
(this.node._renderFlag&=~a.FLAG_RENDER)},markForCustomIARender:function(t)
{t&&this._canRender()?this.node._renderFlag|=a.FLAG_CUSTOM_IA_RENDER:t||
(this.node._renderFlag&=~a.FLAG_CUSTOM_IA_RENDER)},disableRender:function()
{this.node._renderFlag&=~(a.FLAG_RENDER|a.FLAG_CUSTOM_IA_RENDER|
a.FLAG_UPDATE_RENDER_DATA)},requestRenderData:function(){var
t=n.default.alloc();return
this.__allocedDatas.push(t),t},destroyRenderData:function(t){var
e=this.__allocedDatas.indexOf(t);-1!
==e&&(this.__allocedDatas.splice(e,1),n.default.free(t))},getMaterial:function(t)
{if(t<0||t>=this._materials.length)return null;var e=this._materials[t];if(!
e)return null;var i=o.getInstantiatedMaterial(e,this);return i!
==e&&this.setMaterial(t,i),this._materials[t]},setMaterial:function(t,e)
{this._materials[t]=e,e&&this.markForUpdateRenderData(!
0)},_activateMaterial:function(t)
{}});l._assembler=null,l._postAssembler=null,cc.RenderComponent=e.exports=l}),
{"../../renderer/gfx":348,"../../renderer/render-data/render-
data":368,"../assets/material/CCMaterial":75,"../platform/CCMacro":205,"../renderer
/render-flow":244,"./CCComponent":95}],107:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../platform/CCMacro"),s=t("../utils/text-
utils"),a=new(t("../utils/html-text-
parser")),o=r.TextAlignment,l=r.VerticalTextAlignment;var h=new n.Pool(function(t)
{return!!cc.isValid(t)&&!t.getComponent(cc.LabelOutline)},20);h.get=function(t,e)
{var i=this._get();i||(i=new cc.PrivateNode("RICHTEXT_CHILD"));var
n=i.getComponent(cc.Label);return n||
(n=i.addComponent(cc.Label)),i.setPosition(0,0),i.setAnchorPoint(.5,.5),i.setConten
tSize(128,128),i.skewX=0,"string"!=typeof t&&(t=""+t),e.font instanceof cc.Font?
n.font=e.font:n.fontFamily=e.fontFamily,n.string=t,n.horizontalAlign=o.LEFT,n.verti
calAlign=l.TOP,n.fontSize=e.fontSize||40,n.overflow=0,n.enableWrapText=!
0,n.lineHeight=40,n._enableBold(!1),n._enableItalics(!1),n._enableUnderline(!
1),i};var c=cc.Class({name:"cc.RichText",extends:cc.Component,ctor:function()
{this._textArray=null,this._labelSegments=[],this._labelSegmentsCache=[],this._line
sWidth=[],this._updateRichTextStatus=this._updateRichText},editor:!1,properties:
{string:{default:"<color=#00ff00>Rich</c><color=#0fffff>Text</color>",multiline:!
0,tooltip:!1,notify:function(){this._updateRichTextStatus()}},horizontalAlign:
{default:o.LEFT,type:o,tooltip:!1,animatable:!1,notify:function(t)
{this.horizontalAlign!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},fontSize:{default:40,tooltip:!
1,notify:function(t){this.fontSize!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},_fontFamily:"Arial",fontFamily:{tooltip:!
1,get:function(){return this._fontFamily},set:function(t){this._fontFamily!
==t&&(this._fontFamily=t,this._layoutDirty=!
0,this._updateRichTextStatus())},animatable:!1},font:
{default:null,type:cc.TTFFont,tooltip:!1,notify:function(t){this.font!
==t&&(this._layoutDirty=!0,this.font?(this.useSystemFont=!
1,this._onTTFLoaded()):this.useSystemFont=!
0,this._updateRichTextStatus())}},_isSystemFontUsed:!0,useSystemFont:
{get:function(){return this._isSystemFontUsed},set:function(t){(t||
this.font)&&this._isSystemFontUsed!
==t&&(this._isSystemFontUsed=t,this._layoutDirty=!
0,this._updateRichTextStatus())},animatable:!1,tooltip:!1},maxWidth:
{default:0,tooltip:!1,notify:function(t){this.maxWidth!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},lineHeight:{default:40,tooltip:!
1,notify:function(t){this.lineHeight!==t&&(this._layoutDirty=!
0,this._updateRichTextStatus())}},imageAtlas:
{default:null,type:cc.SpriteAtlas,tooltip:!1,notify:function(t){this.imageAtlas!
==t&&(this._layoutDirty=!0,this._updateRichTextStatus())}},handleTouchEvent:
{default:!0,tooltip:!1,notify:function(t){this.handleTouchEvent!
==t&&this.enabledInHierarchy&&(this.handleTouchEvent?
this._addEventListeners():this._removeEventListeners())}}},statics:
{HorizontalAlign:o,VerticalAlign:l},onEnable:function()
{this.handleTouchEvent&&this._addEventListeners(),this._updateRichText(),this._acti
vateChildren(!0)},onDisable:function()
{this.handleTouchEvent&&this._removeEventListeners(),this._activateChildren(!
1)},start:function(){this._onTTFLoaded()},_onColorChanged:function(t)
{this.node.children.forEach((function(e)
{e.color=t}))},_addEventListeners:function()
{this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.
Node.EventType.COLOR_CHANGED,this._onColorChanged,this)},_removeEventListeners:func
tion()
{this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this),this.node.off(c
c.Node.EventType.COLOR_CHANGED,this._onColorChanged,this)},_updateLabelSegmentTextA
ttributes:function(){this._labelSegments.forEach(function(t)
{this._applyTextAttribute(t)}.bind(this))},_createFontLabel:function(t){return
h.get(t,this)},_onTTFLoaded:function(){if(this.font instanceof
cc.TTFFont)if(this.font._nativeAsset)this._layoutDirty=!
0,this._updateRichText();else{var t=this;cc.loader.load(this.font.nativeUrl,
(function(e,i){t._layoutDirty=!0,t._updateRichText()}))}else this._layoutDirty=!
0,this._updateRichText()},_measureText:function(t,e){var i=this,n=function(e){var
n=void 0;return 0===i._labelSegmentsCache.length?
(n=i._createFontLabel(e),i._labelSegmentsCache.push(n)):
(n=i._labelSegmentsCache[0]).getComponent(cc.Label).string=e,n._styleIndex=t,i._app
lyTextAttribute(n),n.getContentSize().width};return e?
n(e):n},_onTouchEnded:function(t){for(var
e=this,i=this.node.getComponents(cc.Component),n=function(n){var
r=e._labelSegments[n],s=r._clickHandler,a=r._clickParam;s&&e._containsTouchLocation
(r,t.touch.getLocation())&&(i.forEach((function(e){e.enabledInHierarchy&&e[s]&&e[s]
(t,a)})),t.stopPropagation())},r=0;r<this._labelSegments.length;+
+r)n(r)},_containsTouchLocation:function(t,e){return
t.getBoundingBoxToWorld().contains(e)},_resetState:function(){for(var
t=this.node.children,e=t.length-1;e>=0;e--){var i=t[e];"RICHTEXT_CHILD"!
==i.name&&"RICHTEXT_Image_CHILD"!==i.name||(i.parent===this.node?
i.parent=null:t.splice(e,1),"RICHTEXT_CHILD"===i.name&&h.put(i))}this._labelSegment
s.length=0,this._labelSegmentsCache.length=0,this._linesWidth.length=0,this._lineOf
fsetX=0,this._lineCount=1,this._labelWidth=0,this._labelHeight=0,this._layoutDirty=
!0},onRestore:!1,_activateChildren:function(t){for(var e=this.node.children.length-
1;e>=0;e--){var i=this.node.children[e];"RICHTEXT_CHILD"!
==i.name&&"RICHTEXT_Image_CHILD"!==i.name||
(i.active=t)}},_addLabelSegment:function(t,e){var i=void 0;return
0===this._labelSegmentsCache.length?i=this._createFontLabel(t):
(i=this._labelSegmentsCache.pop()).getComponent(cc.Label).string=t,i._styleIndex=e,
i._lineCount=this._lineCount,i.active=this.node.active,i.setAnchorPoint(0,0),this._
applyTextAttribute(i),this.node.addChild(i),this._labelSegments.push(i),i},_updateR
ichTextWithMaxWidth:function(t,e,i){var
n=e;if(this._lineOffsetX>0&&n+this._lineOffsetX>this.maxWidth)for(var
r=0;this._lineOffsetX<=this.maxWidth;){var
a=this._getFirstWordLen(t,r,t.length),o=t.substr(r,a),l=this._measureText(i,o);if(!
(this._lineOffsetX+l<=this.maxWidth)){if(r>0){var
h=t.substr(0,r);this._addLabelSegment(h,i),t=t.substr(r,t.length),n=this._measureTe
xt(i,t)}this._updateLineInfo();break}this._lineOffsetX+=l,r+=a}if(n>this.maxWidth)f
or(var c=s.fragmentText(t,n,this.maxWidth,this._measureText(i)),u=0;u<c.length;++u)
{var
_=c[u],f=this._addLabelSegment(_,i).getContentSize();this._lineOffsetX+=f.width,c.l
ength>1&&u<c.length-1&&this._updateLineInfo()}else
this._lineOffsetX+=n,this._addLabelSegment(t,i)},_isLastComponentCR:function(t)
{return t.length-1===t.lastIndexOf("\n")},_updateLineInfo:function()
{this._linesWidth.push(this._lineOffsetX),this._lineOffsetX=0,this._lineCount+
+},_needsUpdateTextLayout:function(t){if(this._layoutDirty||!this._textArray||!
t)return!0;if(this._textArray.length!==t.length)return!0;for(var
e=0;e<this._textArray.length;++e){var i=this._textArray[e],n=t[e];if(i.text!
==n.text)return!0;if(i.style){if(n.style){if(!!n.style.outline!=!!
i.style.outline)return!0;if(i.style.size!==n.style.size||i.style.italic!
==n.style.italic||i.style.isImage!==n.style.isImage)return!
0;if(i.style.isImage===n.style.isImage&&i.style.src!==n.style.src)return!0}else
if(i.style.size||i.style.italic||i.style.isImage||i.style.outline)return!0}else
if(n.style&&(n.style.size||n.style.italic||n.style.isImage||
n.style.outline))return!0}return!1},_addRichTextImageElement:function(t){var
e=t.style.src,i=this.imageAtlas.getSpriteFrame(e);if(i){var n=new
cc.PrivateNode("RICHTEXT_Image_CHILD"),r=n.addComponent(cc.Sprite);n.setAnchorPoint
(0,0),r.type=cc.Sprite.Type.SLICED,r.sizeMode=cc.Sprite.SizeMode.CUSTOM,this.node.a
ddChild(n),this._labelSegments.push(n);var
s=i.getRect(),a=1,o=s.width,l=s.height,h=t.style.imageWidth,c=t.style.imageHeight;c
>0&&c<this.lineHeight?(o*=a=c/l,l*=a):
(o*=a=this.lineHeight/l,l*=a),h>0&&(o=h),this.maxWidth>0?
(this._lineOffsetX+o>this.maxWidth&&this._updateLineInfo(),this._lineOffsetX+=o):
(this._lineOffsetX+=o,this._lineOffsetX>this._labelWidth&&(this._labelWidth=this._l
ineOffsetX)),r.spriteFrame=i,n.setContentSize(o,l),n._lineCount=this._lineCount,t.s
tyle.event?
(t.style.event.click&&(n._clickHandler=t.style.event.click),t.style.event.param?
n._clickParam=t.style.event.param:n._clickParam=""):n._clickHandler=null}else
cc.warnID(4400)},_updateRichText:function(){if(this.enabled){var
t=a.parse(this.string);if(!this._needsUpdateTextLayout(t))return
this._textArray=t,void
this._updateLabelSegmentTextAttributes();this._textArray=t,this._resetState();for(v
ar
e=!1,i=void 0,n=0;n<this._textArray.length;++n){var
r=this._textArray[n],o=r.text;if(""===o){if(r.style&&r.style.newline)
{this._updateLineInfo();continue}if(r.style&&r.style.isImage&&this.imageAtlas)
{this._addRichTextImageElement(r);continue}}for(var l=o.split("\n"),h=0;h<l.length;
++h){var c=l[h];if(""!==c)if(e=!1,this.maxWidth>0){var
u=this._measureText(n,c);this._updateRichTextWithMaxWidth(c,u,n),l.length>1&&h<l.le
ngth-1&&this._updateLineInfo()}else
i=this._addLabelSegment(c,n).getContentSize(),this._lineOffsetX+=i.width,this._line
OffsetX>this._labelWidth&&(this._labelWidth=this._lineOffsetX),l.length>1&&h<l.leng
th-1&&this._updateLineInfo();else{if(this._isLastComponentCR(o)&&h===l.length-
1)continue;this._updateLineInfo(),e=!0}}}e||
this._linesWidth.push(this._lineOffsetX),this.maxWidth>0&&(this._labelWidth=this.ma
xWidth),this._labelHeight=(this._lineCount+s.BASELINE_RATIO)*this.lineHeight,this.n
ode.setContentSize(this._labelWidth,this._labelHeight),this._updateRichTextPosition
(),this._layoutDirty=!1}},_getFirstWordLen:function(t,e,i){var
n=t.charAt(e);if(s.isUnicodeCJK(n)||s.isUnicodeSpace(n))return 1;for(var
r=1,a=e+1;a<i&&(n=t.charAt(a),!s.isUnicodeSpace(n)&&!s.isUnicodeCJK(n));++a)r+
+;return r},_updateRichTextPosition:function(){for(var
t=0,e=1,i=this._lineCount,n=0;n<this._labelSegments.length;++n){var
r=this._labelSegments[n],s=r._lineCount;s>e&&(t=0,e=s);var
a=0;switch(this.horizontalAlign){case o.LEFT:a=-this._labelWidth/2;break;case
o.CENTER:a=-this._linesWidth[s-1]/2;break;case o.RIGHT:a=this._labelWidth/2-
this._linesWidth[s-1]}r.x=t+a;var l=r.getContentSize();r.y=this.lineHeight*(i-s)-
this._labelHeight/2,s===e&&(t+=l.width)}},_convertLiteralColorValue:function(t){var
e=t.toUpperCase();return cc.Color[e]?
cc.Color[e]:cc.color().fromHEX(t)},_applyTextAttribute:function(t){var
e=t.getComponent(cc.Label);if(e){var
i=t._styleIndex;this._isSystemFontUsed&&(e.fontFamily=this._fontFamily),e.useSystem
Font=this._isSystemFontUsed,e.lineHeight=this.lineHeight,e.horizontalAlign=o.LEFT,e
.verticalAlign=l.CENTER;var
n=null;if(this._textArray[i]&&(n=this._textArray[i].style),n&&n.color?
t.color=this._convertLiteralColorValue(n.color):t.color=this.node.color,e._enableBo
ld(n&&n.bold),e._enableItalics(n&&n.italic),n&&n.italic&&(t.skewX=12),e._enableUnde
rline(n&&n.underline),n&&n.outline){var r=t.getComponent(cc.LabelOutline);r||
(r=t.addComponent(cc.LabelOutline)),r.color=this._convertLiteralColorValue(n.outlin
e.color),r.width=n.outline.width}n&&n.size?
e.fontSize=n.size:e.fontSize=this.fontSize,e._updateRenderData(!0),n&&n.event?
(n.event.click&&(t._clickHandler=n.event.click),n.event.param?
t._clickParam=n.event.param:t._clickParam=""):t._clickHandler=null}},onDestroy:func
tion(){for(var t=0;t<this._labelSegments.length;+
+t)this._labelSegments[t].removeFromParent(),h.put(this._labelSegments[t])}});cc.Ri
chText=e.exports=c}),
{"../platform/CCMacro":205,"../platform/js":220,"../utils/html-text-
parser":292,"../utils/text-utils":301}],108:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=(t("./CCComponent"),cc.Enum({HORIZONTAL:0,VERTICAL:1})),s=cc
.Class({name:"cc.Scrollbar",extends:t("./CCComponent"),editor:!1,properties:
{_scrollView:null,_touching:!1,_autoHideRemainingTime:{default:0,serializable:!
1},_opacity:255,handle:{default:null,type:cc.Sprite,tooltip:!1,notify:function()
{this._onScroll(cc.v2(0,0))},animatable:!1},direction:
{default:r.HORIZONTAL,type:r,tooltip:!1,notify:function()
{this._onScroll(cc.v2(0,0))},animatable:!1},enableAutoHide:{default:!0,animatable:!
1,tooltip:!1},autoHideTime:{default:1,animatable:!1,tooltip:!1}},statics:
{Direction:r},setTargetScrollView:function(t)
{this._scrollView=t},_convertToScrollViewSpace:function(t){var
e=t.convertToWorldSpace(cc.v2(0,0));return
this._scrollView.node.convertToNodeSpace(e)},_setOpacity:function(t)
{this.handle&&(this.node.opacity=t,this.handle.node.opacity=t)},_onScroll:function(
t){if(this._scrollView){var e=this._scrollView.content;if(e){var
i=e.getContentSize(),n=this._scrollView.node.getContentSize(),s=this.node.getConten
tSize();if(this._conditionalDisableScrollBar(i,n))return;this.enableAutoHide&&(this
._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity));var
a=0,o=0,l=0,h=0,c=0;this.direction===r.HORIZONTAL?
(a=i.width,o=n.width,c=s.width,l=t.x,h=-
this._convertToScrollViewSpace(e).x):this.direction===r.VERTICAL&&(a=i.height,o=n.h
eight,c=s.height,l=t.y,h=-this._convertToScrollViewSpace(e).y);var
u=this._calculateLength(a,o,c,l),_=this._calculatePosition(a,o,c,h,l,u);this._updat
eLength(u),this._updateHanlderPosition(_)}}},_updateHanlderPosition:function(t)
{if(this.handle){var
e=this._fixupHandlerPosition();this.handle.node.setPosition(t.x+e.x,t.y+e.y)}},_fix
upHandlerPosition:function(){var
t=this.node.getContentSize(),e=this.node.getAnchorPoint(),i=this.handle.node.getCon
tentSize(),n=this.handle.node.parent,s=this.node.convertToWorldSpaceAR(cc.v2(-
t.width*e.x,-t.height*e.y)),a=n.convertToNodeSpaceAR(s);return
this.direction===r.HORIZONTAL?a=cc.v2(a.x,a.y+(t.height-
i.height)/2):this.direction===r.VERTICAL&&(a=cc.v2(a.x+(t.width-
i.width)/2,a.y)),this.handle.node.setPosition(a),a},_onTouchBegan:function()
{this.enableAutoHide&&(this._touching=!
0)},_conditionalDisableScrollBar:function(t,e){return
t.width<=e.width&&this.direction===r.HORIZONTAL||
t.height<=e.height&&this.direction===r.VERTICAL},_onTouchEnded:function()
{if(this.enableAutoHide&&(this._touching=!1,!(this.autoHideTime<=0)))
{if(this._scrollView){var t=this._scrollView.content;if(t){var
e=t.getContentSize(),i=this._scrollView.node.getContentSize();if(this._conditionalD
isableScrollBar(e,i))return}}this._autoHideRemainingTime=this.autoHideTime}},_calcu
lateLength:function(t,e,i,n){var r=t;return n&&(r+=20*(n>0?n:-
n)),i*(e/r)},_calculatePosition:function(t,e,i,s,a,o){var l=t-
e;a&&(l+=Math.abs(a));var h=0;l&&(h=s/l,h=n.clamp01(h));var c=(i-o)*h;return
this.direction===r.VERTICAL?cc.v2(0,c):cc.v2(c,0)},_updateLength:function(t)
{if(this.handle){var
e=this.handle.node,i=e.getContentSize();e.setAnchorPoint(cc.v2(0,0)),this.direction
===r.HORIZONTAL?
e.setContentSize(t,i.height):e.setContentSize(i.width,t)}},_processAutoHide:functio
n(t){if(this.enableAutoHide&&!(this._autoHideRemainingTime<=0)&&!
this._touching&&(this._autoHideRemainingTime-
=t,this._autoHideRemainingTime<=this.autoHideTime))
{this._autoHideRemainingTime=Math.max(0,this._autoHideRemainingTime);var
e=this._opacity*(this._autoHideRemainingTime/this.autoHideTime);this._setOpacity(e)
}},start:function(){this.enableAutoHide&&this._setOpacity(0)},hide:function()
{this._autoHideRemainingTime=0,this._setOpacity(0)},show:function()
{this._autoHideRemainingTime=this.autoHideTime,this._setOpacity(this._opacity)},upd
ate:function(t){this._processAutoHide(t)}});cc.Scrollbar=e.exports=s}),
{"../utils/misc":295,"./CCComponent":95}],109:[(function(t,e,i){"use strict";var
n=t("../CCNode").EventType,r=function(t){return(t-=1)*t*t*t*t+1},s=function()
{return(new
Date).getMilliseconds()},a=cc.Enum({SCROLL_TO_TOP:0,SCROLL_TO_BOTTOM:1,SCROLL_TO_LE
FT:2,SCROLL_TO_RIGHT:3,SCROLLING:4,BOUNCE_TOP:5,BOUNCE_BOTTOM:6,BOUNCE_LEFT:7,BOUNC
E_RIGHT:8,SCROLL_ENDED:9,TOUCH_UP:10,AUTOSCROLL_ENDED_WITH_THRESHOLD:11,SCROLL_BEGA
N:12}),o={"scroll-to-top":a.SCROLL_TO_TOP,"scroll-to-
bottom":a.SCROLL_TO_BOTTOM,"scroll-to-left":a.SCROLL_TO_LEFT,"scroll-to-
right":a.SCROLL_TO_RIGHT,scrolling:a.SCROLLING,"bounce-
bottom":a.BOUNCE_BOTTOM,"bounce-left":a.BOUNCE_LEFT,"bounce-
right":a.BOUNCE_RIGHT,"bounce-top":a.BOUNCE_TOP,"scroll-
ended":a.SCROLL_ENDED,"touch-up":a.TOUCH_UP,"scroll-ended-with-
threshold":a.AUTOSCROLL_ENDED_WITH_THRESHOLD,"scroll-
began":a.SCROLL_BEGAN},l=cc.Class({name:"cc.ScrollView",extends:t("./CCViewGroup"),
editor:!1,ctor:function()
{this._topBoundary=0,this._bottomBoundary=0,this._leftBoundary=0,this._rightBoundar
y=0,this._touchMoveDisplacements=[],this._touchMoveTimeDeltas=[],this._touchMovePre
viousTimestamp=0,this._touchMoved=!1,this._autoScrolling=!
1,this._autoScrollAttenuate=!
1,this._autoScrollStartPosition=cc.v2(0,0),this._autoScrollTargetDelta=cc.v2(0,0),t
his._autoScrollTotalTime=0,this._autoScrollAccumulatedTime=0,this._autoScrollCurren
tlyOutOfBoundary=!1,this._autoScrollBraking=!
1,this._autoScrollBrakingStartPosition=cc.v2(0,0),this._outOfBoundaryAmount=cc.v2(0
,0),this._outOfBoundaryAmountDirty=!0,this._stopMouseWheel=!
1,this._mouseWheelEventElapsedTime=0,this._isScrollEndedWithThresholdEventFired=!
1,this._scrollEventEmitMask=0,this._isBouncing=!1,this._scrolling=!1},properties:
{content:{default:void 0,type:cc.Node,tooltip:!
1,formerlySerializedAs:"content",notify:function(t)
{this._calculateBoundary()}},horizontal:{default:!0,animatable:!1,tooltip:!
1},vertical:{default:!0,animatable:!1,tooltip:!1},inertia:{default:!0,tooltip:!
1},brake:{default:.5,type:"Float",range:[0,1,.1],tooltip:!1},elastic:{default:!
0,animatable:!1,tooltip:!1},bounceDuration:{default:1,range:[0,10],tooltip:!
1},horizontalScrollBar:{default:void 0,type:cc.Scrollbar,tooltip:!
1,notify:function()
{this.horizontalScrollBar&&(this.horizontalScrollBar.setTargetScrollView(this),this
._updateScrollBar(0))},animatable:!1},verticalScrollBar:{default:void
0,type:cc.Scrollbar,tooltip:!1,notify:function()
{this.verticalScrollBar&&(this.verticalScrollBar.setTargetScrollView(this),this._up
dateScrollBar(0))},animatable:!1},scrollEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1},cancelInnerEvents:{default:!
0,animatable:!1,tooltip:!1},_view:{get:function(){if(this.content)return
this.content.parent}}},statics:{EventType:a},scrollToBottom:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!
1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!==e):this._moveContent(i,!
0)},scrollToTop:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,1),applyToHorizontal:!
1,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToLeft:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!
0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToRight:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(1,0),applyToHorizontal:!
0,applyToVertical:!1});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToTopLeft:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,1),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToTopRight:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(1,1),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToBottomLeft:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(0,0),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToBottomRight:function(t,e){var
i=this._calculateMovePercentDelta({anchor:cc.v2(1,0),applyToHorizontal:!
0,applyToVertical:!0});t?this._startAutoScroll(i,t,!1!
==e):this._moveContent(i)},scrollToOffset:function(t,e,i){var
n=this.getMaxScrollOffset(),r=cc.v2(0,0);0===n.x?r.x=0:r.x=t.x/n.x,0===n.y?
r.y=1:r.y=(n.y-t.y)/n.y,this.scrollTo(r,e,i)},getScrollOffset:function(){var
t=this._getContentTopBoundary()-this._topBoundary,e=this._getContentLeftBoundary()-
this._leftBoundary;return cc.v2(e,t)},getMaxScrollOffset:function(){var
t=this._view.getContentSize(),e=this.content.getContentSize(),i=e.width-
t.width,n=e.height-t.height;return i=i>=0?i:0,n=n>=0?
n:0,cc.v2(i,n)},scrollToPercentHorizontal:function(t,e,i){var
n=this._calculateMovePercentDelta({anchor:cc.v2(t,0),applyToHorizontal:!
0,applyToVertical:!1});e?this._startAutoScroll(n,e,!1!
==i):this._moveContent(n)},scrollTo:function(t,e,i){var
n=this._calculateMovePercentDelta({anchor:cc.v2(t),applyToHorizontal:!
0,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!
==i):this._moveContent(n)},scrollToPercentVertical:function(t,e,i){var
n=this._calculateMovePercentDelta({anchor:cc.v2(0,t),applyToHorizontal:!
1,applyToVertical:!0});e?this._startAutoScroll(n,e,!1!
==i):this._moveContent(n)},stopAutoScroll:function(){this._autoScrolling=!
1,this._autoScrollAccumulatedTime=this._autoScrollTotalTime},setContentPosition:fun
ction(t){t.fuzzyEquals(this.getContentPosition(),1e-4)||
(this.content.setPosition(t),this._outOfBoundaryAmountDirty=!
0)},getContentPosition:function(){return
this.content.getPosition()},isScrolling:function(){return
this._scrolling},isAutoScrolling:function(){return
this._autoScrolling},_registerEvent:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!
0),this.node.on(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!
0),this.node.on(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!
0),this.node.on(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!
0),this.node.on(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!
0)},_unregisterEvent:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this,!
0),this.node.off(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this,!
0),this.node.off(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this,!
0),this.node.off(cc.Node.EventType.TOUCH_CANCEL,this._onTouchCancelled,this,!
0),this.node.off(cc.Node.EventType.MOUSE_WHEEL,this._onMouseWheel,this,!
0)},_onMouseWheel:function(t,e){if(this.enabledInHierarchy&&!
this._hasNestedViewGroup(t,e)){var i=cc.v2(0,0),n=-.1;0,this.vertical?
i=cc.v2(0,t.getScrollY()*n):this.horizontal&&(i=cc.v2(t.getScrollY()*n,0)),this._mo
useWheelEventElapsedTime=0,this._processDeltaMove(i),this._stopMouseWheel||
(this._handlePressLogic(),this.schedule(this._checkMouseWheel,1/60),this._stopMouse
Wheel=!0),this._stopPropagationIfTargetIsMe(t)}},_checkMouseWheel:function(t){if(!
this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-4))return
this._processInertiaScroll(),this.unschedule(this._checkMouseWheel),void(this._stop
MouseWheel=!
1);this._mouseWheelEventElapsedTime+=t,this._mouseWheelEventElapsedTime>.1&&(this._
onScrollBarTouchEnded(),this.unschedule(this._checkMouseWheel),this._stopMouseWheel
=!1)},_calculateMovePercentDelta:function(t){var
e=t.anchor,i=t.applyToHorizontal,n=t.applyToVertical;this._calculateBoundary(),e=e.
clampf(cc.v2(0,0),cc.v2(1,1));var
r=this._view.getContentSize(),s=this.content.getContentSize(),a=this._getContentBot
tomBoundary()-this._bottomBoundary;a=-a;var o=this._getContentLeftBoundary()-
this._leftBoundary;o=-o;var l=cc.v2(0,0),h=0;return i&&(h=s.width-r.width,l.x=o-
h*e.x),n&&(h=s.height-r.height,l.y=a-h*e.y),l},_moveContentToTopLeft:function(t)
{var e=this.content.getContentSize(),i=this._getContentBottomBoundary()-
this._bottomBoundary;i=-i;var n=cc.v2(0,0),r=0,s=this._getContentLeftBoundary()-
this._leftBoundary;s=-s,e.height<t.height?(r=e.height-t.height,n.y=i-
r,this.verticalScrollBar&&this.verticalScrollBar.hide()):this.verticalScrollBar&&th
is.verticalScrollBar.show(),e.width<t.width?(r=e.width-
t.width,n.x=s,this.horizontalScrollBar&&this.horizontalScrollBar.hide()):this.horiz
ontalScrollBar&&this.horizontalScrollBar.show(),this._moveContent(n),this._adjustCo
ntentOutOfBoundary()},_calculateBoundary:function(){if(this.content){var
t=this.content.getComponent(cc.Layout);t&&t.enabledInHierarchy&&t.updateLayout();va
r
e=this._view.getContentSize(),i=e.width*this._view.anchorX,n=e.height*this._view.an
chorY;this._leftBoundary=-i,this._bottomBoundary=-
n,this._rightBoundary=this._leftBoundary+e.width,this._topBoundary=this._bottomBoun
dary+e.height,this._moveContentToTopLeft(e)}},_hasNestedViewGroup:function(t,e)
{if(t.eventPhase===cc.Event.CAPTURING_PHASE){if(e)for(var i=0;i<e.length;++i){var
n=e[i];if(this.node===n)return!!
t.target.getComponent(cc.ViewGroup);if(n.getComponent(cc.ViewGroup))return!
0}return!1}},_stopPropagationIfTargetIsMe:function(t)
{t.eventPhase===cc.Event.AT_TARGET&&t.target===this.node&&t.stopPropagation()},_onT
ouchBegan:function(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e))
{var i=t.touch;this.content&&this._handlePressLogic(i),this._touchMoved=!
1,this._stopPropagationIfTargetIsMe(t)}},_onTouchMoved:function(t,e)
{if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){var
i=t.touch;if(this.content&&this._handleMoveLogic(i),this.cancelInnerEvents)
{if(i.getLocation().sub(i.getStartLocation()).mag()>7&&!this._touchMoved&&t.target!
==this.node){var n=new
cc.Event.EventTouch(t.getTouches(),t.bubbles);n.type=cc.Node.EventType.TOUCH_CANCEL
,n.touch=t.touch,n.simulate=!0,t.target.dispatchEvent(n),this._touchMoved=!
0}this._stopPropagationIfTargetIsMe(t)}}},_onTouchEnded:function(t,e)
{if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e))
{this._dispatchEvent("touch-up");var
i=t.touch;this.content&&this._handleReleaseLogic(i),this._touchMoved?
t.stopPropagation():this._stopPropagationIfTargetIsMe(t)}},_onTouchCancelled:functi
on(t,e){if(this.enabledInHierarchy&&!this._hasNestedViewGroup(t,e)){if(!t.simulate)
{var
i=t.touch;this.content&&this._handleReleaseLogic(i)}this._stopPropagationIfTargetIs
Me(t)}},_processDeltaMove:function(t)
{this._scrollChildren(t),this._gatherTouchMove(t)},_handleMoveLogic:function(t){var
e=t.getDelta();this._processDeltaMove(e)},_scrollChildren:function(t){var
e=t=this._clampDelta(t),i=void
0;this.elastic&&(i=this._getHowMuchOutOfBoundary(),e.x*=0===i.x?1:.5,e.y*=0===i.y?
1:.5),this.elastic||(i=this._getHowMuchOutOfBoundary(e),e=e.add(i));var n=-
1;if(e.y>0)this.content.y-
this.content.anchorY*this.content.height+e.y>this._bottomBoundary&&(n="scroll-to-
bottom");else if(e.y<0){this.content.y-
this.content.anchorY*this.content.height+this.content.height+e.y<=this._topBoundary
&&(n="scroll-to-top")}if(e.x<0)this.content.x-
this.content.anchorX*this.content.width+this.content.width+e.x<=this._rightBoundary
&&(n="scroll-to-right");else if(e.x>0){this.content.x-
this.content.anchorX*this.content.width+e.x>=this._leftBoundary&&(n="scroll-to-
left")}this._moveContent(e,!1),0===e.x&&0===e.y||(this._scrolling||
(this._scrolling=!0,this._dispatchEvent("scroll-
began")),this._dispatchEvent("scrolling")),-1!
==n&&this._dispatchEvent(n)},_handlePressLogic:function()
{this._autoScrolling&&this._dispatchEvent("scroll-ended"),this._autoScrolling=!
1,this._isBouncing=!
1,this._touchMovePreviousTimestamp=s(),this._touchMoveDisplacements.length=0,this._
touchMoveTimeDeltas.length=0,this._onScrollBarTouchBegan()},_clampDelta:function(t)
{var e=this.content.getContentSize(),i=this._view.getContentSize();return
e.width<i.width&&(t.x=0),e.height<i.height&&(t.y=0),t},_gatherTouchMove:function(t)
{for(t=this._clampDelta(t);this._touchMoveDisplacements.length>=5;)this._touchMoveD
isplacements.shift(),this._touchMoveTimeDeltas.shift();this._touchMoveDisplacements
.push(t);var e=s();this._touchMoveTimeDeltas.push((e-
this._touchMovePreviousTimestamp)/1e3),this._touchMovePreviousTimestamp=e},_startBo
unceBackIfNeeded:function(){if(!this.elastic)return!1;var
t=this._getHowMuchOutOfBoundary();if((t=this._clampDelta(t)).fuzzyEquals(cc.v2(0,0)
,1e-4))return!1;var e=Math.max(this.bounceDuration,0);return
this._startAutoScroll(t,e,!0),this._isBouncing||
(t.y>0&&this._dispatchEvent("bounce-top"),t.y<0&&this._dispatchEvent("bounce-
bottom"),t.x>0&&this._dispatchEvent("bounce-
right"),t.x<0&&this._dispatchEvent("bounce-left"),this._isBouncing=!0),!
0},_processInertiaScroll:function(){if(!
this._startBounceBackIfNeeded()&&this.inertia){var
t=this._calculateTouchMoveVelocity();!t.fuzzyEquals(cc.v2(0,0),1e-
4)&&this.brake<1&&this._startInertiaScroll(t)}this._onScrollBarTouchEnded()},_handl
eReleaseLogic:function(t){var
e=t.getDelta();this._gatherTouchMove(e),this._processInertiaScroll(),this._scrollin
g&&(this._scrolling=!1,this._autoScrolling||this._dispatchEvent("scroll-
ended"))},_isOutOfBoundary:function(){return!
this._getHowMuchOutOfBoundary().fuzzyEquals(cc.v2(0,0),1e-
4)},_isNecessaryAutoScrollBrake:function(){if(this._autoScrollBraking)return!
0;if(this._isOutOfBoundary()){if(!this._autoScrollCurrentlyOutOfBoundary)return
this._autoScrollCurrentlyOutOfBoundary=!0,this._autoScrollBraking=!
0,this._autoScrollBrakingStartPosition=this.getContentPosition(),!0}else
this._autoScrollCurrentlyOutOfBoundary=!1;return!
1},getScrollEndedEventTiming:function(){return 1e-
4},_processAutoScrolling:function(t){var
e=this._isNecessaryAutoScrollBrake(),i=e?.05:1;this._autoScrollAccumulatedTime+=t*(
1/i);var
n=Math.min(1,this._autoScrollAccumulatedTime/this._autoScrollTotalTime);this._autoS
crollAttenuate&&(n=r(n));var
s=this._autoScrollStartPosition.add(this._autoScrollTargetDelta.mul(n)),a=Math.abs(
n-1)<=1e-4;if(Math.abs(n-1)<=this.getScrollEndedEventTiming()&&!
this._isScrollEndedWithThresholdEventFired&&(this._dispatchEvent("scroll-ended-
with-threshold"),this._isScrollEndedWithThresholdEventFired=!0),this.elastic){var
o=s.sub(this._autoScrollBrakingStartPosition);e&&(o=o.mul(i)),s=this._autoScrollBra
kingStartPosition.add(o)}else{var
l=s.sub(this.getContentPosition()),h=this._getHowMuchOutOfBoundary(l);h.fuzzyEquals
(cc.v2(0,0),1e-4)||(s=s.add(h),a=!0)}a&&(this._autoScrolling=!1);var
c=s.sub(this.getContentPosition());this._moveContent(this._clampDelta(c),a),this._d
ispatchEvent("scrolling"),this._autoScrolling||(this._isBouncing=!
1,this._scrolling=!1,this._dispatchEvent("scroll-
ended"))},_startInertiaScroll:function(t){var
e=t.mul(.7);this._startAttenuatingAutoScroll(e,t)},_calculateAttenuatedFactor:funct
ion(t){return this.brake<=0?1-this.brake:(1-this.brake)*(1/(1+14e-6*t+t*t*8e-
9))},_startAttenuatingAutoScroll:function(t,e){var
i=this._calculateAutoScrollTimeByInitalSpeed(e.mag()),n=t.normalize(),r=this.conten
t.getContentSize(),s=this._view.getContentSize(),a=r.width-s.width,o=r.height-
s.height,l=this._calculateAttenuatedFactor(a),h=this._calculateAttenuatedFactor(o);
n=cc.v2(n.x*a*(1-this.brake)*l,n.y*o*h*(1-this.brake));var
c=t.mag(),u=n.mag()/c;n=n.add(t),this.brake>0&&u>7&&(u=Math.sqrt(u),n=t.mul(u).add(
t)),this.brake>0&&u>3&&(i*=u=3),0===this.brake&&u>1&&(i*=u),this._startAutoScroll(n
,i,!0)},_calculateAutoScrollTimeByInitalSpeed:function(t){return
Math.sqrt(Math.sqrt(t/5))},_startAutoScroll:function(t,e,i){var
n=this._flattenVectorByDirection(t);this._autoScrolling=!
0,this._autoScrollTargetDelta=n,this._autoScrollAttenuate=i,this._autoScrollStartPo
sition=this.getContentPosition(),this._autoScrollTotalTime=e,this._autoScrollAccumu
latedTime=0,this._autoScrollBraking=!1,this._isScrollEndedWithThresholdEventFired=!
1,this._autoScrollBrakingStartPosition=cc.v2(0,0),this._getHowMuchOutOfBoundary().f
uzzyEquals(cc.v2(0,0),1e-4)||(this._autoScrollCurrentlyOutOfBoundary=!
0)},_calculateTouchMoveVelocity:function(){var
t=0;if((t=this._touchMoveTimeDeltas.reduce((function(t,e){return t+e}),t))<=0||
t>=.5)return cc.v2(0,0);var e=cc.v2(0,0);return
e=this._touchMoveDisplacements.reduce((function(t,e){return
t.add(e)}),e),cc.v2(e.x*(1-this.brake)/t,e.y*(1-
this.brake)/t)},_flattenVectorByDirection:function(t){var e=t;return
e.x=this.horizontal?e.x:0,e.y=this.vertical?e.y:0,e},_moveContent:function(t,e){var
i=this._flattenVectorByDirection(t),n=this.getContentPosition().add(i);this.setCont
entPosition(n);var
r=this._getHowMuchOutOfBoundary();this._updateScrollBar(r),this.elastic&&e&&this._s
tartBounceBackIfNeeded()},_getContentLeftBoundary:function(){return
this.getContentPosition().x-
this.content.getAnchorPoint().x*this.content.getContentSize().width},_getContentRig
htBoundary:function(){var t=this.content.getContentSize();return
this._getContentLeftBoundary()+t.width},_getContentTopBoundary:function(){var
t=this.content.getContentSize();return this._getContentBottomBoundary()
+t.height},_getContentBottomBoundary:function(){return this.getContentPosition().y-
this.content.getAnchorPoint().y*this.content.getContentSize().height},_getHowMuchOu
tOfBoundary:function(t){if((t=t||cc.v2(0,0)).fuzzyEquals(cc.v2(0,0),1e-4)&&!
this._outOfBoundaryAmountDirty)return this._outOfBoundaryAmount;var
e=cc.v2(0,0);return this._getContentLeftBoundary()+t.x>this._leftBoundary?
e.x=this._leftBoundary-(this._getContentLeftBoundary()
+t.x):this._getContentRightBoundary()
+t.x<this._rightBoundary&&(e.x=this._rightBoundary-(this._getContentRightBoundary()
+t.x)),this._getContentTopBoundary()+t.y<this._topBoundary?e.y=this._topBoundary-
(this._getContentTopBoundary()+t.y):this._getContentBottomBoundary()
+t.y>this._bottomBoundary&&(e.y=this._bottomBoundary-
(this._getContentBottomBoundary()+t.y)),t.fuzzyEquals(cc.v2(0,0),1e-
4)&&(this._outOfBoundaryAmount=e,this._outOfBoundaryAmountDirty=!
1),e=this._clampDelta(e)},_updateScrollBar:function(t)
{this.horizontalScrollBar&&this.horizontalScrollBar._onScroll(t),this.verticalScrol
lBar&&this.verticalScrollBar._onScroll(t)},_onScrollBarTouchBegan:function()
{this.horizontalScrollBar&&this.horizontalScrollBar._onTouchBegan(),this.verticalSc
rollBar&&this.verticalScrollBar._onTouchBegan()},_onScrollBarTouchEnded:function()
{this.horizontalScrollBar&&this.horizontalScrollBar._onTouchEnded(),this.verticalSc
rollBar&&this.verticalScrollBar._onTouchEnded()},_dispatchEvent:function(t)
{if("scroll-ended"===t)this._scrollEventEmitMask=0;else if("scroll-to-
top"===t||"scroll-to-bottom"===t||"scroll-to-left"===t||"scroll-to-right"===t){var
e=1<<o[t];if(this._scrollEventEmitMask&e)return;this._scrollEventEmitMask|
=e}cc.Component.EventHandler.emitEvents(this.scrollEvents,this,o[t]),this.node.emit
(t,this)},_adjustContentOutOfBoundary:function()
{if(this._outOfBoundaryAmountDirty=!0,this._isOutOfBoundary()){var
t=this._getHowMuchOutOfBoundary(cc.v2(0,0)),e=this.getContentPosition().add(t);this
.content&&(this.content.setPosition(e),this._updateScrollBar(0))}},start:function()
{this._calculateBoundary(),this.content&&cc.director.once(cc.Director.EVENT_BEFORE_
DRAW,this._adjustContentOutOfBoundary,this)},_hideScrollbar:function()
{this.horizontalScrollBar&&this.horizontalScrollBar.hide(),this.verticalScrollBar&&
this.verticalScrollBar.hide()},_showScrollbar:function()
{this.horizontalScrollBar&&this.horizontalScrollBar.show(),this.verticalScrollBar&&
this.verticalScrollBar.show()},onDisable:function()
{this._unregisterEvent(),this.content&&(this.content.off(n.SIZE_CHANGED,this._calcu
lateBoundary,this),this.content.off(n.SCALE_CHANGED,this._calculateBoundary,this),t
his._view&&(this._view.off(n.POSITION_CHANGED,this._calculateBoundary,this),this._v
iew.off(n.SCALE_CHANGED,this._calculateBoundary,this),this._view.off(n.SIZE_CHANGED
,this._calculateBoundary,this))),this._hideScrollbar(),this.stopAutoScroll()},onEna
ble:function()
{this._registerEvent(),this.content&&(this.content.on(n.SIZE_CHANGED,this._calculat
eBoundary,this),this.content.on(n.SCALE_CHANGED,this._calculateBoundary,this),this.
_view&&(this._view.on(n.POSITION_CHANGED,this._calculateBoundary,this),this._view.o
n(n.SCALE_CHANGED,this._calculateBoundary,this),this._view.on(n.SIZE_CHANGED,this._
calculateBoundary,this))),this._showScrollbar()},update:function(t)
{this._autoScrolling&&this._processAutoScrolling(t)}});cc.ScrollView=e.exports=l}),
{"../CCNode":52,"./CCViewGroup":116}],110:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("./CCComponent"),s=cc.Enum({Horizontal:0,Vertical:1}),a=cc
.Class({name:"cc.Slider",extends:r,editor:!1,ctor:function()
{this._offset=cc.v2(),this._touchHandle=!1,this._dragging=!1},properties:{handle:
{default:null,type:cc.Button,tooltip:!1,notify:function(){0}},direction:
{default:s.Horizontal,type:s,tooltip:!1},progress:{default:.5,type:cc.Float,range:
[0,1,.1],slide:!0,tooltip:!1,notify:function()
{this._updateHandlePosition()}},slideEvents:{default:
[],type:cc.Component.EventHandler,tooltip:!1}},statics:
{Direction:s},__preload:function()
{this._updateHandlePosition()},onEnable:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(c
c.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.node.on(cc.Node.EventType
.TOUCH_END,this._onTouchEnded,this),this.node.on(cc.Node.EventType.TOUCH_CANCEL,thi
s._onTouchCancelled,this),this.handle&&this.handle.isValid&&(this.handle.node.on(cc
.Node.EventType.TOUCH_START,this._onHandleDragStart,this),this.handle.node.on(cc.No
de.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.handle.node.on(cc.Node.EventT
ype.TOUCH_END,this._onTouchEnded,this))},onDisable:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off
(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.node.off(cc.Node.EventT
ype.TOUCH_END,this._onTouchEnded,this),this.node.off(cc.Node.EventType.TOUCH_CANCEL
,this._onTouchCancelled,this),this.handle&&this.handle.isValid&&(this.handle.node.o
ff(cc.Node.EventType.TOUCH_START,this._onHandleDragStart,this),this.handle.node.off
(cc.Node.EventType.TOUCH_MOVE,this._onTouchMoved,this),this.handle.node.off(cc.Node
.EventType.TOUCH_END,this._onTouchEnded,this))},_onHandleDragStart:function(t)
{this._dragging=!0,this._touchHandle=!
0,this._offset=this.handle.node.convertToNodeSpaceAR(t.touch.getLocation()),t.stopP
ropagation()},_onTouchBegan:function(t){this.handle&&(this._dragging=!
0,this._touchHandle||
this._handleSliderLogic(t.touch),t.stopPropagation())},_onTouchMoved:function(t)
{this._dragging&&(this._handleSliderLogic(t.touch),t.stopPropagation())},_onTouchEn
ded:function(t){this._dragging=!1,this._touchHandle=!
1,this._offset=cc.v2(),t.stopPropagation()},_onTouchCancelled:function(t)
{this._dragging=!1,t.stopPropagation()},_handleSliderLogic:function(t)
{this._updateProgress(t),this._emitSlideEvent()},_emitSlideEvent:function()
{cc.Component.EventHandler.emitEvents(this.slideEvents,this),this.node.emit("slide"
,this)},_updateProgress:function(t){if(this.handle){var
e=this.node.convertToNodeSpace(t.getLocation());this.direction===s.Horizontal?
this.progress=n.clamp01((e.x-
this._offset.x)/this.node.width):this.progress=n.clamp01((e.y-
this._offset.y)/this.node.height)}},_updateHandlePosition:function()
{if(this.handle){var t;t=this.direction===s.Horizontal?cc.v2(-
this.node.width*this.node.anchorX+this.progress*this.node.width,0):cc.v2(0,-
this.node.height*this.node.anchorY+this.progress*this.node.height);
var
e=this.node.convertToWorldSpaceAR(t);this.handle.node.position=this.handle.node.par
ent.convertToNodeSpaceAR(e)}}});cc.Slider=e.exports=a}),
{"../utils/misc":295,"./CCComponent":95}],111:[(function(t,e,i){"use strict";var
n=t("../utils/misc"),r=t("../CCNode").EventType,s=t("./CCRenderComponent"),a=t("../
renderer/render-flow"),o=t("../utils/blend-
func"),l=t("../assets/material/CCMaterial"),h=cc.Enum({SIMPLE:0,SLICED:1,TILED:2,FI
LLED:3,MESH:4}),c=cc.Enum({HORIZONTAL:0,VERTICAL:1,RADIAL:2}),u=cc.Enum({CUSTOM:0,T
RIMMED:1,RAW:2}),_=cc.Enum({NORMAL:0,GRAY:1}),f=cc.Class({name:"cc.Sprite",extends:
s,mixins:[o],editor:!1,properties:{_spriteFrame:
{default:null,type:cc.SpriteFrame},_type:h.SIMPLE,_sizeMode:u.TRIMMED,_fillType:0,_
fillCenter:cc.v2(0,0),_fillStart:0,_fillRange:0,_isTrimmedMode:!0,_atlas:
{default:null,type:cc.SpriteAtlas,tooltip:!1,editorOnly:!0,visible:!0,animatable:!
1},spriteFrame:{get:function(){return this._spriteFrame},set:function(t,e){var
i=this._spriteFrame;i!==t&&(this._spriteFrame=t,this.markForUpdateRenderData(!
1),this._applySpriteFrame(i))},type:cc.SpriteFrame},type:{get:function(){return
this._type},set:function(t){this._type!
==t&&(this.destroyRenderData(this._renderData),this._renderData=null,this._type=t,t
his._updateAssembler())},type:h,animatable:!1,tooltip:!1},fillType:{get:function()
{return this._fillType},set:function(t){t!==this._fillType&&(t===c.RADIAL||
this._fillType===c.RADIAL?
(this.destroyRenderData(this._renderData),this._renderData=null):this._renderData&&
this.markForUpdateRenderData(!
0),this._fillType=t,this._updateAssembler())},type:c,tooltip:!1},fillCenter:
{get:function(){return this._fillCenter},set:function(t)
{this._fillCenter.x=t.x,this._fillCenter.y=t.y,this._type===h.FILLED&&this._renderD
ata&&this.markForUpdateRenderData(!0)},tooltip:!1},fillStart:{get:function(){return
this._fillStart},set:function(t){this._fillStart=n.clampf(t,-
1,1),this._type===h.FILLED&&this._renderData&&this.markForUpdateRenderData(!
0)},tooltip:!1},fillRange:{get:function(){return this._fillRange},set:function(t)
{this._fillRange=n.clampf(t,-
1,1),this._type===h.FILLED&&this._renderData&&this.markForUpdateRenderData(!
0)},tooltip:!1},trim:{get:function(){return this._isTrimmedMode},set:function(t)
{this._isTrimmedMode!==t&&(this._isTrimmedMode=t,this._type!==h.SIMPLE&&this._type!
==h.MESH||!this._renderData||this.markForUpdateRenderData(!0))},animatable:!
1,tooltip:!1},sizeMode:{get:function(){return this._sizeMode},set:function(t)
{this._sizeMode=t,t!==u.CUSTOM&&this._applySpriteSize()},animatable:!
1,type:u,tooltip:!1}},statics:
{FillType:c,Type:h,SizeMode:u,State:_},setVisible:function(t)
{this.enabled=t},setState:function(){},getState:function(){},onEnable:function()
{this._super(),this._spriteFrame&&this._spriteFrame.textureLoaded()||
(this.disableRender(),this._spriteFrame&&(this._spriteFrame.once("load",this._onTex
tureLoaded,this),this._spriteFrame.ensureLoadTexture())),this._updateAssembler(),th
is._activateMaterial(),this.node.on(r.SIZE_CHANGED,this._onNodeSizeDirty,this),this
.node.on(r.ANCHOR_CHANGED,this._onNodeSizeDirty,this)},onDisable:function()
{this._super(),this.node.off(r.SIZE_CHANGED,this._onNodeSizeDirty,this),this.node.o
ff(r.ANCHOR_CHANGED,this._onNodeSizeDirty,this)},_onNodeSizeDirty:function()
{this._renderData&&this.markForUpdateRenderData(!0)},_on3DNodeChanged:function()
{this._updateAssembler()},_updateAssembler:function(){var
t=f._assembler.getAssembler(this);this._assembler!
==t&&(this._assembler=t,this._renderData=null),this._renderData||
(this._renderData=this._assembler.createData(this),this.markForUpdateRenderData(!
0))},_activateMaterial:function()
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS)return
this.markForUpdateRenderData(!0),void this.markForRender(!0);var
t=this._spriteFrame;if(t&&t.textureLoaded()){var e=this.sharedMaterials[0];e?
e=l.getInstantiatedMaterial(e,this):
(e=l.getInstantiatedBuiltinMaterial("sprite",this)).define("USE_TEXTURE",!0);var
i=t.getTexture();e.setProperty("texture",i),this.setMaterial(0,e),this.markForRende
r(!0)}else this.disableRender()},_applyAtlas:!1,_canRender:function()
{if(cc.game.renderType===cc.game.RENDER_TYPE_CANVAS){if(!this._enabled)return!
1}else if(!this._enabled||!this.sharedMaterials[0]||!
this.node._activeInHierarchy)return!1;var t=this._spriteFrame;return!(!t||!
t.textureLoaded())},markForUpdateRenderData:function(t){if(t&&this._canRender())
{this.node._renderFlag|=a.FLAG_UPDATE_RENDER_DATA;var
e=this._renderData;e&&(e.uvDirty=!0,e.vertDirty=!0)}else t||
(this.node._renderFlag&=~a.FLAG_UPDATE_RENDER_DATA)},_applySpriteSize:function()
{if(this._spriteFrame){if(u.RAW===this._sizeMode){var
t=this._spriteFrame.getOriginalSize();this.node.setContentSize(t)}else
if(u.TRIMMED===this._sizeMode){var
e=this._spriteFrame.getRect();this.node.setContentSize(e.width,e.height)}this._acti
vateMaterial()}},_onTextureLoaded:function()
{this.isValid&&this._applySpriteSize()},_applySpriteFrame:function(t)
{t&&t.off&&t.off("load",this._onTextureLoaded,this);var
e=this._spriteFrame,i=this.sharedMaterials[0];e&&(i&&i._texture)===(e&&e._texture)|
|this.markForRender(!1),e&&(t&&e._texture===t._texture?
this._applySpriteSize():e.textureLoaded()?this._onTextureLoaded(null):
(e.once("load",this._onTextureLoaded,this),e.ensureLoadTexture()))},_resized:!
1});cc.Sprite=e.exports=f}),
{"../CCNode":52,"../assets/material/CCMaterial":75,"../renderer/render-
flow":244,"../utils/blend-
func":288,"../utils/misc":295,"./CCRenderComponent":106}],112:[(function(t,e,i)
{"use strict";var
n=cc.Enum({NONE:0,CHECKBOX:1,TEXT_ATLAS:2,SLIDER_BAR:3,LIST_VIEW:4,PAGE_VIEW:5}),r=
cc.Enum({VERTICAL:0,HORIZONTAL:1}),s=cc.Enum({TOP:0,CENTER:1,BOTTOM:2}),a=cc.Enum({
LEFT:0,CENTER:1,RIGHT:2}),o=cc.Class({name:"cc.StudioComponent",extends:cc.Componen
t,editor:!1,properties:!1,statics:
{ComponentType:n,ListDirection:r,VerticalAlign:s,HorizontalAlign:a}}),l=t("../utils
/prefab-
helper");o.PlaceHolder=cc.Class({name:"cc.StudioComponent.PlaceHolder",extends:cc.C
omponent,properties:{_baseUrl:"",nestedPrefab:cc.Prefab},onLoad:function()
{this.nestedPrefab&&this._replaceWithNestedPrefab()},_replaceWithNestedPrefab:funct
ion(){var
t=this.node,e=t._prefab;e.root=t,e.asset=this.nestedPrefab,l.syncWithPrefab(t)}}),c
c.StudioComponent=e.exports=o;var
h=cc.Class({name:"cc.StudioWidget",extends:cc.Widget,editor:!
1,_validateTargetInDEV:function(){}});cc.StudioWidget=e.exports=h}),
{"../utils/prefab-helper":297}],113:[(function(t,e,i){"use strict";var
n=t("../utils/gray-sprite-
state"),r=cc.Class({name:"cc.Toggle",extends:t("./CCButton"),mixins:[n],editor:!
1,properties:{_N$isChecked:!0,isChecked:{get:function(){return
this._N$isChecked},set:function(t){if(t!==this._N$isChecked){var
e=this.toggleGroup||this._toggleContainer;e&&e.enabled&&this._N$isChecked&&!
e.allowSwitchOff||
(this._N$isChecked=t,this._updateCheckMark(),e&&e.enabled&&e.updateToggles(this),th
is._emitToggleEvents())}},tooltip:!1},toggleGroup:{default:null,tooltip:!
1,type:t("./CCToggleGroup")},checkMark:{default:null,type:cc.Sprite,tooltip:!
1},checkEvents:{default:[],type:cc.Component.EventHandler},_resizeToTarget:
{animatable:!1,set:function(t)
{t&&this._resizeNodeToTargetNode()}}},onEnable:function()
{this._super(),this._registerToggleEvent(),this.toggleGroup&&this.toggleGroup.enabl
edInHierarchy&&this.toggleGroup.addToggle(this)},onDisable:function()
{this._super(),this._unregisterToggleEvent(),this.toggleGroup&&this.toggleGroup.ena
bledInHierarchy&&this.toggleGroup.removeToggle(this)},_hideCheckMark:function()
{this._N$isChecked=!1,this._updateCheckMark()},toggle:function(t){this.isChecked=!
this.isChecked},check:function(){this.isChecked=!0},uncheck:function()
{this.isChecked=!1},_updateCheckMark:function()
{this.checkMark&&(this.checkMark.node.active=!!
this.isChecked)},_updateDisabledState:function()
{if(this._super(),this.enableAutoGrayEffect&&this.checkMark){var t=!
this.interactable;this._switchGrayMaterial(t,this.checkMark)}},_registerToggleEvent
:function()
{this.node.on("click",this.toggle,this)},_unregisterToggleEvent:function()
{this.node.off("click",this.toggle,this)},_emitToggleEvents:function()
{this.node.emit("toggle",this),this.checkEvents&&cc.Component.EventHandler.emitEven
ts(this.checkEvents,this)}});cc.Toggle=e.exports=r,t("../platform/js").get(r.protot
ype,"_toggleContainer",(function(){var t=this.node.parent;return cc.Node.isNode(t)?
t.getComponent(cc.ToggleContainer):null}))}),{"../platform/js":220,"../utils/gray-
sprite-state":291,"./CCButton":93,"./CCToggleGroup":115}],114:[(function(t,e,i)
{"use strict";var
n=cc.Class({name:"cc.ToggleContainer",extends:cc.Component,editor:!1,properties:
{allowSwitchOff:{tooltip:!1,default:!1},checkEvents:{default:
[],type:cc.Component.EventHandler}},updateToggles:function(t)
{this.enabledInHierarchy&&t.isChecked&&(this.toggleItems.forEach((function(e){e!
==t&&e.isChecked&&e.enabled&&e._hideCheckMark()})),this.checkEvents&&cc.Component.E
ventHandler.emitEvents(this.checkEvents,t))},_allowOnlyOneToggleChecked:function()
{var t=!1;return this.toggleItems.forEach((function(e){t?
e._hideCheckMark():e.isChecked&&(t=!
0)})),t},_makeAtLeastOneToggleChecked:function(){if(!
this._allowOnlyOneToggleChecked()&&!this.allowSwitchOff){var
t=this.toggleItems;t.length>0&&t[0].check()}},onEnable:function()
{this.node.on("child-
added",this._allowOnlyOneToggleChecked,this),this.node.on("child-
removed",this._makeAtLeastOneToggleChecked,this)},onDisable:function()
{this.node.off("child-
added",this._allowOnlyOneToggleChecked,this),this.node.off("child-
removed",this._makeAtLeastOneToggleChecked,this)},start:function()
{this._makeAtLeastOneToggleChecked()}});t("../platform/js").get(n.prototype,"toggle
Items",(function(){return
this.node.getComponentsInChildren(cc.Toggle)})),cc.ToggleContainer=e.exports=n}),
{"../platform/js":220}],115:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.ToggleGroup",extends:cc.Component,ctor:function()
{this._toggleItems=[]},editor:!1,properties:{allowSwitchOff:{tooltip:!1,default:!
1},toggleItems:{get:function(){return
this._toggleItems}}},updateToggles:function(t)
{this.enabledInHierarchy&&this._toggleItems.forEach((function(e){t.isChecked&&e!
==t&&e.isChecked&&e.enabled&&e._hideCheckMark()}))},addToggle:function(t){-
1===this._toggleItems.indexOf(t)&&this._toggleItems.push(t),this._allowOnlyOneToggl
eChecked()},removeToggle:function(t){var e=this._toggleItems.indexOf(t);e>-
1&&this._toggleItems.splice(e,1),this._makeAtLeastOneToggleChecked()},_allowOnlyOne
ToggleChecked:function(){var t=!1;return this._toggleItems.forEach((function(e)
{t&&e.enabled&&e._hideCheckMark(),e.isChecked&&e.enabled&&(t=!
0)})),t},_makeAtLeastOneToggleChecked:function()
{this._allowOnlyOneToggleChecked()||this.allowSwitchOff||
this._toggleItems.length>0&&(this._toggleItems[0].isChecked=!0)},start:function()
{this._makeAtLeastOneToggleChecked()}}),r=!
1;t("../platform/js").get(cc,"ToggleGroup",(function(){return r||
(cc.logID(1405,"cc.ToggleGroup","cc.ToggleContainer"),r=!0),n})),e.exports=n}),
{"../platform/js":220}],116:[(function(t,e,i){"use strict";var
n=cc.Class({name:"cc.ViewGroup",extends:t("./CCComponent")});cc.ViewGroup=e.exports
=n}),{"./CCComponent":95}],117:[(function(t,e,i){"use strict";var n=t("../base-
ui/CCWidgetManager"),r=n.AlignMode,s=n._AlignFlags,a=s.TOP,o=s.MID,l=s.BOT,h=s.LEFT
,c=s.CENTER,u=s.RIGHT,_=a|l,f=h|
u,d=cc.Class({name:"cc.Widget",extends:t("./CCComponent"),editor:!1,properties:
{target:{get:function(){return this._target},set:function(t)
{this._target=t},type:cc.Node,tooltip:!1},isAlignTop:{get:function()
{return(this._alignFlags&a)>0},set:function(t){this._setAlign(a,t)},animatable:!
1,tooltip:!1},isAlignVerticalCenter:{get:function()
{return(this._alignFlags&o)>0},set:function(t){t?(this.isAlignTop=!
1,this.isAlignBottom=!1,this._alignFlags|=o):this._alignFlags&=~o},animatable:!
1,tooltip:!1},isAlignBottom:{get:function()
{return(this._alignFlags&l)>0},set:function(t){this._setAlign(l,t)},animatable:!
1,tooltip:!1},isAlignLeft:{get:function()
{return(this._alignFlags&h)>0},set:function(t){this._setAlign(h,t)},animatable:!
1,tooltip:!1},isAlignHorizontalCenter:{get:function()
{return(this._alignFlags&c)>0},set:function(t){t?(this.isAlignLeft=!
1,this.isAlignRight=!1,this._alignFlags|=c):this._alignFlags&=~c},animatable:!
1,tooltip:!1},isAlignRight:{get:function()
{return(this._alignFlags&u)>0},set:function(t){this._setAlign(u,t)},animatable:!
1,tooltip:!1},isStretchWidth:{get:function()
{return(this._alignFlags&f)===f},visible:!1},isStretchHeight:{get:function()
{return(this._alignFlags&_)===_},visible:!1},top:{get:function(){return
this._top},set:function(t){this._top=t},tooltip:!1},bottom:{get:function(){return
this._bottom},set:function(t){this._bottom=t},tooltip:!1},left:{get:function()
{return this._left},set:function(t){this._left=t},tooltip:!1},right:{get:function()
{return this._right},set:function(t){this._right=t},tooltip:!1},horizontalCenter:
{get:function(){return this._horizontalCenter},set:function(t)
{this._horizontalCenter=t},tooltip:!1},verticalCenter:{get:function(){return
this._verticalCenter},set:function(t){this._verticalCenter=t},tooltip:!
1},isAbsoluteHorizontalCenter:{get:function(){return
this._isAbsHorizontalCenter},set:function(t)
{this._isAbsHorizontalCenter=t},animatable:!1},isAbsoluteVerticalCenter:
{get:function(){return this._isAbsVerticalCenter},set:function(t)
{this._isAbsVerticalCenter=t},animatable:!1},isAbsoluteTop:{get:function(){return
this._isAbsTop},set:function(t){this._isAbsTop=t},animatable:!1},isAbsoluteBottom:
{get:function(){return this._isAbsBottom},set:function(t)
{this._isAbsBottom=t},animatable:!1},isAbsoluteLeft:{get:function(){return
this._isAbsLeft},set:function(t){this._isAbsLeft=t},animatable:!1},isAbsoluteRight:
{get:function(){return this._isAbsRight},set:function(t)
{this._isAbsRight=t},animatable:!1},alignMode:
{default:r.ON_WINDOW_RESIZE,type:r,tooltip:!1},_wasAlignOnce:{default:void
0,formerlySerializedAs:"isAlignOnce"},_target:null,_alignFlags:0,_left:0,_right:0,_
top:0,_bottom:0,_verticalCenter:0,_horizontalCenter:0,_isAbsLeft:!0,_isAbsRight:!
0,_isAbsTop:!0,_isAbsBottom:!0,_isAbsHorizontalCenter:!0,_isAbsVerticalCenter:!
0,_originalWidth:0,_originalHeight:0},statics:{AlignMode:r},onLoad:function(){void
0!==this._wasAlignOnce&&(this.alignMode=this._wasAlignOnce?
r.ONCE:r.ALWAYS,this._wasAlignOnce=void 0)},onEnable:function()
{n.add(this)},onDisable:function(){n.remove(this)},_validateTargetInDEV:!
1,_setAlign:function(t,e){if(e!==(this._alignFlags&t)>0){var i=(t&f)>0;e?
(this._alignFlags|=t,i?(this.isAlignHorizontalCenter=!
1,this.isStretchWidth&&(this._originalWidth=this.node.width)):
(this.isAlignVerticalCenter=!
1,this.isStretchHeight&&(this._originalHeight=this.node.height))):(i?
this.isStretchWidth&&(this.node.width=this._originalWidth):this.isStretchHeight&&(t
his.node.height=this._originalHeight),this._alignFlags&=~t)}},updateAlignment:funct
ion()
{n.updateAlignment(this.node)}});Object.defineProperty(d.prototype,"isAlignOnce",
{get:function(){return this.alignMode===r.ONCE},set:function(t){this.alignMode=t?
r.ONCE:r.ALWAYS}}),cc.Widget=e.exports=d}),{"../base-
ui/CCWidgetManager":79,"./CCComponent":95}],118:[(function(t,e,i){"use strict";var
n=t("./CCComponent"),r=void 0;r=cc.sys.platform===cc.sys.BAIDU_GAME?
cc.Class({name:"cc.SwanSubContextView",extends:n,editor:!1,properties:{_fps:60,fps:
{get:function(){return this._fps},set:function(t){this._fps!
==t&&(this._fps=t,this._updateInterval=1/t,this._updateSubContextFrameRate())},tool
tip:!1}},ctor:function(){this._sprite=null,this._tex=new
cc.Texture2D,this._context=null,this._previousUpdateTime=performance.now(),this._up
dateInterval=0},onLoad:function(){if(swan.getOpenDataContext)
{this._updateInterval=1e3/this._fps,this._context=swan.getOpenDataContext();var
t=this._context.canvas;t&&(t.width=this.node.width,t.height=this.node.height),this.
_tex.setPremultiplyAlpha(!
0),this._tex.initWithElement(t),this._sprite=this.node.getComponent(cc.Sprite),this
._sprite||
(this._sprite=this.node.addComponent(cc.Sprite),this._sprite.srcBlendFactor=cc.macr
o.BlendFactor.ONE),this._sprite.spriteFrame=new cc.SpriteFrame(this._tex)}else
this.enabled=!1},onEnable:function()
{this._runSubContextMainLoop(),this._registerNodeEvent(),this._updateSubContextFram
eRate(),this.updateSubContextViewport()},onDisable:function()
{this._unregisterNodeEvent(),this._stopSubContextMainLoop()},update:function(){var
t=performance.now(),e=t-this._previousUpdateTime;!this._tex||!this._context||
e<this._updateInterval||
(this._previousUpdateTime=t,this._tex.initWithElement(this._context.canvas),this._s
prite._activateMaterial())},updateSubContextViewport:function(){if(this._context)
{var
t=this.node.getBoundingBoxToWorld(),e=cc.view._scaleX,i=cc.view._scaleY;this._conte
xt.postMessage({fromEngine:!
0,event:"viewport",x:t.x*e+cc.view._viewportRect.x,y:t.y*i+cc.view._viewportRect.y,
width:t.width*e,height:t.height*i})}},_registerNodeEvent:function()
{this.node.on("position-
changed",this.updateSubContextViewport,this),this.node.on("scale-
changed",this.updateSubContextViewport,this),this.node.on("size-
changed",this.updateSubContextViewport,this)},_unregisterNodeEvent:function()
{this.node.off("position-
changed",this.updateSubContextViewport,this),this.node.off("scale-
changed",this.updateSubContextViewport,this),this.node.off("size-
changed",this.updateSubContextViewport,this)},_runSubContextMainLoop:function()
{this._context&&this._context.postMessage({fromEngine:!0,event:"mainLoop",value:!
0})},_stopSubContextMainLoop:function()
{this._context&&this._context.postMessage({fromEngine:!0,event:"mainLoop",value:!
1})},_updateSubContextFrameRate:function()
{this._context&&this._context.postMessage({fromEngine:!
0,event:"frameRate",value:this._fps})}}):cc.Class({name:"cc.SwanSubContextView",ext
ends:n}),cc.SwanSubContextView=e.exports=r}),{"./CCComponent":95}],119:
[(function(t,e,i){"use strict";var n=t("./CCComponent"),r=void
0;r=cc.Class({name:"cc.WXSubContextView",extends:n}),cc.WXSubContextView=e.exports=
r}),{"./CCComponent":95}],120:[(function(t,e,i){"use strict";var
n=t("../../platform/CCMacro"),r=t("./EditBoxImplBase"),s=t("../CCLabel"),a=t("./typ
es"),o=a.InputMode,l=a.InputFlag,h=a.KeyboardReturnType;function c(t){return
t.replace(/(?:^|\s)\S/g,(function(t){return t.toUpperCase()}))}function u(t){return
t.charAt(0).toUpperCase()+t.slice(1)}var
_=cc.Class({name:"cc.EditBox",extends:cc.Component,editor:!1,properties:
{_useOriginalSize:!0,_string:"",string:{tooltip:!1,get:function(){return
this._string},set:function(t)
{this.maxLength>=0&&t.length>=this.maxLength&&(t=t.slice(0,this.maxLength)),this._s
tring=t,this._updateString(t)}},textLabel:{tooltip:!
1,default:null,type:s,notify:function(t){this.textLabel&&this.textLabel!
==t&&(this._updateTextLabel(),this._updateLabels())}},placeholderLabel:{tooltip:!
1,default:null,type:s,notify:function(t)
{this.placeholderLabel&&this.placeholderLabel!
==t&&(this._updatePlaceholderLabel(),this._updateLabels())}},background:{tooltip:!
1,default:null,type:cc.Sprite,notify:function(t){this.background&&this.background!
==t&&this._updateBackgroundSprite()}},_N$backgroundImage:{default:void
0,type:cc.SpriteFrame},backgroundImage:{get:function(){return this.background?
this.background.spriteFrame:null},set:function(t)
{this.background&&(this.background.spriteFrame=t)}},returnType:
{default:h.DEFAULT,tooltip:!
1,displayName:"KeyboardReturnType",type:h},_N$returnType:{default:void
0,type:cc.Float},inputFlag:{tooltip:!1,default:l.DEFAULT,type:l,notify:function()
{this._updateString(this._string)}},inputMode:{tooltip:!
1,default:o.ANY,type:o,notify:function(t){this.inputMode!
==t&&(this._updateTextLabel(),this._updatePlaceholderLabel())}},fontSize:
{get:function(){return this.textLabel?this.textLabel.fontSize:null},set:function(t)
{this.textLabel&&(this.textLabel.fontSize=t)}},_N$fontSize:{default:void
0,type:cc.Float},lineHeight:{get:function(){return this.textLabel?
this.textLabel.lineHeight:null},set:function(t)
{this.textLabel&&(this.textLabel.lineHeight=t)}},_N$lineHeight:{default:void
0,type:cc.Float},fontColor:{get:function(){return this.textLabel?
this.textLabel.node.color:null},set:function(t)
{this.textLabel&&(this.textLabel.node.color=t,this.textLabel.node.opacity=t.a)}},_N
$fontColor:{default:void 0,type:cc.Color},placeholder:{tooltip:!1,get:function()
{return this.placeholderLabel?this.placeholderLabel.string:""},set:function(t)
{this.placeholderLabel&&(this.placeholderLabel.string=t)}},_N$placeholder:
{default:void 0,type:cc.String},placeholderFontSize:{get:function(){return
this.placeholderLabel?this.placeholderLabel.fontSize:null},set:function(t)
{this.placeholderLabel&&(this.placeholderLabel.fontSize=t)}},_N$placeholderFontSize
:{default:void 0,type:cc.Float},placeholderFontColor:{get:function(){return
this.placeholderLabel?this.placeholderLabel.node.color:null},set:function(t)
{this.placeholderLabel&&(this.placeholderLabel.node.color=t,this.placeholderLabel.n
ode.opacity=t.a)}},_N$placeholderFontColor:{default:void
0,type:cc.Color},maxLength:{tooltip:!1,default:20},_N$maxLength:{default:void
0,type:cc.Float},stayOnTop:{default:!1,notify:function(){cc.warn("editBox.stayOnTop
is removed since v2.1.")}},_tabIndex:0,tabIndex:{tooltip:!1,get:function(){return
this._tabIndex},set:function(t)
{this._tabIndex=t,this._impl&&this._impl.setTabIndex(t)}},editingDidBegan:{default:
[],type:cc.Component.EventHandler},textChanged:{default:
[],type:cc.Component.EventHandler},editingDidEnded:{default:
[],type:cc.Component.EventHandler},editingReturn:{default:
[],type:cc.Component.EventHandler}},statics:
{_ImplClass:r,KeyboardReturnType:h,InputFlag:l,InputMode:o},_init:function()
{this._upgradeComp(),this._isLabelVisible=!
0,this.node.on(cc.Node.EventType.SIZE_CHANGED,this._syncSize,this),(this._impl=new
_._ImplClass).init(this),this._updateString(this._string),this._syncSize()},_update
BackgroundSprite:function(){var t=this.background;if(!t){var
e=this.node.getChildByName("BACKGROUND_SPRITE");e||(e=new
cc.Node("BACKGROUND_SPRITE")),(t=e.getComponent(cc.Sprite))||
(t=e.addComponent(cc.Sprite)),e.parent=this.node,this.background=t}t.type=cc.Sprite
.Type.SLICED,void 0!
==this._N$backgroundImage&&(t.spriteFrame=this._N$backgroundImage,this._N$backgroun
dImage=void 0)},_updateTextLabel:function(){var t=this.textLabel;if(!t){var
e=this.node.getChildByName("TEXT_LABEL");e||(e=new cc.Node("TEXT_LABEL")),
(t=e.getComponent(s))||
(t=e.addComponent(s)),e.parent=this.node,this.textLabel=t}t.node.setAnchorPoint(0,1
),t.overflow=s.Overflow.CLAMP,this.inputMode===o.ANY?
(t.verticalAlign=n.VerticalTextAlignment.TOP,t.enableWrapText=!0):
(t.verticalAlign=n.VerticalTextAlignment.CENTER,t.enableWrapText=!
1),t.string=this._updateLabelStringStyle(this._string),void 0!
==this._N$fontColor&&(t.node.color=this._N$fontColor,t.node.opacity=this._N$fontCol
or.a,this._N$fontColor=void 0),void 0!
==this._N$fontSize&&(t.fontSize=this._N$fontSize,this._N$fontSize=void 0),void 0!
==this._N$lineHeight&&(t.lineHeight=this._N$lineHeight,this._N$lineHeight=void
0)},_updatePlaceholderLabel:function(){var t=this.placeholderLabel;if(!t){var
e=this.node.getChildByName("PLACEHOLDER_LABEL");e||(e=new
cc.Node("PLACEHOLDER_LABEL")),(t=e.getComponent(s))||
(t=e.addComponent(s)),e.parent=this.node,this.placeholderLabel=t}t.node.setAnchorPo
int(0,1),t.overflow=s.Overflow.CLAMP,this.inputMode===o.ANY?
(t.verticalAlign=n.VerticalTextAlignment.TOP,t.enableWrapText=!0):
(t.verticalAlign=n.VerticalTextAlignment.CENTER,t.enableWrapText=!
1),t.string=this.placeholder,void 0!
==this._N$placeholderFontColor&&(t.node.color=this._N$placeholderFontColor,t.node.o
pacity=this._N$placeholderFontColor.a,this._N$placeholderFontColor=void 0),void 0!
==this._N$placeholderFontSize&&(t.fontSize=this._N$placeholderFontSize,this._N$plac
eholderFontSize=void 0)},_upgradeComp:function(){void 0!
==this._N$returnType&&(this.returnType=this._N$returnType,this._N$returnType=void
0),void 0!
==this._N$maxLength&&(this.maxLength=this._N$maxLength,this._N$maxLength=void
0),void 0!==this._N$backgroundImage&&this._updateBackgroundSprite(),void
0===this._N$fontColor&&void 0===this._N$fontSize&&void 0===this._N$lineHeight||
this._updateTextLabel(),void 0===this._N$placeholderFontColor&&void
0===this._N$placeholderFontSize||this._updatePlaceholderLabel(),void 0!
==this._N$placeholder&&(this.placeholder=this._N$placeholder,this._N$placeholder=vo
id 0)},_syncSize:function(){if(this._impl){var
t=this.node.getContentSize();this._impl.setSize(t.width,t.height)}},_showLabels:fun
ction(){this._isLabelVisible=!0,this._updateLabels()},_hideLabels:function()
{this._isLabelVisible=!1,this.textLabel&&(this.textLabel.node.active=!
1),this.placeholderLabel&&(this.placeholderLabel.node.active=!
1)},_updateLabels:function(){if(this._isLabelVisible){var
t=this._string;this.textLabel&&(this.textLabel.node.active=""!
==t),this.placeholderLabel&&(this.placeholderLabel.node.active=""===t)}},_updateStr
ing:function(t){var e=this.textLabel;if(e){var
i=t;i&&(i=this._updateLabelStringStyle(i)),e.string=i,this._updateLabels()}},_updat
eLabelStringStyle:function(t,e){var i=this.inputFlag;if(e||i!
==l.PASSWORD)i===l.INITIAL_CAPS_ALL_CHARACTERS?
t=t.toUpperCase():i===l.INITIAL_CAPS_WORD?
t=c(t):i===l.INITIAL_CAPS_SENTENCE&&(t=u(t));else{for(var n="",r=t.length,s=0;s<r;+
+s)n+="\u25cf";t=n}return t},editBoxEditingDidBegan:function()
{cc.Component.EventHandler.emitEvents(this.editingDidBegan,this),this.node.emit("ed
iting-did-began",this)},editBoxEditingDidEnded:function()
{cc.Component.EventHandler.emitEvents(this.editingDidEnded,this),this.node.emit("ed
iting-did-ended",this)},editBoxTextChanged:function(t)
{t=this._updateLabelStringStyle(t,!
0),this.string=t,cc.Component.EventHandler.emitEvents(this.textChanged,t,this),this
.node.emit("text-changed",this)},editBoxEditingReturn:function()
{cc.Component.EventHandler.emitEvents(this.editingReturn,this),this.node.emit("edit
ing-return",this)},onEnable:function()
{this._registerEvent(),this._impl&&this._impl.enable()},onDisable:function()
{this._unregisterEvent(),this._impl&&this._impl.disable()},onDestroy:function()
{this._impl&&this._impl.clear()},__preload:function()
{this._init()},_registerEvent:function()
{this.node.on(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.on(c
c.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_unregisterEvent:function()
{this.node.off(cc.Node.EventType.TOUCH_START,this._onTouchBegan,this),this.node.off
(cc.Node.EventType.TOUCH_END,this._onTouchEnded,this)},_onTouchBegan:function(t)
{t.stopPropagation()},_onTouchCancel:function(t)
{t.stopPropagation()},_onTouchEnded:function(t)
{this._impl&&this._impl.beginEditing(),t.stopPropagation()},setFocus:function()
{cc.warnID(1400,"setFocus()","focus()"),this._impl&&this._impl.setFocus(!
0)},focus:function(){this._impl&&this._impl.setFocus(!0)},blur:function()
{this._impl&&this._impl.setFocus(!1)},isFocused:function(){return!!
this._impl&&this._impl.isFocused()},update:function()
{this._impl&&this._impl.update()}});cc.EditBox=e.exports=_,cc.sys.isBrowser&&t("./W
ebEditBoxImpl")}),
{"../../platform/CCMacro":205,"../CCLabel":97,"./EditBoxImplBase":121,"./WebEditBox
Impl":122,"./types":123}],121:[(function(t,e,i){"use strict";var
n=cc.Class({ctor:function(){this._delegate=null},init:function(t)
{},enable:function(){},disable:function(){},clear:function(){},update:function()
{},setTabIndex:function(t){},setSize:function(t,e){},setFocus:function(t)
{},isFocused:function(){},beginEditing:function(){},endEditing:function()
{}});e.exports=n}),{}],122:[(function(t,e,i){"use strict";var
n=t("../../platform/utils"),r=t("../../platform/CCMacro"),s=t("./types"),a=t("../CC
Label"),o=cc.EditBox,l=cc.js,h=s.InputMode,c=s.InputFlag,u=s.KeyboardReturnType,_=c
c.vmath,f={zoomInvalid:!1};cc.sys.OS_ANDROID!==cc.sys.os||cc.sys.browserType!
==cc.sys.BROWSER_TYPE_SOUGOU&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_360||
(f.zoomInvalid=!0);var d=0,m=cc.v3(),p=null,v=!1,y=!1;function g()
{this._domId="EditBoxId_"+ +
+d,this._placeholderStyleSheet=null,this._elem=null,this._isTextArea=!
1,this._editing=!
1,this._worldMat=_.mat4.create(),this._cameraMat=_.mat4.create(),this._m00=0,this._
m01=0,this._m04=0,this._m05=0,this._m12=0,this._m13=0,this._w=0,this._h=0,this._inp
utMode=null,this._inputFlag=null,this._returnType=null,this._eventListeners={},this
._textLabelFont=null,this._textLabelFontSize=null,this._textLabelFontColor=null,thi
s._textLabelAlign=null,this._placeholderLabelFont=null,this._placeholderLabelFontSi
ze=null,this._placeholderLabelFontColor=null,this._placeholderLabelAlign=null,this.
_placeholderLineHeight=null}l.extend(g,o._ImplClass),o._ImplClass=g,Object.assign(g
.prototype,{init:function(t){t&&(this._delegate=t,t.inputMode===h.ANY?
this._createTextArea():this._createInput(),this.setTabIndex(t.tabIndex),this._disab
leDom(),this._initStyleSheet(),this._registerEventListeners(),this._addDomToGameCon
tainer(),v=cc.view.isAutoFullScreenEnabled(),y=cc.view._resizeWithBrowserSize)},ena
ble:function()
{this._enableDom(),this._delegate._unregisterEvent()},disable:function()
{this._disableDom()},clear:function()
{this._removeEventListeners(),this._removeDomFromGameContainer()},update:function()
{this._updateMatrix()},setTabIndex:function(t)
{this._elem.tabIndex=t},setSize:function(t,e){var
i=this._elem;i.style.width=t+"px",i.style.height=e+"px"},setFocus:function(t){t?
this._elem.focus():this._elem.blur()},isFocused:function(){return
this._editing},beginEditing:function(){this._editing=!
0,p=this,this._showDom(),this._delegate.editBoxEditingDidBegan()},endEditing:functi
on(){this._editing=!
1,p=null,this._hideDom(),this._delegate.editBoxEditingDidEnded()},_createInput:func
tion(){this._isTextArea=!
1,this._elem=document.createElement("input")},_createTextArea:function()
{this._isTextArea=!
0,this._elem=document.createElement("textarea")},_addDomToGameContainer:function()
{cc.game.container.appendChild(this._elem),document.head.appendChild(this._placehol
derStyleSheet)},_removeDomFromGameContainer:function()
{n.contains(cc.game.container,this._elem)&&cc.game.container.removeChild(this._elem
),n.contains(documen
t.head,this._placeholderStyleSheet)&&document.head.removeChild(this._placeholderSty
leSheet),delete this._elem,delete
this._placeholderStyleSheet},_enableDom:function()
{this._elem.style.display=""},_disableDom:function()
{this._elem.style.display="none"},_showDom:function()
{this._updateMaxLength(),this._updateInputType(),this._updateStyleSheet(),this._ele
m.style.opacity=1,this._delegate._hideLabels(),cc.sys.isMobile&&this._showDomOnMobi
le()},_hideDom:function()
{this._elem.style.opacity=0,this._delegate._showLabels(),cc.sys.isMobile&&this._hid
eDomOnMobile()},_showDomOnMobile:function()
{cc.sys.os===cc.sys.OS_ANDROID&&(v&&(cc.view.enableAutoFullScreen(!
1),cc.screen.exitFullScreen()),y&&cc.view.resizeWithBrowserSize(!
1),this._adjustWindowScroll())},_hideDomOnMobile:function()
{cc.sys.os===cc.sys.OS_ANDROID&&(v&&cc.view.enableAutoFullScreen(!
0),y&&cc.view.resizeWithBrowserSize(!
0),this._scrollBackWindow())},_adjustWindowScroll:function(){var
t=this;setTimeout((function()
{window.scrollY<100&&t._elem.scrollIntoView({block:"start",inline:"nearest",behavio
r:"smooth"})}),800)},_scrollBackWindow:function(){setTimeout((function()
{window.scrollTo(0,0)}),800)},_updateMatrix:function(){var
t=this._delegate.node;t.getWorldMatrix(this._worldMat);var
e=this._worldMat;if(this._m00!==e.m00||this._m01!==e.m01||this._m04!==e.m04||
this._m05!==e.m05||this._m12!==e.m12||this._m13!==e.m13||this._w!
==t._contentSize.width||this._h!==t._contentSize.height)
{this._m00=e.m00,this._m01=e.m01,this._m04=e.m04,this._m05=e.m05,this._m12=e.m12,th
is._m13=e.m13,this._w=t._contentSize.width,this._h=t._contentSize.height;var
i=cc.view._scaleX,n=cc.view._scaleY,r=cc.view._viewportRect,s=cc.view._devicePixelR
atio;m.x=-t._anchorPoint.x*this._w,m.y=-
t._anchorPoint.y*this._h,_.mat4.translate(e,e,m);var a=void
0;cc.Camera.findCamera(t).getWorldToCameraMatrix(this._cameraMat),a=this._cameraMat
,_.mat4.mul(a,a,e),i/=s,n/=s;var
o=cc.game.container,l=a.m00*i,h=a.m01,c=a.m04,u=a.m05*n,d=o&&o.style.paddingLeft&&p
arseInt(o.style.paddingLeft);d+=r.x/s;var
p=o&&o.style.paddingBottom&&parseInt(o.style.paddingBottom);p+=r.y/s;var
v=a.m12*i+d,y=a.m13*n+p;f.zoomInvalid&&(this.setSize(t.width*l,t.height*u),l=1,u=1)
;var g=this._elem,x="matrix("+l+","+-h+","+-c+","+u+","+v+","+-
y+")";g.style.transform=x,g.style["-webkit-transform"]=x,g.style["transform-
origin"]="0px 100% 0px",g.style["-webkit-transform-origin"]="0px 100%
0px"}},_updateInputType:function(){var
t=this._delegate,e=t.inputMode,i=t.inputFlag,n=t.returnType,r=this._elem;if(this._i
nputMode!==e||this._inputFlag!==i||this._returnType!==n)
{if(this._inputMode=e,this._inputFlag=i,this._returnType=n,this._isTextArea){var
s="none";return i===c.INITIAL_CAPS_ALL_CHARACTERS?
s="uppercase":i===c.INITIAL_CAPS_WORD&&(s="capitalize"),void(r.style.textTransform=
s)}if(i!==c.PASSWORD){var a=r.type;e===h.EMAIL_ADDR?a="email":e===h.NUMERIC||
e===h.DECIMAL?a="number":e===h.PHONE_NUMBER?(a="number",r.pattern="[0-
9]*"):e===h.URL?a="url":(a="text",n===u.SEARCH&&(a="search")),r.type=a;var
o="none";i===c.INITIAL_CAPS_ALL_CHARACTERS?
o="uppercase":i===c.INITIAL_CAPS_WORD&&(o="capitalize"),r.style.textTransform=o}els
e r.type="password"}},_updateMaxLength:function(){var
t=this._delegate.maxLength;t<0&&(t=65535),this._elem.maxLength=t},_initStyleSheet:f
unction(){var
t=this._elem;t.style.opacity=0,t.style.border=0,t.style.background="transparent",t.
style.width="100%",t.style.height="100%",t.style.active=0,t.style.outline="medium",
t.style.padding="0",t.style.textTransform="uppercase",t.style.position="absolute",t
.style.bottom="0px",t.style.left="2px",t.className="cocosEditBox",t.id=this._domId,
this._isTextArea?(t.style.resize="none",t.style.overflow_y="scroll"):
(t.type="text",t.style["-moz-
appearance"]="textfield"),this._placeholderStyleSheet=document.createElement("style
")},_updateStyleSheet:function(){var
t=this._delegate,e=this._elem;e.value=t.string,e.placeholder=t.placeholder,this._up
dateTextLabel(t.textLabel),this._updatePlaceholderLabel(t.placeholderLabel)},_updat
eTextLabel:function(t){if(t){var e=t.font;if(e=!e||e instanceof cc.BitmapFont?
t.fontFamily:e._fontFamily,this._textLabelFont!==e||this._textLabelFontSize!
==t.fontSize||this._textLabelFontColor!==t.fontColor||this._textLabelAlign!
==t.horizontalAlign)
{this._textLabelFont=e,this._textLabelFontSize=t.fontSize,this._textLabelFontColor=
t.fontColor,this._textLabelAlign=t.horizontalAlign;var
i=this._elem;switch(i.style.fontSize=t.fontSize+"px",i.style.color=t.node.color.toC
SS("rgba"),i.style.fontFamily=e,t.horizontalAlign){case
a.HorizontalAlign.LEFT:i.style.textAlign="left";break;case
a.HorizontalAlign.CENTER:i.style.textAlign="center";break;case
a.HorizontalAlign.RIGHT:i.style.textAlign="right"}}}},_updatePlaceholderLabel:funct
ion(t){if(t){var e=t.font;if(e=!e||e instanceof cc.BitmapFont?
t.fontFamily:t.font._fontFamily,this._placeholderLabelFont!==e||
this._placeholderLabelFontSize!==t.fontSize||this._placeholderLabelFontColor!
==t.fontColor||this._placeholderLabelAlign!==t.horizontalAlign||
this._placeholderLineHeight!==t.lineHeight)
{this._placeholderLabelFont=e,this._placeholderLabelFontSize=t.fontSize,this._place
holderLabelFontColor=t.fontColor,this._placeholderLabelAlign=t.horizontalAlign,this
._placeholderLineHeight=t.lineHeight;var
i=this._placeholderStyleSheet,n=t.fontSize,r=t.node.color.toCSS("rgba"),s=t.lineHei
ght,o=void 0;switch(t.horizontalAlign){case
a.HorizontalAlign.LEFT:o="left";break;case
a.HorizontalAlign.CENTER:o="center";break;case
a.HorizontalAlign.RIGHT:o="right"}i.innerHTML="\n #"+this._domId+"::-
webkit-input-placeholder {\n text-transform: initial;\n
font-family: "+e+";\n font-size: "+n+"px;\n color:
"+r+";\n line-height: "+s+"px;\n text-align: "+o+";\n
}\n #"+this._domId+"::-moz-placeholder {\n text-
transform: initial;\n font-family: "+e+";\n font-
size: "+n+"px;\n color: "+r+";\n line-height:
"+s+"px;\n text-align: "+o+";\n }\n
#"+this._domId+":-ms-input-placeholder {\n text-transform:
initial;\n font-family: "+e+";\n font-size:
"+n+"px;\n color: "+r+";\n line-height: "+s+"px;\n
text-align: "+o+";\n }\n "}}},_registerEventListeners:function()
{var t=this,e=this._elem,i=!1,n=this._eventListeners;n.compositionStart=function()
{i=!0},n.compositionEnd=function(){i=!
1,t._delegate.editBoxTextChanged(e.value)},n.onInput=function(){i||
t._delegate.editBoxTextChanged(e.value)},n.onFocus=function()
{t.beginEditing()},n.onClick=function(e){t._editing?
cc.sys.isMobile&&t._adjustWindowScroll():p&&p!
==t&&p._elem.blur()},n.onKeypress=function(i)
{i.keyCode===r.KEY.enter&&(i.stopPropagation(),t._delegate.editBoxEditingReturn(),t
._isTextArea||e.blur())},n.onBlur=function()
{t.endEditing()},e.addEventListener("compositionstart",n.compositionStart),e.addEve
ntListener("compositionend",n.compositionEnd),e.addEventListener("input",n.onInput)
,e.addEventListener("focus",n.onFocus),e.addEventListener("keypress",n.onKeypress),
e.addEventListener("blur",n.onBlur),e.addEventListener("touchstart",n.onClick)},_re
moveEventListeners:function(){var
t=this._elem,e=this._eventListeners;t.removeEventListener("compositionstart",e.comp
ositionStart),t.removeEventListener("compositionend",e.compositionEnd),t.removeEven
tListener("input",e.onInput),t.removeEventListener("focus",e.onFocus),t.removeEvent
Listener("keypress",e.onKeypress),t.removeEventListener("blur",e.onBlur),t.removeEv
entListener("touchstart",e.onClick),e.compositionStart=null,e.compositionEnd=null,e
.onInput=null,e.onFocus=null,e.onKeypress=null,e.onBlur=null,e.onClick=null}})}),
{"../../platform/CCMacro":205,"../../platform/utils":224,"../CCLabel":97,"./types":
123}],123:[(function(t,e,i){"use strict";var
n=cc.Enum({DEFAULT:0,DONE:1,SEND:2,SEARCH:3,GO:4,NEXT:5}),r=cc.Enum({ANY:0,EMAIL_AD
DR:1,NUMERIC:2,PHONE_NUMBER:3,URL:4,DECIMAL:5,SINGLE_LINE:6}),s=cc.Enum({PASSWORD:0
,SENSITIVE:1,INITIAL_CAPS_WORD:2,INITIAL_CAPS_SENTENCE:3,INITIAL_CAPS_ALL_CHARACTER
S:4,DEFAULT:5});e.exports={KeyboardReturnType:n,InputMode:r,InputFlag:s}}),{}],124:
[(function(t,e,i){"use
strict";t("./CCComponent"),t("./CCComponentEventHandler"),t("./missing-script");var
n=[t("./CCSprite"),t("./CCWidget"),t("./CCCanvas"),t("./CCAudioSource"),t("./CCAnim
ation"),t("./CCButton"),t("./CCLabel"),t("./CCProgressBar"),t("./CCMask"),t("./CCSc
rollBar"),t("./CCScrollView"),t("./CCPageViewIndicator"),t("./CCPageView"),t("./CCS
lider"),t("./CCLayout"),t("./editbox/CCEditBox"),t("./CCLabelOutline"),t("./CCLabel
Shadow"),t("./CCRichText"),t("./CCToggleContainer"),t("./CCToggleGroup"),t("./CCTog
gle"),t("./CCBlockInputEvents"),t("./CCMotionStreak"),t("./WXSubContextView"),t("./
SwanSubContextView")];e.exports=n}),
{"./CCAnimation":90,"./CCAudioSource":91,"./CCBlockInputEvents":92,"./CCButton":93,
"./CCCanvas":94,"./CCComponent":95,"./CCComponentEventHandler":96,"./CCLabel":97,".
/CCLabelOutline":98,"./CCLabelShadow":99,"./CCLayout":100,"./CCMask":101,"./CCMotio
nStreak":102,"./CCPageView":103,"./CCPageViewIndicator":104,"./CCProgressBar":105,"
./CCRichText":107,"./CCScrollBar":108,"./CCScrollView":109,"./CCSlider":110,"./CCSp
rite":111,"./CCToggle":113,"./CCToggleContainer":114,"./CCToggleGroup":115,"./CCWid
get":117,"./SwanSubContextView":118,"./WXSubContextView":119,"./editbox/CCEditBox":
120,"./missing-script":125}],125:[(function(t,e,i){"use strict";var
n=cc.js,r=t("../utils/misc").BUILTIN_CLASSID_RE,s=cc.Class({name:"cc.MissingClass",
properties:{_$erialized:{default:null,visible:!1,editorOnly:!
0}}}),a=cc.Class({name:"cc.MissingScript",extends:cc.Component,editor:
{inspector:"packages://inspector/inspectors/comps/missing-script.js"},properties:
{compiled:{default:!1,serializable:!1},_$erialized:{default:null,visible:!
1,editorOnly:!0}},ctor:!1,statics:{safeFindClass:function(t,e
){var i=n._getClassById(t);return i||(t?
(cc.deserialize.reportMissingClass(t),a.getMissingWrapper(t,e)):null)},getMissingWr
apper:function(t,e){return e.node&&(/^[0-9a-zA-Z+/]{23}$/.test(t)||r.test(t))?
a:s}},onLoad:function()
{cc.warnID(4600,this.node.name)}});cc._MissingScript=e.exports=a}),
{"../utils/misc":295}],126:[(function(t,e,i){"use strict";var
n=cc.js;t("../event/event");var r=function(t,e)
{cc.Event.call(this,cc.Event.MOUSE,e),this._eventType=t,this._button=0,this._x=0,th
is._y=0,this._prevX=0,this._prevY=0,this._scrollX=0,this._scrollY=0};n.extend(r,cc.
Event);var s=r.prototype;s.setScrollData=function(t,e)
{this._scrollX=t,this._scrollY=e},s.getScrollX=function(){return
this._scrollX},s.getScrollY=function(){return
this._scrollY},s.setLocation=function(t,e)
{this._x=t,this._y=e},s.getLocation=function(){return
cc.v2(this._x,this._y)},s.getLocationInView=function(){return
cc.v2(this._x,cc.view._designResolutionSize.height-
this._y)},s._setPrevCursor=function(t,e)
{this._prevX=t,this._prevY=e},s.getPreviousLocation=function(){return
cc.v2(this._prevX,this._prevY)},s.getDelta=function(){return cc.v2(this._x-
this._prevX,this._y-this._prevY)},s.getDeltaX=function(){return this._x-
this._prevX},s.getDeltaY=function(){return this._y-
this._prevY},s.setButton=function(t){this._button=t},s.getButton=function(){return
this._button},s.getLocationX=function(){return this._x},s.getLocationY=function()
{return
this._y},r.NONE=0,r.DOWN=1,r.UP=2,r.MOVE=3,r.SCROLL=4,r.BUTTON_LEFT=0,r.BUTTON_RIGH
T=2,r.BUTTON_MIDDLE=1,r.BUTTON_4=3,r.BUTTON_5=4,r.BUTTON_6=5,r.BUTTON_7=6,r.BUTTON_
8=7;var a=function(t,e)
{cc.Event.call(this,cc.Event.TOUCH,e),this._eventCode=0,this._touches=t||
[],this.touch=null,this.currentTouch=null};n.extend(a,cc.Event),
(s=a.prototype).getEventCode=function(){return
this._eventCode},s.getTouches=function(){return
this._touches},s._setEventCode=function(t)
{this._eventCode=t},s._setTouches=function(t)
{this._touches=t},s.setLocation=function(t,e)
{this.touch&&this.touch.setTouchInfo(this.touch.getID(),t,e)},s.getLocation=functio
n(){return this.touch?
this.touch.getLocation():cc.v2()},s.getLocationInView=function(){return this.touch?
this.touch.getLocationInView():cc.v2()},s.getPreviousLocation=function(){return
this.touch?this.touch.getPreviousLocation():cc.v2()},s.getStartLocation=function()
{return this.touch?this.touch.getStartLocation():cc.v2()},s.getID=function(){return
this.touch?this.touch.getID():null},s.getDelta=function(){return this.touch?
this.touch.getDelta():cc.v2()},s.getDeltaX=function(){return this.touch?
this.touch.getDelta().x:0},s.getDeltaY=function(){return this.touch?
this.touch.getDelta().y:0},s.getLocationX=function(){return this.touch?
this.touch.getLocationX():0},s.getLocationY=function(){return this.touch?
this.touch.getLocationY():0},a.MAX_TOUCHES=5,a.BEGAN=0,a.MOVED=1,a.ENDED=2,a.CANCEL
ED=3;var o=function(t,e)
{cc.Event.call(this,cc.Event.ACCELERATION,e),this.acc=t};n.extend(o,cc.Event);var
l=function(t,e,i)
{cc.Event.call(this,cc.Event.KEYBOARD,i),this.keyCode=t,this.isPressed=e};n.extend(
l,cc.Event),cc.Event.EventMouse=r,cc.Event.EventTouch=a,cc.Event.EventAcceleration=
o,cc.Event.EventKeyboard=l,e.exports=cc.Event}),{"../event/event":133}],127:
[(function(t,e,i){"use strict";var
n=t("../platform/js");cc.EventListener=function(t,e,i)
{this._onEvent=i,this._type=t||0,this._listenerID=e||"",this._registered=!
1,this._fixedPriority=0,this._node=null,this._target=null,this._paused=!
0,this._isEnabled=!
0},cc.EventListener.prototype={constructor:cc.EventListener,_setPaused:function(t)
{this._paused=t},_isPaused:function(){return
this._paused},_setRegistered:function(t)
{this._registered=t},_isRegistered:function(){return
this._registered},_getType:function(){return this._type},_getListenerID:function()
{return this._listenerID},_setFixedPriority:function(t)
{this._fixedPriority=t},_getFixedPriority:function(){return
this._fixedPriority},_setSceneGraphPriority:function(t)
{this._target=t,this._node=t},_getSceneGraphPriority:function(){return
this._node},checkAvailable:function(){return null!==this._onEvent},clone:function()
{return null},setEnabled:function(t){this._isEnabled=t},isEnabled:function(){return
this._isEnabled},retain:function(){},release:function()
{}},cc.EventListener.UNKNOWN=0,cc.EventListener.TOUCH_ONE_BY_ONE=1,cc.EventListener
.TOUCH_ALL_AT_ONCE=2,cc.EventListener.KEYBOARD=3,cc.EventListener.MOUSE=4,cc.EventL
istener.ACCELERATION=6,cc.EventListener.CUSTOM=8;var
r=cc.EventListener.ListenerID={MOUSE:"__cc_mouse",TOUCH_ONE_BY_ONE:"__cc_touch_one_
by_one",TOUCH_ALL_AT_ONCE:"__cc_touch_all_at_once",KEYBOARD:"__cc_keyboard",ACCELER
ATION:"__cc_acceleration"},s=function(t,e)
{this._onCustomEvent=e,cc.EventListener.call(this,cc.EventListener.CUSTOM,t,this._c
allback)};n.extend(s,cc.EventListener),n.mixin(s.prototype,
{_onCustomEvent:null,_callback:function(t){null!
==this._onCustomEvent&&this._onCustomEvent(t)},checkAvailable:function(){return
cc.EventListener.prototype.checkAvailable.call(this)&&null!
==this._onCustomEvent},clone:function(){return new
s(this._listenerID,this._onCustomEvent)}});var a=function()
{cc.EventListener.call(this,cc.EventListener.MOUSE,r.MOUSE,this._callback)};n.exten
d(a,cc.EventListener),n.mixin(a.prototype,
{onMouseDown:null,onMouseUp:null,onMouseMove:null,onMouseScroll:null,_callback:func
tion(t){var e=cc.Event.EventMouse;switch(t._eventType){case
e.DOWN:this.onMouseDown&&this.onMouseDown(t);break;case
e.UP:this.onMouseUp&&this.onMouseUp(t);break;case
e.MOVE:this.onMouseMove&&this.onMouseMove(t);break;case
e.SCROLL:this.onMouseScroll&&this.onMouseScroll(t)}},clone:function(){var t=new
a;return
t.onMouseDown=this.onMouseDown,t.onMouseUp=this.onMouseUp,t.onMouseMove=this.onMous
eMove,t.onMouseScroll=this.onMouseScroll,t},checkAvailable:function(){return!
0}});var o=function()
{cc.EventListener.call(this,cc.EventListener.TOUCH_ONE_BY_ONE,r.TOUCH_ONE_BY_ONE,nu
ll),this._claimedTouches=[]};n.extend(o,cc.EventListener),n.mixin(o.prototype,
{constructor:o,_claimedTouches:null,swallowTouches:!
1,onTouchBegan:null,onTouchMoved:null,onTouchEnded:null,onTouchCancelled:null,setSw
allowTouches:function(t){this.swallowTouches=t},isSwallowTouches:function(){return
this.swallowTouches},clone:function(){var t=new o;return
t.onTouchBegan=this.onTouchBegan,t.onTouchMoved=this.onTouchMoved,t.onTouchEnded=th
is.onTouchEnded,t.onTouchCancelled=this.onTouchCancelled,t.swallowTouches=this.swal
lowTouches,t},checkAvailable:function(){return!!this.onTouchBegan||
(cc.logID(1801),!1)}});var l=function()
{cc.EventListener.call(this,cc.EventListener.TOUCH_ALL_AT_ONCE,r.TOUCH_ALL_AT_ONCE,
null)};n.extend(l,cc.EventListener),n.mixin(l.prototype,
{constructor:l,onTouchesBegan:null,onTouchesMoved:null,onTouchesEnded:null,onTouche
sCancelled:null,clone:function(){var t=new l;return
t.onTouchesBegan=this.onTouchesBegan,t.onTouchesMoved=this.onTouchesMoved,t.onTouch
esEnded=this.onTouchesEnded,t.onTouchesCancelled=this.onTouchesCancelled,t},checkAv
ailable:function(){return null!==this.onTouchesBegan||null!==this.onTouchesMoved||
null!==this.onTouchesEnded||null!==this.onTouchesCancelled||(cc.logID(1802),!
1)}});var h=function(t)
{this._onAccelerationEvent=t,cc.EventListener.call(this,cc.EventListener.ACCELERATI
ON,r.ACCELERATION,this._callback)};n.extend(h,cc.EventListener),n.mixin(h.prototype
,{constructor:h,_onAccelerationEvent:null,_callback:function(t)
{this._onAccelerationEvent(t.acc,t)},checkAvailable:function(){return
cc.assertID(this._onAccelerationEvent,1803),!0},clone:function(){return new
h(this._onAccelerationEvent)}});var c=function()
{cc.EventListener.call(this,cc.EventListener.KEYBOARD,r.KEYBOARD,this._callback)};n
.extend(c,cc.EventListener),n.mixin(c.prototype,
{constructor:c,onKeyPressed:null,onKeyReleased:null,_callback:function(t)
{t.isPressed?
this.onKeyPressed&&this.onKeyPressed(t.keyCode,t):this.onKeyReleased&&this.onKeyRel
eased(t.keyCode,t)},clone:function(){var t=new c;return
t.onKeyPressed=this.onKeyPressed,t.onKeyReleased=this.onKeyReleased,t},checkAvailab
le:function(){return null!==this.onKeyPressed||null!==this.onKeyReleased||
(cc.logID(1800),!1)}}),cc.EventListener.create=function(t)
{cc.assertID(t&&t.event,1900);var e=t.event;delete t.event;var i=null;for(var n in
e===cc.EventListener.TOUCH_ONE_BY_ONE?i=new
o:e===cc.EventListener.TOUCH_ALL_AT_ONCE?i=new l:e===cc.EventListener.MOUSE?i=new
a:e===cc.EventListener.CUSTOM?(i=new s(t.eventName,t.callback),delete
t.eventName,delete t.callback):e===cc.EventListener.KEYBOARD?i=new
c:e===cc.EventListener.ACCELERATION&&(i=new h(t.callback),delete
t.callback),t)i[n]=t[n];return i},e.exports=cc.EventListener}),
{"../platform/js":220}],128:[(function(t,e,i){"use strict";var
n=t("../platform/js");t("./CCEventListener");var
r=cc.EventListener.ListenerID,s=function()
{this._fixedListeners=[],this._sceneGraphListeners=[],this.gt0Index=0};s.prototype=
{constructor:s,size:function(){return
this._fixedListeners.length+this._sceneGraphListeners.length},empty:function()
{return
0===this._fixedListeners.length&&0===this._sceneGraphListeners.length},push:functio
n(t){0===t._getFixedPriority()?
this._sceneGraphListeners.push(t):this._fixedListeners.push(t)},clearSceneGraphList
eners:function(){this._sceneGraphListeners.length=0},clearFixedListeners:function()
{this._fixedListeners.length=0},clear:function()
{this._sceneGraphListeners.length=0,this._fixedListeners.length=0},getFixedPriority
Listeners:function(){return
this._fixedListeners},getSceneGraphPriorityListeners:function(){return
this._sceneGraphListeners}};var a=function(t){var e=cc.Event,i=t.type;return
i===e.ACCELERATION?r.ACCELERATION:i===e.KEYBOARD?r.KEYBOARD:i.startsWith(e.MOUSE)?
r.MOUSE:
(i.startsWith(e.TOUCH)&&cc.logID(2e3),"")},o={DIRTY_NONE:0,DIRTY_FIXED_PRIORITY:1,D
IRTY_SCENE_GRAPH_PRIORITY:2,DIRTY_ALL:3,_listenersMap:{},_priorityDirtyFlagMap:
{},_nodeListenersMap:{},_nodePriorityMap:n.createMap(!0),_globalZOrderNodeMap:
[],_toAddedListeners:[],_toRemovedListeners:[],_dirtyNodes:
[],_inDispatch:0,_isEnabled:!1,_nodePriorityIndex:0,_internalCus
tomListenerIDs:[],_setDirtyForNode:function(t){if(void 0!
==this._nodeListenersMap[t._id]&&this._dirtyNodes.push(t),t.getChildren)for(var
e=t.getChildren(),i=0,n=e?e.length:0;i<n;i+
+)this._setDirtyForNode(e[i])},pauseTarget:function(t,e){if(t instanceof
cc._BaseNode){var
i,n,r=this._nodeListenersMap[t._id];if(r)for(i=0,n=r.length;i<n;i+
+)r[i]._setPaused(!0);if(!0===e){var s=t.getChildren();for(i=0,n=s?
s.length:0;i<n;i++)this.pauseTarget(s[i],!0)}}else
cc.warnID(3506)},resumeTarget:function(t,e){if(t instanceof cc._BaseNode){var
i,n,r=this._nodeListenersMap[t._id];if(r)for(i=0,n=r.length;i<n;i+
+)r[i]._setPaused(!1);if(this._setDirtyForNode(t),!0===e&&t.getChildren){var
s=t.getChildren();for(i=0,n=s?s.length:0;i<n;i++)this.resumeTarget(s[i],!0)}}else
cc.warnID(3506)},_addListener:function(t){0===this._inDispatch?
this._forceAddEventListener(t):this._toAddedListeners.push(t)},_forceAddEventListen
er:function(t){var e=t._getListenerID(),i=this._listenersMap[e];if(i||(i=new
s,this._listenersMap[e]=i),i.push(t),0===t._getFixedPriority())
{this._setDirty(e,this.DIRTY_SCENE_GRAPH_PRIORITY);var
n=t._getSceneGraphPriority();null===n&&cc.logID(3507),this._associateNodeAndEventLi
stener(n,t),n.activeInHierarchy&&this.resumeTarget(n)}else
this._setDirty(e,this.DIRTY_FIXED_PRIORITY)},_getListeners:function(t){return
this._listenersMap[t]},_updateDirtyFlagForSceneGraph:function(){if(0!
==this._dirtyNodes.length){for(var
t,e,i=this._dirtyNodes,n=this._nodeListenersMap,r=0,s=i.length;r<s;r+
+)if(t=n[i[r]._id])for(var a=0,o=t.length;a<o;a++)
(e=t[a])&&this._setDirty(e._getListenerID(),this.DIRTY_SCENE_GRAPH_PRIORITY);this._
dirtyNodes.length=0}},_removeAllListenersInVector:function(t){if(t)for(var
e,i=0;i<t.length;)(e=t[i])._setRegistered(!1),null!
=e._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(e._getSceneGraph
Priority(),e),e._setSceneGraphPriority(null)),0===this._inDispatch?
cc.js.array.remove(t,e):++i},_removeListenersForListenerID:function(t){var
e,i=this._listenersMap[t];if(i){var
n=i.getFixedPriorityListeners(),r=i.getSceneGraphPriorityListeners();this._removeAl
lListenersInVector(r),this._removeAllListenersInVector(n),delete
this._priorityDirtyFlagMap[t],this._inDispatch||(i.clear(),delete
this._listenersMap[t])}var s,a=this._toAddedListeners;for(e=0;e<a.length;)
(s=a[e])&&s._getListenerID()===t?cc.js.array.remove(a,s):+
+e},_sortEventListeners:function(t){var
e=this.DIRTY_NONE,i=this._priorityDirtyFlagMap;if(i[t]&&(e=i[t]),e!
==this.DIRTY_NONE&&(i[t]=this.DIRTY_NONE,e&this.DIRTY_FIXED_PRIORITY&&this._sortLis
tenersOfFixedPriority(t),e&this.DIRTY_SCENE_GRAPH_PRIORITY)){var
n=cc.director.getScene();n&&this._sortListenersOfSceneGraphPriority(t,n)}},_sortLis
tenersOfSceneGraphPriority:function(t,e){var i=this._getListeners(t);if(i){var
r=i.getSceneGraphPriorityListeners();r&&0!
==r.length&&(this._nodePriorityIndex=0,this._nodePriorityMap=n.createMap(!
0),this._visitTarget(e,!
0),i.getSceneGraphPriorityListeners().sort(this._sortEventListenersOfSceneGraphPrio
rityDes))}},_sortEventListenersOfSceneGraphPriorityDes:function(t,e){var
i=o._nodePriorityMap,n=t._getSceneGraphPriority(),r=e._getSceneGraphPriority();retu
rn e&&r&&i[r._id]?t&&n&&i[n._id]?i[r._id]-i[n._id]:1:-
1},_sortListenersOfFixedPriority:function(t){var e=this._listenersMap[t];if(e){var
i=e.getFixedPriorityListeners();if(i&&0!==i.length)
{i.sort(this._sortListenersOfFixedPriorityAsc);for(var n=0,r=i.length;n<r&&!
(i[n]._getFixedPriority()>=0);)+
+n;e.gt0Index=n}}},_sortListenersOfFixedPriorityAsc:function(t,e){return
t._getFixedPriority()-e._getFixedPriority()},_onUpdateListeners:function(t){var
e,i,n,r=t.getFixedPriorityListeners(),s=t.getSceneGraphPriorityListeners(),a=this._
toRemovedListeners;if(s)for(e=0;e<s.length;)(i=s[e])._isRegistered()?++e:
(cc.js.array.remove(s,i),-1!
==(n=a.indexOf(i))&&a.splice(n,1));if(r)for(e=0;e<r.length;)
(i=r[e])._isRegistered()?++e:(cc.js.array.remove(r,i),-1!
==(n=a.indexOf(i))&&a.splice(n,1));s&&0===s.length&&t.clearSceneGraphListeners(),r&
&0===r.length&&t.clearFixedListeners()},frameUpdateListeners:function(){var
t=this._listenersMap,e=this._priorityDirtyFlagMap;for(var i in
t)t[i].empty()&&(delete e[i],delete t[i]);var n=this._toAddedListeners;if(0!
==n.length){for(var r=0,s=n.length;r<s;r+
+)this._forceAddEventListener(n[r]);n.length=0}0!
==this._toRemovedListeners.length&&this._cleanToRemovedListeners()},_updateTouchLis
teners:function(t){var e=this._inDispatch;if(cc.assertID(e>0,3508),!(e>1)){var i;
(i=this._listenersMap[r.TOUCH_ONE_BY_ONE])&&this._onUpdateListeners(i),
(i=this._listenersMap[r.TOUCH_ALL_AT_ONCE])&&this._onUpdateListeners(i),cc.assertID
(1===e,3509);var n=this._toAddedListeners;if(0!==n.length){for(var
s=0,a=n.length;s<a;s+
+)this._forceAddEventListener(n[s]);this._toAddedListeners.length=0}0!
==this._toRemovedListeners.length&&this._cleanToRemovedListeners()}},_cleanToRemove
dListeners:function(){for(var t=this._toRemovedListeners,e=0;e<t.length;e++){var
i=t[e],n=this._listenersMap[i._getListenerID()];if(n){var
r,s=n.getFixedPriorityListeners(),a=n.getSceneGraphPriorityListeners();a&&-1!
==(r=a.indexOf(i))&&a.splice(r,1),s&&-1!
==(r=s.indexOf(i))&&s.splice(r,1)}}t.length=0},_onTouchEventCallback:function(t,e)
{if(!t._isRegistered())return!1;var
i=e.event,n=i.currentTouch;i.currentTarget=t._node;var r,s=!
1,a=i.getEventCode(),l=cc.Event.EventTouch;return a===l.BEGAN?
t.onTouchBegan&&(s=t.onTouchBegan(n,i))&&t._registered&&t._claimedTouches.push(n):t
._claimedTouches.length>0&&-1!==(r=t._claimedTouches.indexOf(n))&&(s=!
0,a===l.MOVED&&t.onTouchMoved?t.onTouchMoved(n,i):a===l.ENDED?
(t.onTouchEnded&&t.onTouchEnded(n,i),t._registered&&t._claimedTouches.splice(r,1)):
a===l.CANCELLED&&(t.onTouchCancelled&&t.onTouchCancelled(n,i),t._registered&&t._cla
imedTouches.splice(r,1))),i.isStopped()?(o._updateTouchListeners(i),!0):!(!s||!
t.swallowTouches)&&(e.needsMutableSet&&e.touches.splice(n,1),!
0)},_dispatchTouchEvent:function(t)
{this._sortEventListeners(r.TOUCH_ONE_BY_ONE),this._sortEventListeners(r.TOUCH_ALL_
AT_ONCE);var
e=this._getListeners(r.TOUCH_ONE_BY_ONE),i=this._getListeners(r.TOUCH_ALL_AT_ONCE);
if(null!==e||null!==i){var
n=t.getTouches(),s=cc.js.array.copy(n),a={event:t,needsMutableSet:e&&i,touches:s,se
lTouch:null};if(e)for(var o=0;o<n.length;o+
+)t.currentTouch=n[o],t._propagationStopped=t._propagationImmediateStopped=!
1,this._dispatchEventToListeners(e,this._onTouchEventCallback,a);i&&s.length>0&&(th
is._dispatchEventToListeners(i,this._onTouchesEventCallback,
{event:t,touches:s}),t.isStopped())||
this._updateTouchListeners(t)}},_onTouchesEventCallback:function(t,e){if(!
t._registered)return!1;var
i=cc.Event.EventTouch,n=e.event,r=e.touches,s=n.getEventCode();return
n.currentTarget=t._node,s===i.BEGAN&&t.onTouchesBegan?
t.onTouchesBegan(r,n):s===i.MOVED&&t.onTouchesMoved?
t.onTouchesMoved(r,n):s===i.ENDED&&t.onTouchesEnded?
t.onTouchesEnded(r,n):s===i.CANCELLED&&t.onTouchesCancelled&&t.onTouchesCancelled(r
,n),!!n.isStopped()&&(o._updateTouchListeners(n),!
0)},_associateNodeAndEventListener:function(t,e){var
i=this._nodeListenersMap[t._id];i||
(i=[],this._nodeListenersMap[t._id]=i),i.push(e)},_dissociateNodeAndEventListener:f
unction(t,e){var
i=this._nodeListenersMap[t._id];i&&(cc.js.array.remove(i,e),0===i.length&&delete
this._nodeListenersMap[t._id])},_dispatchEventToListeners:function(t,e,i){var
n,r,s=!
1,a=t.getFixedPriorityListeners(),o=t.getSceneGraphPriorityListeners(),l=0;if(a&&0!
==a.length)for(;l<t.gt0Index;++l)if((r=a[l]).isEnabled()&&!
r._isPaused()&&r._isRegistered()&&e(r,i)){s=!0;break}if(o&&!s)for(n=0;n<o.length;n+
+)if((r=o[n]).isEnabled()&&!r._isPaused()&&r._isRegistered()&&e(r,i)){s=!
0;break}if(a&&!s)for(;l<a.length;++l)if((r=a[l]).isEnabled()&&!
r._isPaused()&&r._isRegistered()&&e(r,i)){s=!0;break}},_setDirty:function(t,e){var
i=this._priorityDirtyFlagMap;null==i[t]?i[t]=e:i[t]=e|
i[t]},_visitTarget:function(t,e){t._reorderChildDirty&&t.sortAllChildren();var
i,n=t.getChildren(),r=0,s=n.length,a=this._globalZOrderNodeMap,o=this._nodeListener
sMap;if(s>0)for(void 0!==o[t._id]&&(a||(a=[]),a.push(t._id));r<s;r++)
(i=n[r])&&this._visitTarget(i,!1);else void 0!==o[t._id]&&(a||
(a=[]),a.push(t._id));if(e){for(var l=this._nodePriorityMap,h=0;h<a.length;h+
+)l[a[h]]=+
+this._nodePriorityIndex;this._globalZOrderNodeMap.length=0}},_sortNumberAsc:functi
on(t,e){return t-e},hasEventListener:function(t){return!!
this._getListeners(t)},addListener:function(t,e)
{if(cc.assertID(t&&e,3503),cc.js.isNumber(e)||e instanceof cc._BaseNode){if(t
instanceof cc.EventListener){if(t._isRegistered())return void cc.logID(3505)}else
cc.assertID(!
cc.js.isNumber(e),3504),t=cc.EventListener.create(t);if(t.checkAvailable())
{if(cc.js.isNumber(e)){if(0===e)return void
cc.logID(3500);t._setSceneGraphPriority(null),t._setFixedPriority(e),t._setRegister
ed(!0),t._setPaused(!1),this._addListener(t)}else
t._setSceneGraphPriority(e),t._setFixedPriority(0),t._setRegistered(!
0),this._addListener(t);return t}}else
cc.warnID(3506)},addCustomListener:function(t,e){var i=new
cc.EventListener.create({event:cc.EventListener.CUSTOM,eventName:t,callback:e});ret
urn this.addListener(i,1),i},removeListener:function(t){if(null!=t){var
e,i=this._listenersMap;for(var n in i){var
r=i[n],s=r.getFixedPriorityListeners(),a=r.getSceneGraphPriorityListeners();if((e=t
his._removeListenerInVector(a,t))?
this._setDirty(t._getListenerID(),this.DIRTY_SCENE_GRAPH_PRIORITY):
(e=this._removeListenerInVector(s,t))&&this._setDirty(t._getListenerID(),this.DIRTY
_FIXED_PRIORITY),r.empty()&&(delete
this._priorityDirtyFlagMap[t._getListenerID()],delete i[n]),e)break}if(!e)for(var
o=this._toAddedListeners,l=0,h=o.length;l<h;l++){var c=o[l];if(c===t)
{cc.js.array.remove(o,c),c._setRegistered(!
1);break}}}},_removeListenerInCallback:function(t,e){if(null==t)return!1;for(var
i=0,n=t.length;i<n;i++){var r=t[i];if(r._onCustomEvent===e||r._onEvent===e)return
r._setRegistered(!1),null!
=r._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(r._getSceneGraph
Priority(),r),r._setSceneGraphPriority(null)),0===this._inDispatc
h?cc.js.array.remove(t,r):this._toRemovedListeners.push(r),!0}return!
1},_removeListenerInVector:function(t,e){if(null==t)return!1;for(var
i=0,n=t.length;i<n;i++){var r=t[i];if(r===e)return r._setRegistered(!1),null!
=r._getSceneGraphPriority()&&(this._dissociateNodeAndEventListener(r._getSceneGraph
Priority(),r),r._setSceneGraphPriority(null)),0===this._inDispatch?
cc.js.array.remove(t,r):this._toRemovedListeners.push(r),!0}return!
1},removeListeners:function(t,e){var i=this;if(cc.js.isNumber(t)||t instanceof
cc._BaseNode)if(void 0!==t._id){delete
i._nodePriorityMap[t._id],cc.js.array.remove(i._dirtyNodes,t);var
n,s=i._nodeListenersMap[t._id];if(s){var
a=cc.js.array.copy(s);for(n=0;n<a.length;n++)i.removeListener(a[n]);delete
i._nodeListenersMap[t._id]}var o=i._toAddedListeners;for(n=0;n<o.length;){var
l=o[n];l._getSceneGraphPriority()===t?
(l._setSceneGraphPriority(null),l._setRegistered(!1),o.splice(n,1)):++n}if(!0===e)
{var h,c=t.getChildren();for(n=0,h=c.length;n<h;n++)i.removeListeners(c[n],!
0)}}else t===cc.EventListener.TOUCH_ONE_BY_ONE?
i._removeListenersForListenerID(r.TOUCH_ONE_BY_ONE):t===cc.EventListener.TOUCH_ALL_
AT_ONCE?
i._removeListenersForListenerID(r.TOUCH_ALL_AT_ONCE):t===cc.EventListener.MOUSE?
i._removeListenersForListenerID(r.MOUSE):t===cc.EventListener.ACCELERATION?
i._removeListenersForListenerID(r.ACCELERATION):t===cc.EventListener.KEYBOARD?
i._removeListenersForListenerID(r.KEYBOARD):cc.logID(3501);else
cc.warnID(3506)},removeCustomListeners:function(t)
{this._removeListenersForListenerID(t)},removeAllListeners:function(){var
t=this._listenersMap,e=this._internalCustomListenerIDs;for(var i in t)-
1===e.indexOf(i)&&this._removeListenersForListenerID(i)},setPriority:function(t,e)
{if(null!=t){var i=this._listenersMap;for(var n in i){var
r=i[n].getFixedPriorityListeners();if(r)if(-1!==r.indexOf(t))return null!
=t._getSceneGraphPriority()&&cc.logID(3502),void(t._getFixedPriority()!
==e&&(t._setFixedPriority(e),this._setDirty(t._getListenerID(),this.DIRTY_FIXED_PRI
ORITY)))}}},setEnabled:function(t){this._isEnabled=t},isEnabled:function(){return
this._isEnabled},dispatchEvent:function(t)
{if(this._isEnabled)if(this._updateDirtyFlagForSceneGraph(),this._inDispatch+
+,t&&t.getType){if(t.getType().startsWith(cc.Event.TOUCH))return
this._dispatchTouchEvent(t),void this._inDispatch--;var
e=a(t);this._sortEventListeners(e);var i=this._listenersMap[e];null!
=i&&(this._dispatchEventToListeners(i,this._onListenerCallback,t),this._onUpdateLis
teners(i)),this._inDispatch--}else
cc.errorID(3511)},_onListenerCallback:function(t,e){return
e.currentTarget=t._target,t._onEvent(e),e.isStopped()},dispatchCustomEvent:function
(t,e){var i=new
cc.Event.EventCustom(t);i.setUserData(e),this.dispatchEvent(i)}};n.get(cc,"eventMan
ager",(function(){return cc.warnID(1405,"cc.eventManager","cc.EventTarget or
cc.systemEvent"),o})),e.exports=o}),
{"../platform/js":220,"./CCEventListener":127}],129:[(function(t,e,i){"use
strict";cc.Touch=function(t,e,i)
{this._lastModified=0,this.setTouchInfo(i,t,e)},cc.Touch.prototype={constructor:cc.
Touch,getLocation:function(){return
cc.v2(this._point.x,this._point.y)},getLocationX:function(){return
this._point.x},getLocationY:function(){return
this._point.y},getPreviousLocation:function(){return
cc.v2(this._prevPoint.x,this._prevPoint.y)},getStartLocation:function(){return
cc.v2(this._startPoint.x,this._startPoint.y)},getDelta:function(){return
this._point.sub(this._prevPoint)},getLocationInView:function(){return
cc.v2(this._point.x,cc.view._designResolutionSize.height-
this._point.y)},getPreviousLocationInView:function(){return
cc.v2(this._prevPoint.x,cc.view._designResolutionSize.height-
this._prevPoint.y)},getStartLocationInView:function(){return
cc.v2(this._startPoint.x,cc.view._designResolutionSize.height-
this._startPoint.y)},getID:function(){return this._id},setTouchInfo:function(t,e,i)
{this._prevPoint=this._point,this._point=cc.v2(e||0,i||
0),this._id=t,this._startPointCaptured||
(this._startPoint=cc.v2(this._point),cc.view._convertPointWithScale(this._startPoin
t),this._startPointCaptured=!0)},_setPoint:function(t,e){void 0===e?
(this._point.x=t.x,this._point.y=t.y):
(this._point.x=t,this._point.y=e)},_setPrevPoint:function(t,e){this._prevPoint=void
0===e?cc.v2(t.x,t.y):cc.v2(t||0,e||0)}}}),{}],130:[(function(t,e,i){"use
strict";t("./CCEvent"),t("./CCTouch"),t("./CCEventListener");var
n=t("./CCEventManager");e.exports=n}),
{"./CCEvent":126,"./CCEventListener":127,"./CCEventManager":128,"./CCTouch":129}],1
31:[(function(t,e,i){"use strict";var n=cc.js,r=t("../platform/callbacks-
invoker").CallbacksHandler;function s()
{r.call(this)}n.extend(s,r),s.prototype.invoke=function(t,e){var
i=t.type,n=this._callbackTable[i];if(n){var r=!n.isInvoking;n.isInvoking=!0;for(var
s=n.callbacks,a=n.targets,o=0,l=s.length;o<l;++o){var h=s[o];if(h){var c=a[o]||
t.currentTarget;if(h.call(c,t,e),t._propagationImmediateStopped)break}}r&&(n.isInvo
king=!1,n.containCanceled&&n.purgeCanceled())}},e.exports=s}),
{"../platform/callbacks-invoker":213}],132:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../platform/callbacks-
invoker"),s=n.array.fastRemove;function a(){r.call(this)}n.extend(a,r);var
o=a.prototype;o.on=function(t,e,i){if(e)return this.hasEventListener(t,e,i)||
(this.add(t,e,i),i&&i.__eventTargets&&i.__eventTargets.push(this)),e;cc.errorID(680
0)},o.off=function(t,e,i){e?
(this.remove(t,e,i),i&&i.__eventTargets&&s(i.__eventTargets,this)):this.removeAll(t
)},o.targetOff=o.removeAll,o.once=function(t,e,i){var n="__ONCE_FLAG:"+t;if(!
this.hasEventListener(n,e,i)){var r=this;this.on(t,(function s(a,o,l,h,c)
{r.off(t,s,i),r.remove(n,e,i),e.call(this,a,o,l,h,c)}),i),this.add(n,e,i)}},o.emit=
r.prototype.invoke,o.dispatchEvent=function(t)
{this.invoke(t.type,t)},cc.EventTarget=e.exports=a}),{"../platform/callbacks-
invoker":213,"../platform/js":220}],133:[(function(t,e,i){"use strict";var
n=t("../platform/js");cc.Event=function(t,e){this.type=t,this.bubbles=!!
e,this.target=null,this.currentTarget=null,this.eventPhase=0,this._propagationStopp
ed=!1,this._propagationImmediateStopped=!
1},cc.Event.prototype={constructor:cc.Event,unuse:function()
{this.type=cc.Event.NO_TYPE,this.target=null,this.currentTarget=null,this.eventPhas
e=cc.Event.NONE,this._propagationStopped=!1,this._propagationImmediateStopped=!
1},reuse:function(t,e){this.type=t,this.bubbles=e||!1},stopPropagation:function()
{this._propagationStopped=!0},stopPropagationImmediate:function()
{this._propagationImmediateStopped=!0},isStopped:function(){return
this._propagationStopped||
this._propagationImmediateStopped},getCurrentTarget:function(){return
this.currentTarget},getType:function(){return
this.type}},cc.Event.NO_TYPE="no_type",cc.Event.TOUCH="touch",cc.Event.MOUSE="mouse
",cc.Event.KEYBOARD="keyboard",cc.Event.ACCELERATION="acceleration",cc.Event.NONE=0
,cc.Event.CAPTURING_PHASE=1,cc.Event.AT_TARGET=2,cc.Event.BUBBLING_PHASE=3;var
r=function(t,e)
{cc.Event.call(this,t,e),this.detail=null};n.extend(r,cc.Event),r.prototype.reset=r
,r.prototype.setUserData=function(t)
{this.detail=t},r.prototype.getUserData=function(){return
this.detail},r.prototype.getEventName=cc.Event.prototype.getType;var s=new
n.Pool(10);r.put=function(t){s.put(t)},r.get=function(t,e){var i=s._get();return i?
i.reset(t,e):i=new r(t,e),i},cc.Event.EventCustom=r,e.exports=cc.Event}),
{"../platform/js":220}],134:[(function(t,e,i){"use strict";t("./event"),t("./event-
listeners"),t("./event-target"),t("./system-event")}),{"./event":133,"./event-
listeners":131,"./event-target":132,"./system-event":135}],135:[(function(t,e,i)
{"use strict";var n=t("../event/event-target"),r=t("../event-
manager"),s=t("../platform/CCInputManager"),a=cc.Enum({KEY_DOWN:"keydown",KEY_UP:"k
eyup",DEVICEMOTION:"devicemotion"}),o=null,l=null,h=cc.Class({name:"SystemEvent",ex
tends:n,statics:{EventType:a},setAccelerometerEnabled:function(t)
{s.setAccelerometerEnabled(t)},setAccelerometerInterval:function(t)
{s.setAccelerometerInterval(t)},on:function(t,e,i){this._super(t,e,i),t!
==a.KEY_DOWN&&t!==a.KEY_UP||(o||
(o=cc.EventListener.create({event:cc.EventListener.KEYBOARD,onKeyPressed:function(t
,e){e.type=a.KEY_DOWN,cc.systemEvent.dispatchEvent(e)},onKeyReleased:function(t,e)
{e.type=a.KEY_UP,cc.systemEvent.dispatchEvent(e)}})),r.hasEventListener(cc.EventLis
tener.ListenerID.KEYBOARD)||r.addListener(o,1)),t===a.DEVICEMOTION&&(l||
(l=cc.EventListener.create({event:cc.EventListener.ACCELERATION,callback:function(t
,e)
{e.type=a.DEVICEMOTION,cc.systemEvent.dispatchEvent(e)}})),r.hasEventListener(cc.Ev
entListener.ListenerID.ACCELERATION)||r.addListener(l,1))},off:function(t,e,i)
{if(this._super(t,e,i),o&&(t===a.KEY_DOWN||t===a.KEY_UP)){var
n=this.hasEventListener(a.KEY_DOWN),s=this.hasEventListener(a.KEY_UP);n||s||
r.removeListener(o)}l&&t===a.DEVICEMOTION&&r.removeListener(l)}});cc.SystemEvent=e.
exports=h,cc.systemEvent=new cc.SystemEvent}),{"../event-
manager":130,"../event/event-target":132,"../platform/CCInputManager":204}],136:
[(function(t,e,i){"use strict";var
n=cc.vmath.vec3,r=cc.vmath.mat3,s=n.create(),a=n.create(),o=r.create(),l=function(t
,e,i)
{o.m00=Math.abs(i.m00),o.m01=Math.abs(i.m01),o.m02=Math.abs(i.m02),o.m03=Math.abs(i
.m04),o.m04=Math.abs(i.m05),o.m05=Math.abs(i.m06),o.m06=Math.abs(i.m08),o.m07=Math.
abs(i.m09),o.m08=Math.abs(i.m10),n.transformMat3(t,e,o)};function h(t,e,i,r,s,a)
{this.center=n.create(t,e,i),this.halfExtents=n.create(r,s,a)}var
c=h.prototype;c.getBoundary=function(t,e)
{n.sub(t,this.center,this.halfExtents),n.add(e,this.center,this.halfExtents)},c.tra
nsform=function(t,e,i,r,s){s||
(s=this),n.transformMat4(s.center,this.center,t),l(s.halfExtents,this.halfExtents,t
)},h.create=function(t,e,i,n,r,s){return new h(t,e,i,n,r,s)},h.clone=function(t)
{return new
h(t.center.x,t.center.y,t.center.z,t.halfExtents.x,t.halfExtents.y,t.halfExtents.z)
},h.copy=function(t,e){return
n.copy(t.center,e.center),n.copy(t.halfExtents,e.halfExtents),t},h.fromPoints=funct
ion(t,e,i){return

n.scale(t.center,n.add(s,e,i),.5),n.scale(t.halfExtents,n.sub(a,i,e),.5),t},h.set=f
unction(t,e,i,r,s,a,o){return
n.set(t.center,e,i,r),n.set(t.halfExtents,s,a,o),t},e.exports=h}),{}],137:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),cc.geomUtils={Triangle:t("./triangle"),Aabb:t("./aabb"),Ray:t("./ray"),intersec
t:t("./intersect")},i.default=cc.geomUtils,e.exports=i.default}),
{"./aabb":136,"./intersect":138,"./ray":139,"./triangle":140}],138:
[(function(t,e,i){"use strict";var
n=s(t("../../renderer/gfx")),r=s(t("../../renderer/memop/recycle-pool"));function
s(t){return t&&t.__esModule?t:{default:t}}var
a=t("./aabb"),o=t("./ray"),l=t("./triangle"),h=cc.vmath.mat4,c=cc.vmath.vec3,u={};u
.rayAabb=(function(){var t=c.create(),e=c.create();return function(i,n){var
r=i.o,s=i.d,a=1/s.x,o=1/s.y,l=1/s.z;c.sub(t,n.center,n.halfExtents),c.add(e,n.cente
r,n.halfExtents);var h=(t.x-r.x)*a,u=(e.x-r.x)*a,_=(t.y-r.y)*o,f=(e.y-
r.y)*o,d=(t.z-r.z)*l,m=(e.z-
r.z)*l,p=Math.max(Math.max(Math.min(h,u),Math.min(_,f)),Math.min(d,m)),v=Math.min(M
ath.min(Math.max(h,u),Math.max(_,f)),Math.max(d,m));return v<0||p>v?0:p}})
(),u.rayTriangle=(function(){var
t=c.create(0,0,0),e=c.create(0,0,0),i=c.create(0,0,0),n=c.create(0,0,0),r=c.create(
0,0,0);return function(s,a){c.sub(t,a.b,a.a),c.sub(e,a.c,a.a),c.cross(i,s.d,e);var
o=c.dot(t,i);if(o<=0)return 0;c.sub(n,s.o,a.a);var l=c.dot(n,i);if(l<0||l>o)return
0;c.cross(r,n,t);var h=c.dot(s.d,r);if(h<0||l+h>o)return 0;var
u=c.dot(e,r)/o;return u<0?0:u}})(),u.rayMesh=(function(){var
t=l.create(),e=1/0,i={5120:"getInt8",5121:"getUint8",5122:"getInt16",5123:"getUint1
6",5124:"getInt32",5125:"getUint32",5126:"getFloat32"},r=(function(){var t=new
ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256===new Int16Array(t)
[0]})();function s(t,e,i,n,s){c.set(t,e[i](s,r),e[i](s+=n,r),e[i](s+=n,r))}return
function(r,a){e=1/0;for(var o=a._subMeshes,l=0;l<o.length;l+
+)if(o[l]._primitiveType===n.default.PT_TRIANGLES)for(var h=a._vbs[l]||
a._vbs[0],c=h.data,_=new
DataView(c.buffer,c.byteOffset,c.byteLength),f=a._ibs[l].data,d=h.buffer._format.el
ement(n.default.ATTR_POSITION),m=d.offset,p=d.stride,v=i[d.type],y=0;y<f.length;y+=
3){s(t.a,_,v,4,f[y]*p+m),s(t.b,_,v,4,f[y+1]*p+m),s(t.c,_,v,4,f[y+2]*p+m);var
g=u.rayTriangle(r,t);g>0&&g<e&&(e=g)}return e}})(),u.raycast=(function(){function
t(e,i){for(var n=e.children,r=n.length-1;r>=0;r--){t(n[r],i)}i(e)}function e(t,e)
{return t.distance-e.distance}function i(t,e,i){var
n=e.x,r=e.y,s=e.z,a=i.m03*n+i.m07*r+i.m11*s;return a=a?
1/a:1,t.x=(i.m00*n+i.m04*r+i.m08*s)*a,t.y=(i.m01*n+i.m05*r+i.m09*s)*a,t.z=(i.m02*n+
i.m06*r+i.m10*s)*a,t}var n=new r.default(function()
{return{distance:0,node:null}},1),s=[],l=a.create(),_=c.create(),f=c.create(),d=o.c
reate(),m=h.create(),p=h.create(),v=c.create();function y(t){return
t>0&&t<1/0}return function(r,o,g,x){return n.reset(),s.length=0,t(r=r||
cc.director.getScene(),(function(t){if(!x||x(t))
{h.invert(p,t.getWorldMatrix(m)),c.transformMat4(d.o,o.o,p),c.normalize(d.d,i(d.d,o
.d,p));var e=1/0,r=t._renderComponent;if(r&&r._boundingBox?
e=u.rayAabb(d,r._boundingBox):t.width&&t.height&&(c.set(_,-t.width*t.anchorX,-
t.height*t.anchorY,t.z),c.set(f,t.width*(1-t.anchorX),t.height*(1-
t.anchorY),t.z),a.fromPoints(l,_,f),e=u.rayAabb(d,l)),y(e)&&(g&&(e=g(d,t,e)),y(e)))
{c.set(v,e,0,0),i(v,v,m);var
b=n.add();b.node=t,b.distance=cc.vmath.vec3.mag(v),s.push(b)}}})),s.sort(e),s}})
(),e.exports=u}),{"../../renderer/gfx":348,"../../renderer/memop/recycle-
pool":363,"./aabb":136,"./ray":139,"./triangle":140}],139:[(function(t,e,i){"use
strict";var n=cc.vmath.vec3;function r(t,e,i,r,s,a)
{this.o=n.create(t,e,i),this.d=n.create(r,s,a)}r.create=function(t,e,i,n,s,a)
{return new r(t,e,i,n,s,a)},r.clone=function(t){return new
r(t.o.x,t.o.y,t.o.z,t.d.x,t.d.y,t.d.z)},r.copy=function(t,e){return
t.o.x=e.o.x,t.o.y=e.o.y,t.o.z=e.o.z,t.d.x=e.d.x,t.d.y=e.d.y,t.d.z=e.d.z,t},r.set=fu
nction(t,e,i,n,r,s,a){return
t.o.x=e,t.o.y=i,t.o.z=n,t.d.x=r,t.d.y=s,t.d.z=a,t},r.fromPoints=function(t,e,i)
{return n.copy(t.o,e),n.normalize(t.d,n.sub(t.d,i,e)),t},e.exports=r}),{}],140:
[(function(t,e,i){"use strict";var n=cc.vmath.vec3;function r(t,e,i,r,s,a,o,l,h)
{this.a=n.create(t,e,i),this.b=n.create(r,s,a),this.c=n.create(o,l,h)}r.create=func
tion(t,e,i,n,s,a,o,l,h){return new r(t,e,i,n,s,a,o,l,h)},r.clone=function(t){return
new r(t.a.x,t.a.y,t.a.z,t.b.x,t.b.y,t.b.z,t.c.x,t.c.y,t.c.z)},r.copy=function(t,e)
{return
n.copy(t.a,e.a),n.copy(t.b,e.b),n.copy(t.c,e.c),t},r.fromPoints=function(t,e,i,r)
{return
n.copy(t.a,e),n.copy(t.b,i),n.copy(t.c,r),t},r.set=function(t,e,i,n,r,s,a,o,l,h)
{return
t.a.x=e,t.a.y=i,t.a.z=n,t.b.x=r,t.b.y=s,t.b.z=a,t.c.x=o,t.c.y=l,t.c.z=h,t},e.export
s=r}),{}],141:[(function(t,e,i){"use strict";var
n=t("../components/CCRenderComponent"),r=t("../assets/material/CCMaterial"),s=t("./
types"),a=s.LineCap,o=s.LineJoin,l=cc.Class({name:"cc.Graphics",extends:n,editor:!
1,ctor:function(){this._impl=l._assembler.createImpl(this)},properties:
{_lineWidth:1,_strokeColor:cc.Color.BLACK,_lineJoin:o.MITER,_lineCap:a.BUTT,_fillCo
lor:cc.Color.WHITE,_miterLimit:10,lineWidth:{get:function(){return
this._lineWidth},set:function(t)
{this._lineWidth=t,this._impl.lineWidth=t}},lineJoin:{get:function(){return
this._lineJoin},set:function(t)
{this._lineJoin=t,this._impl.lineJoin=t},type:o},lineCap:{get:function(){return
this._lineCap},set:function(t)
{this._lineCap=t,this._impl.lineCap=t},type:a},strokeColor:{get:function(){return
this._strokeColor},set:function(t)
{this._impl.strokeColor=this._strokeColor=cc.color(t)}},fillColor:{get:function()
{return this._fillColor},set:function(t)
{this._impl.fillColor=this._fillColor=cc.color(t)}},miterLimit:{get:function()
{return this._miterLimit},set:function(t)
{this._miterLimit=t,this._impl.miterLimit=t}}},statics:
{LineJoin:o,LineCap:a},onRestore:function(){this._impl||
(this._impl=l._assembler.createImpl())},onEnable:function()
{this._super(),this._activateMaterial()},onDestroy:function()
{this._super(),this._impl.clear(this,!
0),this._impl=null},_activateMaterial:function(){if(cc.game.renderType!
==cc.game.RENDER_TYPE_CANVAS)
{if(this.node._renderFlag&=~cc.RenderFlow.FLAG_RENDER,this.node._renderFlag|
=cc.RenderFlow.FLAG_CUSTOM_IA_RENDER,!this.sharedMaterials[0]){var
t=r.getInstantiatedBuiltinMaterial("sprite",this);t.define("_USE_MODEL",!
0),this.setMaterial(0,t)}}else this.disableRender()},moveTo:function(t,e)
{this._impl.moveTo(t,e)},lineTo:function(t,e)
{this._impl.lineTo(t,e)},bezierCurveTo:function(t,e,i,n,r,s)
{this._impl.bezierCurveTo(t,e,i,n,r,s)},quadraticCurveTo:function(t,e,i,n)
{this._impl.quadraticCurveTo(t,e,i,n)},arc:function(t,e,i,n,r,s)
{this._impl.arc(t,e,i,n,r,s)},ellipse:function(t,e,i,n)
{this._impl.ellipse(t,e,i,n)},circle:function(t,e,i)
{this._impl.circle(t,e,i)},rect:function(t,e,i,n)
{this._impl.rect(t,e,i,n)},roundRect:function(t,e,i,n,r)
{this._impl.roundRect(t,e,i,n,r)},fillRect:function(t,e,i,n)
{this.rect(t,e,i,n),this.fill()},clear:function(t)
{this._impl.clear(this,t)},close:function(){this._impl.close()},stroke:function()
{l._assembler.stroke(this)},fill:function()
{l._assembler.fill(this)}});cc.Graphics=e.exports=l}),
{"../assets/material/CCMaterial":75,"../components/CCRenderComponent":106,"./types"
:144}],142:[(function(t,e,i){"use strict";var
n=t("./types").PointFlags,r=Math.PI,s=Math.min,a=Math.max,o=Math.cos,l=Math.sin,h=M
ath.abs,c=Math.sign,u=.5522847493;e.exports={arc:function(t,e,i,n,c,u,_){var
f,d,m,p=0,v=0,y=0,g=0,x=0,b=0,A=0,C=0,S=0,T=0,w=0,E=0,M=0;if(v=u-c,_=_||!
1)if(h(v)>=2*r)v=2*r;else for(;v<0;)v+=2*r;else if(h(v)>=2*r)v=2*-r;else
for(;v>0;)v-=2*r;for(m=0|a(1,s(h(v)/(.5*r)+.5,5)),y=h(4/3*(1-o(f=v/m/2))/l(f)),_||
(y=-y),d=0;d<=m;d++)b=e+(g=o(p=c+v*(d/m)))*n,A=i+(x=l(p))*n,C=-x*n*y,S=g*n*y,0===d?
t.moveTo(b,A):t.bezierCurveTo(T+E,w+M,b-C,A-
S,b,A),T=b,w=A,E=C,M=S},ellipse:function(t,e,i,n,r){t.moveTo(e-
n,i),t.bezierCurveTo(e-n,i+r*u,e-
n*u,i+r,e,i+r),t.bezierCurveTo(e+n*u,i+r,e+n,i+r*u,e+n,i),t.bezierCurveTo(e+n,i-
r*u,e+n*u,i-r,e,i-r),t.bezierCurveTo(e-n*u,i-r,e-n,i-r*u,e-
n,i),t.close()},roundRect:function(t,e,i,n,r,a){if(a<.1)t.rect(e,i,n,r);else{var
o=s(a,.5*h(n))*c(n),l=s(a,.5*h(r))*c(r);t.moveTo(e,i+l),t.lineTo(e,i+r-
l),t.bezierCurveTo(e,i+r-l*(1-u),e+o*(1-u),i+r,e+o,i+r),t.lineTo(e+n-
o,i+r),t.bezierCurveTo(e+n-o*(1-u),i+r,e+n,i+r-l*(1-u),e+n,i+r-
l),t.lineTo(e+n,i+l),t.bezierCurveTo(e+n,i+l*(1-u),e+n-o*(1-u),i,e+n-
o,i),t.lineTo(e+o,i),t.bezierCurveTo(e+o*(1-u),i,e,i+l*(1-
u),e,i+l),t.close()}},tesselateBezier:function t(e,i,r,s,a,o,l,c,u,_,f){var
d,m,p,v,y,g,x,b,A,C,S,T,w,E,M,D;_>10||(y=.5*(o+c),g=.5*(l+u),x=.5*((d=.5*(i+s))+
(p=.5*(s+o))),b=.5*((m=.5*(r+a))+(v=.5*(a+l))),((M=h((s-c)*(E=u-r)-(a-u)*(w=c-i)))+
(D=h((o-c)*E-(l-u)*w)))*(M+D)<e._tessTol*(w*w+E*E)?e._addPoint(c,u,0===f?f|
n.PT_BEVEL:f):(t(e,i,r,d,m,x,b,S=.5*(x+(A=.5*(p+y))),T=.5*(b+
(C=.5*(v+g))),_+1,0),t(e,S,T,A,C,y,g,c,u,_+1,f)))}}}),{"./types":144}],143:
[(function(t,e,i){"use strict";t("./graphics")}),{"./graphics":141}],144:
[(function(t,e,i){"use strict";var
n=cc.Enum({BUTT:0,ROUND:1,SQUARE:2}),r=cc.Enum({BEVEL:0,ROUND:1,MITER:2}),s=cc.Enum
({PT_CORNER:1,PT_LEFT:2,PT_BEVEL:4,PT_INNERBEVEL:8});e.exports={LineCap:n,LineJoin:
r,PointFlags:s}}),{}],145:[(function(t,e,i){"use
strict";t("./platform"),t("./assets"),t("./CCNode"),t("./CCPrivateNode"),t("./CCSce
ne"),t("./components"),t("./graphics"),t("./collider"),t("./collider/CCIntersection
"),t("./physics"),t("./camera/CCCamera"),t("./geom-
utils"),t("./mesh"),t("./3d"),t("./3d/polyfill-3d"),t("./base-
ui/CCWidgetManager")}),{"./3d":29,"./3d/polyfill-
3d":30,"./CCNode":52,"./CCPrivateNode":53,"./CCScene":54,"./assets":74,"./base-
ui/CCWidgetManager":79,"./camera/CCCamera":80,"./collider":88,"./collider/CCInterse
ction":86,"./components":124,"./geom-
utils":137,"./graphics":143,"./mesh":168,"./physics":183,"./platform":217}],146:
[(function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof
Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/js"),s=t("./pipeline"),a=t("./loading-items"),o=t("./asset-
loader"),l=t("./downloader"),h=t("./loader"),c=t("./asset-
table"),u=t("../platform/utils").callInNextTick,_=t("./auto-release-
utils"),f=Object.create(null);f.assets=new c,f.internal=new c;var d={url:null,raw:!
1};function m(t){var e,i,r;if("object"===(void 0===t?"undefined":n(t)))
{if(i=t,t.url)return i;e=t.uuid}else i={},e=t;return
r=i.type?"uuid"===i.type:cc.AssetLibrary._uuidInSettings(e),cc.AssetLibrary._getAss
etInfoInRuntime(e,d),i.url=r?d.url:e,d.url&&"uuid"===i.type&&d.raw?
(i.type=null,i.isRawAsset=!0):r||(i.isRawAsset=!0),i}var p=[],v=[];function y(){var
t=new o,e=new l,i=new h;s.call(this,
[t,e,i]),this.assetLoader=t,this.md5Pipe=null,this.downloader=e,this.loader=i,this.
onProgress=null,this._autoReleaseSetting=r.createMap(!0)}r.extend(y,s);var
g=y.prototype;g.init=function(t){},g.getXMLHttpRequest=function(){return
window.XMLHttpRequest?new window.XMLHttpRequest:new
ActiveXObject("MSXML2.XMLHTTP")},g.addDownloadHandlers=function(t)
{this.downloader.addHandlers(t)},g.addLoadHandlers=function(t)
{this.loader.addHandlers(t)},g.load=function(t,e,i){void
0===i&&(i=e,e=this.onProgress||null);var n,r=this,s=!1;t instanceof Array||(t?(s=!
0,t=[t]):t=[]),p.length=0;for(var o=0;o<t.length;++o){var
l=t[o];if(l&&l.id&&(cc.warnID(4920,l.id),l.uuid||l.url||(l.url=l.id)),
(n=m(l)).url||n.uuid){var h=this._cache[n.url];p.push(h||n)}}var c=a.create(this,e,
(function(t,e){u((function(){if(i){if(s){var
a=n.url;i.call(r,t,e.getContent(a))}else
i.call(r,t,e);i=null}e.destroy()}))}));a.initQueueDeps(c),c.append(p),p.length=0},g
.flowInDeps=function(t,e,i){v.length=0;for(var n=0;n<e.length;++n){var
r=m(e[n]);if(r.url||r.uuid){var s=this._cache[r.url];s?v.push(s):v.push(r)}}var
o=a.create(this,t?function(t,e,i)
{this._ownerQueue&&this._ownerQueue.onProgress&&this._ownerQueue._childOnProgress(i
)}:null,(function(e,n){i(e,n),t&&t.deps&&(t.deps.length=0),n.destroy()}));if(t){var
l=a.getQueue(t);o._ownerQueue=l._ownerQueue||l}var h=o.append(v,t);return
v.length=0,h},g._assetTables=f,g._getResUuid=function(t,e,i,n){var
r=f[i=i||"assets"];if(!t||!r)return null;var s=t.indexOf("?");-1!
==s&&(t=t.substr(0,s));var a=r.getUuid(t,e);if(!a){var
o=cc.path.extname(t);o&&(t=t.slice(0,-o.length),(a=r.getUuid(t,e))&&!
n&&cc.warnID(4901,t,o))}return a},g._getReferenceKey=function(t){var
e;return"object"===(void 0===t?"undefined":n(t))?e=t._uuid||null:"string"==typeof
t&&(e=this._getResUuid(t,null,null,!0)||t),e?
(cc.AssetLibrary._getAssetInfoInRuntime(e,d),this._cache[d.url]?d.url:e):
(cc.warnID(4800,t),e)},g._urlNotFound=function(t,e,i){u((function()
{t=cc.url.normalize(t);var n=(e?r.getClassName(e):"Asset")+' in "resources/'+t+'"
does not exist.';i&&i(new Error(n),[])}))},g._parseLoadResArgs=function(t,e,i)
{if(void 0===i){var n=t instanceof Array||r.isChildClassOf(t,cc.RawAsset);e?
(i=e,n&&(e=this.onProgress||null)):void 0!==e||n||(i=t,e=this.onProgress||
null,t=null),void 0===e||n||
(e=t,t=null)}return{type:t,onProgress:e,onComplete:i}},g.loadRes=function(t,e,i,n,r
){5!==arguments.length&&(r=n,n=i,i="assets");var
s=this._parseLoadResArgs(e,n,r);e=s.type,n=s.onProgress,r=s.onComplete;var
a=this,o=a._getResUuid(t,e,i);o?this.load({type:"uuid",uuid:o},n,(function(t,e)
{e&&a.setAutoReleaseRecursively(o,!
1),r&&r(t,e)})):a._urlNotFound(t,e,r)},g._loadResUuids=function(t,e,i,n)
{if(t.length>0){var r=this,s=t.map((function(t)
{return{type:"uuid",uuid:t}}));this.load(s,e,(function(t,e){if(i){for(var
a=[],o=n&&[],l=0;l<s.length;++l){var
h=s[l].uuid,c=this._getReferenceKey(h),u=e.getContent(c);u&&(r.setAutoReleaseRecurs
ively(h,!1),a.push(u),o&&o.push(n[l]))}n?i(t,a,o):i(t,a)}}))}else i&&u((function()
{n?i(null,[],[]):i(null,[])}))},g.loadResArray=function(t,e,i,n,r){5!
==arguments.length&&(r=n,n=i,i="assets");var
s=this._parseLoadResArgs(e,n,r);e=s.type,n=s.onProgress,r=s.onComplete;for(var
a=[],o=e instanceof Array,l=0;l<t.length;l++){var h=t[l],c=o?
e[l]:e,u=this._getResUuid(h,c,i);if(!u)return void
this._urlNotFound(h,c,r);a.push(u)}this._loadResUuids(a,n,r)},g.loadResDir=function
(t,e,i,n,r){if(5!==arguments.length&&(r=n,n=i,i="assets"),f[i]){var
s=this._parseLoadResArgs(e,n,r);e=s.type,n=s.onProgress,r=s.onComplete;var
a=[],o=f[i].getUuidArray(t,e,a);this._loadResUuids(o,n,r,a)}},g.getRes=function(t,e
){var i=this._cache[t];if(!i){var n=this._getResUuid(t,e,null,!0);if(!n)return
null;var r=this._getReferenceKey(n);i=this._cache[r]}return
i&&i.alias&&(i=i.alias),i&&i.complete?i.content:null},g.getResCount=function()
{return Object.keys(this._cache).length},g.getDependsRecursively=function(t){if(t)
{var e=this._getReferenceKey(t),i=_.getDependsRecursively(e);return
i.push(e),i}return[]},g.release=function(t){if(Array.isArray(t))for(var
e=0;e<t.length;e++){var i=t[e];this.release(i)}else if(t){var
n=this._getReferenceKey(t),r=this.getItem(n);if(r)
{this.removeItem(n);if((t=r.content)instanceof cc.Asset){var
s=t.nativeUrl;s&&this.release(s),t.destroy()}0}}},g.releaseAsset=function(t){var
e=t._uuid;e&&this.release(e)},g.releaseRes=function(t,e,i){var
n=this._getResUuid(t,e,i);n?
this.release(n):cc.errorID(4914,t)},g.releaseResDir=function(t,e,i)
{if(f[i=i||"assets"])for(var n=f[i].getUuidArray(t,e),r=0;r<n.length;r++){var
s=n[r];this.release(s)}},g.releaseAll=function(){for(var t in
this._cache)this.release(t)},g.removeItem=function(t){var
e=s.prototype.removeItem.call(this,t);return delete
this._autoReleaseSetting[t],e},g.setAutoRelease=function(t,e){var
i=this._getReferenceKey(t);i&&(this._autoReleaseSetting[i]=!!
e)},g.setAutoReleaseRecursively=function(t,e){e=!!e;var
i=this._getReferenceKey(t);if(i){this._autoReleaseSetting[i]=e;for(var
n=_.getDependsRecursively(i),r=0;r<n.length;r++){var
s=n[r];this._autoReleaseSetting[s]=e}}else 0},g.isAutoRelease=function(t){var
e=this._getReferenceKey(t);return!!e&&!!this._autoReleaseSetting[e]},cc.loader=new
y,e.exports=cc.loader}),{"../platform/js":220,"../platform/utils":224,"./asset-
loader":147,"./asset-table":148,"./auto-release-
utils":150,"./downloader":152,"./loader":155,"./loading-
items":156,"./pipeline":159,"./released-asset-checker":160}],147:[(function(t,e,i)
{"use strict";t("../utils/CCPath");var
n=t("../CCDebug"),r=t("./pipeline"),s=t("./loading-
items"),a="AssetLoader",o=function(t){this.id=a,this.async=!
0,this.pipeline=null};o.ID=a;var l=[];o.prototype.handle=function(t,e){var
i=t.uuid;if(!i)return t.content||null;cc.AssetLibrary.queryAssetInfo(i,
(function(r,a,o){if(r)e(r);else if(t.url=t.rawUrl=a,t.isRawAsset=o,o){var
h=cc.path.extname(a).toLowerCase();if(!h)return void e(new
Error(n.getError(4931,i,a)));h=h.substr(1);var
c=s.getQueue(t);l[0]={queueId:t.queueId,id:a,url:a,type:h,error:null,alias:t,comple
te:!0},c.append(l),t.type=h,e(null,t.content)}else
t.type="uuid",e(null,t.content)}))},r.AssetLoader=e.exports=o}),
{"../CCDebug":49,"../utils/CCPath":284,"./loading-
items":156,"./pipeline":159}],148:[(function(t,e,i){"use strict";var
n=t("../utils/misc").pushToMap,r=t("../platform/js");function s(t,e)
{this.uuid=t,this.type=e}function a(){this._pathToUuid=r.createMap(!0)}function
o(t,e){if(t.length>e.length){var i=t.charCodeAt(e.length);return 46===i||
47===i}return!0}var l=a.prototype;l.getUuid=function(t,e){t=cc.url.normalize(t);var
i=this._pathToUuid[t];if(i)if(Array.isArray(i)){if(!e)return i[0].uuid;for(var
n=0;n<i.length;n++){var s=i[n];if(r.isChildClassOf(s.type,e))return
s.uuid}}else{if(!e||r.isChildClassOf(i.type,e))return
i.uuid}return""},l.getUuidArray=function(t,e,i){"/"===(t=cc.url.normalize(t))
[t.length-1]&&(t=t.slice(0,-1));var
n=this._pathToUuid,s=[],a=r.isChildClassOf;for(var l in
n)if(l.startsWith(t)&&o(l,t)||!t){var h=n[l];if(Array.isArray(h))for(var
c=0;c<h.length;c++){var u=h[c];(!e||
a(u.type,e))&&(s.push(u.uuid),i&&i.push(l))}else(!e||
a(h.type,e))&&(s.push(h.uuid),i&&i.push(l))}return s},l.add=function(t,e,i,r)
{t=t.substring(0,t.length-cc.path.extname(t).length);var a=new
s(e,i);n(this._pathToUuid,t,a,r)},l._getInfo_DEBUG=!1,l.reset=function()
{this._pathToUuid=r.createMap(!0)},e.exports=a}),
{"../platform/js":220,"../utils/misc":295}],149:[(function(t,e,i){"use strict";var
n=t("../platform/CCSys"),r=t("../CCDebug"),s=n.__audioSupport,a=s.format,o=s.contex
t;function l(t,e){var
i=document.createElement("audio");if(i.src=t.url,cc.sys.platform===cc.sys.BAIDU_GAM
E)e(null,i);else{var n=function()
{clearTimeout(r),i.removeEventListener("canplaythrough",a,!
1),i.removeEventListener("error",o,!
1),s.USE_LOADER_EVENT&&i.removeEventListener(s.USE_LOADER_EVENT,a,!
1)},r=setTimeout((function(){0===i.readyState?o():a()}),8e3),a=function()
{n(),e(null,i)},o=function(){n();var i="load audio failure -
"+t.url;cc.log(i),e(i)};i.addEventListener("canplaythrough",a,!
1),i.addEventListener("error",o,!
1),s.USE_LOADER_EVENT&&i.addEventListener(s.USE_LOADER_EVENT,a,!1)}}function h(t,e)
{o||e(new Error(r.getError(4926)));var
i=cc.loader.getXMLHttpRequest();i.open("GET",t.url,!
0),i.responseType="arraybuffer",i.onload=function(){o.decodeAudioData(i.response,
(function(t){e(null,t)}),(function(){e("decode error -
"+t.id,null)}))},i.onerror=function(){e("request error -
"+t.id,null)},i.send()}e.exports=function(t,e){if(0===a.length)return new
Error(r.getError(4927));var i;i=s.WEB_AUDIO?t._owner instanceof cc.AudioClip?
t._owner.loadMode===cc.AudioClip.LoadMode.WEB_AUDIO?
h:l:t.urlParam&&t.urlParam.useDom?l:h:l,i(t,e)}}),
{"../CCDebug":49,"../platform/CCSys":209}],150:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/js");function s(t,e){var i=cc.loader.getItem(t);if(i){var
n=i.dependKeys;if(n)for(var r=0;r<n.length;r++){var a=n[r];e[a]||(e[a]=!
0,s(a,e))}}}function
a(t,e){if(t._uuid){var i=cc.loader._getReferenceKey(t);e[i]||(e[i]=!
0,s(i,e))}}function o(t,e){for(var
i=Object.getOwnPropertyNames(t),r=0;r<i.length;r++){var
s=t[i[r]];if("object"===(void
0===s?"undefined":n(s))&&s)if(Array.isArray(s))for(var o=0;o<s.length;o++){var
l=s[o];l instanceof cc.RawAsset&&a(l,e)}else if(s.constructor&&s.constructor!
==Object)s instanceof cc.RawAsset&&a(s,e);else for(var
h=Object.getOwnPropertyNames(s),c=0;c<h.length;c++){var u=s[h[c]];u instanceof
cc.RawAsset&&a(u,e)}}}function l(t,e){for(var i=0;i<t._components.length;i+
+)o(t._components[i],e);for(var n=0;n<t._children.length;n+
+)l(t._children[n],e)}e.exports={autoRelease:function(t,e,i){var
n=cc.loader._autoReleaseSetting,s=r.createMap();if(e)for(var a=0;a<e.length;a+
+)s[e[a]]=!0;for(var o=0;o<i.length;o++)l(i[o],s);if(t)for(var h=0;h<t.length;h++)
{var c=t[h];!1===n[c]||s[c]||cc.loader.release(c)}for(var
u=Object.keys(n),_=0;_<u.length;_++){var f=u[_];!0!==n[f]||s[f]||
cc.loader.release(f)}},getDependsRecursively:function(t){var e={};return
s(t,e),Object.keys(e)}}}),{"../platform/js":220}],151:[(function(t,e,i){"use
strict";e.exports=function(t,e){var i=t.url,n=cc.loader.getXMLHttpRequest(),r="Load
binary data failed: "+i;n.open("GET",i,!
0),n.responseType="arraybuffer",n.onload=function(){var t=n.response;if(t){var
i=new Uint8Array(t);e(null,i)}else e({status:n.status,errorMessage:r+"(no
response)"})},n.onerror=function()
{e({status:n.status,errorMessage:r+"(error)"})},n.ontimeout=function()
{e({status:n.status,errorMessage:r+"(time out)"})},n.send(null)}}),{}],152:
[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../CCDebug");t("../utils/CCPath");var
s,a=t("./pipeline"),o=t("./pack-downloader"),l=t("./binary-
downloader"),h=t("./text-downloader"),c=t("./utils").urlAppendTimestamp;function
u(){return null}function _(t,e,i){var
n=t.url,s=document,a=document.createElement("script");function o()
{a.parentNode.removeChild(a),a.removeEventListener("load",o,!
1),a.removeEventListener("error",l,!1),e(null,n)}function l()
{a.parentNode.removeChild(a),a.removeEventListener("load",o,!
1),a.removeEventListener("error",l,!1),e(new Error(r.getError(4928,n)))}"file:"!
==window.location.protocol&&(a.crossOrigin="anonymous"),a.async=i,a.src=c(n),a.addE
ventListener("load",o,!1),a.addEventListener("error",l,!
1),s.body.appendChild(a)}function f(t,e,i,n){void 0===i&&(i=!0);var
s=c(t.url);if(n=n||new Image,i&&"file:"!==window.location.protocol?
n.crossOrigin="anonymous":n.crossOrigin=null,n.complete&&n.naturalWidth>0&&n.src===
s)return n;var a=function i()
{n.removeEventListener("load",i),n.removeEventListener("error",o),n.id=t.id,e(null,
n)},o=function i()
{n.removeEventListener("load",a),n.removeEventListener("error",i),"https:"!
==window.location.protocol&&n.crossOrigin&&"anonymous"===n.crossOrigin.toLowerCase(
)?f(t,e,!1,n):e(new
Error(r.getError(4930,s)))};n.addEventListener("load",a),n.addEventListener("error"
,o),n.src=s}var
d={js:_,png:f,jpg:f,bmp:f,jpeg:f,gif:f,ico:f,tiff:f,webp:function(t,e,i,n){return
cc.sys.capabilities.webp?f(t,e,i,n):new
Error(r.getError(4929,t.url))},image:f,pvr:l,pkm:l,mp3:s=t("./audio-
downloader"),ogg:s,wav:s,m4a:s,txt:h,xml:h,vsh:h,fsh:h,atlas:h,tmx:h,tsx:h,json:h,E
xportJson:h,plist:h,fnt:h,font:u,eot:u,ttf:u,woff:u,svg:u,ttc:u,uuid:function(t,e)
{var i=o.load(t,e);return void 0===i?this.extMap.json(t,e):i||void
0},binary:l,bin:l,dbbin:l,default:h},m="Downloader",p=function(t)
{this.id=m,this.async=!
0,this.pipeline=null,this._curConcurrent=0,this._loadQueue=[],this._subpackages={},
this.extMap=n.mixin(t,d)};p.ID=m,p.PackDownloader=o,p.prototype.addHandlers=functio
n(t){n.mixin(this.extMap,t)},p.prototype._handleLoadQueue=function()
{for(;this._curConcurrent<cc.macro.DOWNLOAD_MAX_CONCURRENT;){var
t=this._loadQueue.shift();if(!t)break;var e=this.handle(t.item,t.callback);void 0!
==e&&(e instanceof Error?
t.callback(e):t.callback(null,e))}},p.prototype.handle=function(t,e){var
i=this,n=this.extMap[t.type]||this.extMap.default,r=void
0;if(this._curConcurrent<cc.macro.DOWNLOAD_MAX_CONCURRENT){if(this._curConcurrent+
+,void 0!==(r=n.call(this,t,(function(t,n)
{i._curConcurrent=Math.max(0,i._curConcurrent-
1),i._handleLoadQueue(),e&&e(t,n)}))))return
this._curConcurrent=Math.max(0,this._curConcurrent-
1),this._handleLoadQueue(),r}else if(t.ignoreMaxConcurrency){if(void 0!
==(r=n.call(this,t,e)))return r}else
this._loadQueue.push({item:t,callback:e})},p.prototype.loadSubpackage=function(t,e)
{var i=this._subpackages[t];i?i.loaded?e&&e():_({url:i.path+"index.js"},
(function(t){t||(i.loaded=!0),e&&e(t)})):e&&e(new Error("Can't find subpackage
"+t))},a.Downloader=e.exports=p}),
{"../CCDebug":49,"../platform/js":220,"../utils/CCPath":284,"./audio-
downloader":149,"./binary-downloader":151,"./pack-
downloader":158,"./pipeline":159,"./text-downloader":162,"./utils":164}],153:
[(function(t,e,i){"use strict";var n=t("../utils/text-utils"),r=null,s="BES bswy:-
>@123\u4e01\u3041\u1101",a={},o=-1,l=[],h=6e4,c=(function(){var t=void 0;return
function(){if(void 0===t)if(window.FontFace){var
e=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),i=/OS
X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.nav
igator.vendor);t=e?parseInt(e[1],10)>42:!i}else t=!1;return t}})();function u()
{for(var t=!0,e=Date.now(),i=l.length-1;i>=0;i--){var
a=l[i],c=a.fontFamilyName;if(e-
a.startTime>h)cc.warnID(4933,c),a.callback(null,c),l.splice(i,1);else{var
u=a.refWidth;r.font="40px "+c,u!==n.safeMeasureText(r,s)?
(l.splice(i,1),a.callback(null,c)):t=!1}}t&&(clearInterval(o),o=-1)}function
_(t,e,i){var n=new Promise(function(i,n){(function r(){Date.now()-t>=h?
n():document.fonts.load("40px "+e).then((function(t){t.length>=1?
i():setTimeout(r,100)}),(function(){n()}))})()}),r=null,s=new Promise(function(t,e)
{r=setTimeout(e,h)});Promise.race([s,n]).then((function()
{r&&(clearTimeout(r),r=null),i(null,e)}),(function()
{cc.warnID(4933,e),i(null,e)}))}var f={loadFont:function(t,e){var
i=t.url,h=f._getFontFamily(i);if(a[h])return h;if(!r){var
d=document.createElement("canvas");d.width=100,d.height=100,r=d.getContext("2d")}va
r m="40px "+h;r.font=m;var
p=n.safeMeasureText(r,s),v=document.createElement("style");v.type="text/css";var
y="";isNaN(h-0)?y+="@font-face { font-family:"+h+"; src:":y+="@font-face { font-
family:'"+h+"';
src:",y+="url('"+i+"');",v.textContent=y+"}",document.body.appendChild(v);var
g=document.createElement("div"),x=g.style;if(x.fontFamily=h,g.innerHTML=".",x.posit
ion="absolute",x.left="-100px",x.top="-
100px",document.body.appendChild(g),c())_(Date.now(),h,e);else{var
b={fontFamilyName:h,refWidth:p,callback:e,startTime:Date.now()};l.push(b),-
1===o&&(o=setInterval(u,100))}a[h]=v},_getFontFamily:function(t){var
e=t.lastIndexOf(".ttf");if(-1===e)return t;var i,n=t.lastIndexOf("/");return-1!
==(i=-1===n?t.substring(0,e)+"_LABEL":t.substring(n+1,e)+"_LABEL").indexOf("
")&&(i='"'+i+'"'),i}};e.exports=f}),{"../utils/text-utils":301}],154:
[(function(t,e,i){"use strict";t("./downloader"),t("./loader"),t("./loading-
items"),t("./pipeline"),t("./CCLoader")}),
{"./CCLoader":146,"./downloader":152,"./loader":155,"./loading-
items":156,"./pipeline":159}],155:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("../platform/CCSAXParser").plistParser,s=t("./pipeline"),
a=t("../assets/CCTexture2D"),o=t("./uuid-loader"),l=t("./font-loader");function
h(t){if("string"!=typeof t.content)return new Error("JSON Loader: Input item
doesn't contain string content");try{return JSON.parse(t.content)}catch(e){return
new Error("JSON Loader: Parse json ["+t.id+"] failed : "+e)}}function c(t)
{if(t._owner instanceof cc.Asset)return null;var e=t.content;if(cc.sys.platform!
==cc.sys.FB_PLAYABLE_ADS&&!(e instanceof Image))return new Error("Image Loader:
Input item doesn't contain Image content");var i=t.rawUrl,n=t.texture||new a;return
n._uuid=t.uuid,n.url=i,n._setRawAsset(i,!1),n._nativeAsset=e,n}function u(t,e)
{if(t._owner instanceof cc.Asset)return null;var i=new cc.AudioClip;return
i._setRawAsset(t.rawUrl,!1),i._nativeAsset=t.content,i}function _(t){return t.load?
t.load(t.content):null}var f=13,d=55727696,m=0,p=6,v=7,y=12;var
g=16,x=6,b=8,A=10,C=12,S=14,T=0,w=1,E=3;function M(t,e){return t[e]<<8|t[e+1]}var
D={png:c,jpg:c,bmp:c,jpeg:c,gif:c,ico:c,tiff:c,webp:c,image:c,pvr:function(t){var
e=t.content instanceof ArrayBuffer?t.content:t.content.buffer,i=new
Int32Array(e,0,f);if(i[m]!=d)return new Error("Invalid magic number in PVR
header");var n=i[v],r=i[p],s=i[y]+52;return{_data:new Uint8Array(e,s),_compressed:!
0,width:n,height:r}},pkm:function(t){var e=t.content instanceof ArrayBuffer?
t.content:t.content.buffer,i=new Uint8Array(e),n=M(i,x);if(n!==T&&n!==w&&n!
==E)return new Error("Invalid magic number in ETC header");var
r=M(i,C),s=M(i,S);return M(i,b),M(i,A),{_data:new Uint8Array(e,g),_compressed:!
0,width:r,height:s}},mp3:u,ogg:u,wav:u,m4a:u,json:h,ExportJson:h,plist:function(t)
{if("string"!=typeof t.content)return new Error("Plist Loader: Input item doesn't
contain string content");var e=r.parse(t.content);return e||new Error("Plist
Loader: Parse ["+t.id+"]
failed")},uuid:o,prefab:o,fire:o,scene:o,binary:_,dbbin:_,bin:_,font:l.loadFont,eot
:l.loadFont,ttf:l.loadFont,woff:l.loadFont,svg:l.loadFont,ttc:l.loadFont,default:fu
nction(){return null}},B=function(t){this.id="Loader",this.async=!
0,this.pipeline=null,this.extMap=n.mixin(t,D)};B.ID="Loader",B.prototype.addHandler
s=function(t){this.extMap=n.mixin(this.extMap,t)},B.prototype.handle=function(t,e)
{return(this.extMap[t.type]||
this.extMap.default).call(this,t,e)},s.Loader=e.exports=B}),
{"../assets/CCTexture2D":73,"../platform/CCSAXParser":207,"../platform/js":220,"./f
ont-loader":153,"./pipeline":159,"./uuid-loader":165}],156:[(function(t,e,i){"use
strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?
function(t){return typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/callbacks-invoker");t("../utils/CCPath");var
s=t("../platform/js"),a=0|998*Math.random(),o=s.createMap(!
0),l=[],h={WORKING:1,COMPLETE:2,ERROR:3},c=s.createMap(!0);function u(t)
{return"string"==typeof(t.url||t)}function _(t){if(t){var
e=t.split("?");if(e&&e[0]&&e[1]){var i={};return
e[1].split("&").forEach((function(t){var
e=t.split("=");i[e[0]]=e[1]})),i}}}function f(t,e){var i="object"===(void
0===t?"undefined":n(t))?t.url:t,r={queueId:e,id:i,url:i,rawUrl:void
0,urlParam:_(i),type:"",error:null,content:null,complete:!1,states:
{},deps:null};if("object"===(void
0===t?"undefined":n(t))&&(s.mixin(r,t),t.skips))for(var a=0;a<t.skips.length;a++)
{var o=t.skips[a];r.states[o]=h.COMPLETE}return r.rawUrl=r.url,i&&!
r.type&&(r.type=cc.path.extname(i).toLowerCase().substr(1)),r}var d=[];function
m(t,e,i){if(!t||!e)return!1;var n=!1;if(d.push(e.id),e.deps){var
r,s,a=e.deps;for(r=0;r<a.length;r++){if((s=a[r]).id===t.id){n=!0;break}if(!
(d.indexOf(s.id)>=0)&&(s.deps&&m(t,s,!0))){n=!0;break}}}return i||
(d.length=0),n}var p=function(t,e,i,n){r.call(this),this._id=+
+a,o[this._id]=this,this._pipeline=t,this._errorUrls=s.createMap(!
0),this._appending=!
1,this._ownerQueue=null,this.onProgress=i,this.onComplete=n,this.map=s.createMap(!
0),this.completed={},this.totalCount=0,this.completedCount=0,this._pipeline?
this.active=!0:this.active=!1,e&&(e.length>0?
this.append(e):this.allComplete())};p.ItemState=new
cc.Enum(h),p.create=function(t,e,i,n){void 0===i?"function"==typeof
e&&(n=e,e=i=null):void 0===n&&("function"==typeof e?(n=i,i=e,e=null):
(n=i,i=null));var r=l.pop();return r?
(r._pipeline=t,r.onProgress=i,r.onComplete=n,o[r._id]=r,r._pipeline&&(r.active=!
0),e&&r.append(e)):r=new p(t,e,i,n),r},p.getQueue=function(t){return t.queueId?
o[t.queueId]:null},p.itemComplete=function(t){var
e=o[t.queueId];e&&e.itemComplete(t.id)},p.initQueueDeps=function(t){var
e=c[t._id];e?(e.completed.length=0,e.deps.length=0):e=c[t._id]={completed:[],deps:
[]}},p.registerQueueDep=function(t,e){var i=t.queueId||t;if(!i)return!1;var
n=c[i];if(n)-1===n.deps.indexOf(e)&&n.deps.push(e);else if(t.id)for(var r in c){var
s=c[r];-1!==s.deps.indexOf(t.id)&&-
1===s.deps.indexOf(e)&&s.deps.push(e)}},p.finishDep=function(t){for(var e in c){var
i=c[e];-1!==i.deps.indexOf(t)&&-
1===i.completed.indexOf(t)&&i.completed.push(t)}};var
v=p.prototype;s.mixin(v,r.prototype),v.append=function(t,e){if(!
this.active)return[];e&&!e.deps&&(e.deps=[]),this._appending=!0;var
i,n,r,s=[];for(i=0;i<t.length;++i)if(!(n=t[i]).queueId||this.map[n.id]){if(u(n))
{var a=(r=f(n,this._id)).id;this.map[a]||(this.map[a]=r,this.totalCount+
+,e&&e.deps.push(r),p.registerQueueDep(e||
this._id,a),s.push(r))}}else{if(this.map[n.id]=n,e&&e.deps.push(n),n.complete||
m(e,n)){this.totalCount++,this.itemComplete(n.id);continue}var
l=this,h=o[n.queueId];h&&(this.totalCount++,p.registerQueueDep(e||
this._id,n.id),h.addListener(n.id,(function(t){l.itemComplete(t.id)})))}return
this._appending=!1,this.completedCount===this.totalCount?
this.allComplete():this._pipeline.flowIn(s),s},v._childOnProgress=function(t)
{if(this.onProgress){var e=c[this._id];this.onProgress(e?
e.completed.length:this.completedCount,e?
e.deps.length:this.totalCount,t)}},v.allComplete=function(){var
t=s.isEmptyObject(this._errorUrls)?
null:this._errorUrls;this.onComplete&&this.onComplete(t,this)},v.isCompleted=functi
on(){return this.completedCount>=this.totalCount},v.isItemCompleted=function(t)
{return!!this.completed[t]},v.exists=function(t){return!!
this.map[t]},v.getContent=function(t){var e=this.map[t],i=null;return
e&&(e.content?i=e.content:e.alias&&(i=e.alias.content)),i},v.getError=function(t)
{var e=this.map[t],i=null;return e&&(e.error?
i=e.error:e.alias&&(i=e.alias.error)),i},v.addListener=r.prototype.add,v.hasListene
r=r.prototype.has,v.removeListener=r.prototype.remove,v.removeAllListeners=r.protot
ype.removeAll,v.removeItem=function(t){var
e=this.map[t];e&&this.completed[e.alias||t]&&(delete this.completed[t],delete
this.map[t],e.alias&&(delete this.completed[e.alias.id],delete
this.map[e.alias.id]),this.completedCount--,this.totalCount--)},v.itemComplete=func
tion(t){var e=this.map[t];if(e){var i=t in this._errorUrls;if(e.error instanceof
Error||s.isString(e.error)?this._errorUrls[t]=e.error:e.error?
s.mixin(this._errorUrls,e.error):!e.error&&i&&delete
this._errorUrls[t],this.completed[t]=e,this.completedCount+
+,p.finishDep(e.id),this.onProgress){var n=c[this._id];this.onProgress(n?
n.completed.length:this.completedCount,n?
n.deps.length:this.totalCount,e)}this.invoke(t,e),this.removeAll(t),!
this._appending&&this.completedCount>=this.totalCount&&this.allComplete()}},v.destr
oy=function(){this.active=!1,this._appending=!
1,this._pipeline=null,this._ownerQueue=null,s.clear(this._errorUrls),this.onProgres
s=null,this.onComplete=null,this.map=s.createMap(!
0),this.completed={},this.totalCount=0,this.completedCount=0,r.call(this),c[this._i
d]&&(c[this._id].completed.length=0,c[this._id].deps.length=0),delete
o[this._id],delete c[this._id],-
1===l.indexOf(this)&&l.length<10&&l.push(this)},cc.LoadingItems=e.exports=p}),
{"../platform/callbacks-
invoker":213,"../platform/js":220,"../utils/CCPath":284}],157:[(function(t,e,i)
{"use strict";var n=t("./pipeline"),r="MD5Pipe",s=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-
9a-fA-F-]{8,})/,a=function(t,e,i){this.id=r,this.async=!
1,this.pipeline=null,this.md5AssetsMap=t,this.md5NativeAssetsMap=e,this.libraryBase
=i};a.ID=r,a.prototype.handle=function(t){return
t.url=this.transformURL(t.url),null},a.prototype.transformURL=function(t){var e=!
t.startsWith(this.libraryBase)?this.md5NativeAssetsMap:this.md5AssetsMap;return
t=t.replace(s,(function(t,i){var n=e[i];return n?
t+"."+n:t}))},n.MD5Pipe=e.exports=a}),{"./pipeline":159}],158:[(function(t,e,i)
{"use strict";var
n=t("./unpackers"),r=t("../utils/misc").pushToMap,s={Invalid:0,Removed:1,Downloadin
g:2,Loaded:3};function a(){this.unpacker=null,this.state=s.Invalid}var
o={},l={},h={};function c(t,e){return new Error("Can not retrieve "+t+" from packer
"+e)}e.exports={initPacks:function(t){for(var e in l=t,o={},t)for(var
i=t[e],n=0;n<i.length;n++){var
s=i[n],a=1===i.length;r(o,s,e,a)}},_loadNewPack:function(t,e,i){var
n=this,r=cc.AssetLibrary.getLibUrlNoExt(e)
+".json";cc.loader.load({url:r,ignoreMaxConcurrency:!0},(function(r,s){if(r)return
cc.errorID(4916,t),i(r);var a=n._doLoadNewPack(t,e,s);a?
i(null,a):i(c(t,e))}))},_doPreload:function(t,e){var i=h[t];i||((i=h[t]=new
a).state=s.Downloading),i.state!==s.Loaded&&(i.unpacker=new
n.JsonUnpacker,i.unpacker.load(l[t],e),i.state=s.Loaded)},_doLoadNewPack:function(t
,e,i){var r=h[e];return r.state!==s.Loaded&&("string"==typeof
i&&(i=JSON.parse(i)),Array.isArray(i)?r.unpacker=new
n.JsonUnpacker:i.type===n.TextureUnpacker.ID&&(r.unpacker=new
n.TextureUnpacker),r.unpacker.load(l[e],i),r.state=s.Loaded),r.unpacker.retrieve(t)
},_selectLoadedPack:function(t){for(var e=s.Invalid,i="",n=0;n<t.length;n++){var
r=t[n],a=h[r];if(a){var o=a.state;if(o===s.Loaded)return r;o>e&&(e=o,i=r)}}return
e!==s.Invalid?i:t[0]},load:function(t,e){var i=t.uuid,n=o[i];if(n)
{Array.isArray(n)&&(n=this._selectLoadedPack(n));var
r=h[n];if(r&&r.state===s.Loaded){var l=r.unpacker.retrieve(i);return l||
c(i,n)}return r||(console.log("Create unpacker %s for %s",n,i),(r=h[n]=new
a).state=s.Downloading),this._loadNewPack(i,n,e),null}}}}),
{"../utils/misc":295,"./unpackers":163}],159:[(function(t,e,i){"use strict";var
n=t("../platform/js"),r=t("./loading-items"),s=r.ItemState;function a(t,e){var
i=t.id,n=e.states[i],r=t.next,o=t.pipeline;if(!e.error&&n!==s.WORKING&&n!
==s.ERROR)if(n===s.COMPLETE)r?a(r,e):o.flowOut(e);else{e.states[i]=s.WORKING;var
l=t.handle(e,(function(t,n){t?(e.error=t,e.states[i]=s.ERROR,o.flowOut(e)):
(n&&(e.content=n),e.states[i]=s.COMPLETE,r?a(r,e):o.flowOut(e))}));l instanceof
Error?(e.error=l,e.states[i]=s.ERROR,o.flowOut(e)):void 0!==l&&(null!
==l&&(e.content=l),e.states[i]=s.COMPLETE,r?a(r,e):o.flowOut(e))}}var o=function(t)
{this._pipes=t,this._cache=n.createMap(!0);for(var e=0;e<t.length;++e){var
i=t[e];i.handle&&i.id&&(i.pipeline=this,i.next=e<t.length-1?
t[e+1]:null)}};o.ItemState=s;var l=o.prototype;l.insertPipe=function(t,e){if(!
t.handle||!t.id||e>this._pipes.length)cc.warnID(4921);else
if(this._pipes.indexOf(t)>0)cc.warnID(4922);else{t.pipeline=this;var
i=null;e<this._pipes.length&&(i=this._pipes[e]);var n=null;e>0&&(n=this._pipes[e-
1]),n&&(n.next=t),t.next=i,this._pipes.splice(e,0,t)}},l.insertPipeAfter=function(t
,e){var i=this._pipes.indexOf(t);i<0||
this.insertPipe(e,i+1)},l.appendPipe=function(t)
{t.handle&&t.id&&(t.pipeline=this,t.next=null,this._pipes.length>0&&(this._pipes[th
is._pipes.length-1].next=t),this._pipes.push(t))},l.flowIn=function(t){var
e,i,n=this._pipes[0];if(n){for(e=0;e<t.length;e+
+)i=t[e],this._cache[i.id]=i;for(e=0;e<t.length;e++)a(n,i=t[e])}else
for(e=0;e<t.length;e++)this.flowOut(t[e])},l.flowInDeps=function(t,e,i){return
r.create(this,(function(t,e)
{i(t,e),e.destroy()})).append(e,t)},l.flowOut=function(t){t.error?delete
this._cache[t.id]:this._cache[t.id]||(this._cache[t.id]=t),t.complete=!
0,r.itemComplete(t)},l.copyItemStates=function(t,e){if(e instanceof Array)for(var
i=0;i<e.length;++i)e[i].states=t.states;else
e.states=t.states},l.getItem=function(t){var e=this._cache[t];return e?
(e.alias&&(e=e.alias),e):e},l.removeItem=function(t){var e=this._cache[t];return
e&&e.complete&&delete this._cache[t],e},l.clear=function(){for(var t in
this._cache){var e=this._cache[t];delete this._cache[t],e.complete||(e.error=new
Error("Canceled manually"),this.flowOut(e))}},cc.Pipeline=e.exports=o}),
{"../platform/js":220,"./loading-items":156}],160:[(function(t,e,i){"use strict"}),
{"../platform/js":220}],161:[(function(t,e,i){"use strict";var
n=t("./pipeline"),r="SubPackPipe",s=/.*[/\\][0-9a-fA-F]{2}[/\\]([0-9a-fA-F-]
{8,})/;function a(t){var e=t.match(s);return e?e[1]:""}var
o=Object.create(null),l=function(t){for(var e in this.id=r,this.async=!
1,this.pipeline=null,t){var
i=t[e];i.uuids&&i.uuids.forEach((function(t)
{o[t]=i.path}))}};l.ID=r,l.prototype.handle=function(t){return
t.url=this.transformURL(t.url),null},l.prototype.transformURL=function(t){var
e=a(t);if(e){var i=o[e];if(i)return t.replace("res/raw-assets/",i+"raw-
assets/")}return t},n.SubPackPipe=e.exports=l}),{"./pipeline":159}],162:
[(function(t,e,i){"use strict";var
n=t("./utils").urlAppendTimestamp;e.exports=function(t,e){var i=t.url;i=n(i);var
r=cc.loader.getXMLHttpRequest(),s="Load text file failed: "+i;r.open("GET",i,!
0),r.overrideMimeType&&r.overrideMimeType("text/plain; charset=utf-
8"),r.onload=function(){4===r.readyState?200===r.status||0===r.status?
e(null,r.responseText):e({status:r.status,errorMessage:s+"(wrong
status)"}):e({status:r.status,errorMessage:s+"(wrong
readyState)"})},r.onerror=function()
{e({status:r.status,errorMessage:s+"(error)"})},r.ontimeout=function()
{e({status:r.status,errorMessage:s+"(time out)"})},r.send(null)}}),
{"./utils":164}],163:[(function(t,e,i){"use strict";var
n=t("../assets/CCTexture2D"),r=t("../platform/js");function s()
{this.jsons={}}function a(){this.contents={}}s.prototype.load=function(t,e)
{e.length!==t.length&&cc.errorID(4915);for(var i=0;i<t.length;i++){var
n=t[i],r=e[i];this.jsons[n]=r}},s.prototype.retrieve=function(t){return
this.jsons[t]||null},a.ID=r._getClassId(n),a.prototype.load=function(t,e){var
i=e.data.split("|");i.length!==t.length&&cc.errorID(4915);for(var n=0;n<t.length;n+
+)this.contents[t[n]]=i[n]},a.prototype.retrieve=function(t){var
e=this.contents[t];return e?
{__type__:a.ID,content:e}:null},e.exports={JsonUnpacker:s,TextureUnpacker:a}}),
{"../assets/CCTexture2D":73,"../platform/js":220}],164:[(function(t,e,i){"use
strict";var n=/\?/;e.exports={urlAppendTimestamp:function(t){return
cc.game.config.noCache&&"string"==typeof t&&(n.test(t)?t+="&_t="+(new Date-0):t+="?
_t="+(new Date-0)),t}}}),{}],165:[(function(t,e,i){"use strict";var
n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return
typeof t}:function(t){return t&&"function"==typeof
Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof
t},r=t("../platform/js"),s=t("../CCDebug");t("../platform/deserialize");var
a=t("./loading-items");function o(t){return t&&(t[0]&&"cc.Scene"===t[0].__type__||
t[1]&&"cc.Scene"===t[1].__type__||t[0]&&"cc.Prefab"===t[0].__type__)}function
l(t,e,i,n){var
r,s,a,o=i.uuidList,l=i.uuidObjList,h=i.uuidPropList,c=i._stillUseUrl,u=t.dependKeys
=[];if(n)for(r=[],s=0;s<o.length;s++){a=o[s];var
_=l[s],f=h[s],d=cc.AssetLibrary._getAssetInfoInRuntime(a);if(d.raw){var
m=d.url;_[f]=m,u.push(m)}else r.push({type:"uuid",uuid:a,deferredLoadRaw:!
0,_owner:_,_ownerProp:f,_stillUseUrl:c[s]})}else{for(r=new
Array(o.length),s=0;s<o.length;s+
+)a=o[s],r[s]={type:"uuid",uuid:a,_owner:l[s],_ownerProp:h[s],_stillUseUrl:c[s]};e.
_native&&!
e.constructor.preventPreloadNativeObject&&r.push({url:e.nativeUrl,_owner:e,_ownerPr
op:"_nativeAsset"})}return r}function h(t,e,i,n,r){e.content=i;var
s=e.dependKeys;t.flowInDeps(e,n,(function(t,e){var o,l=e.map;for(var h in l)
(o=l[h]).uuid&&o.content&&(o.content._uuid=o.uuid);for(var c=0;c<n.length;c++){var
u=function(t){var
e=t.content;this._stillUseUrl&&(e=e&&cc.RawAsset.wasRawAssetType(e.constructor)?
e.nativeUrl:t.rawUrl),this._owner[this._ownerProp]=e,t.uuid!
==i._uuid&&s.indexOf(t.id)<0&&s.push(t.id)},_=n[c],f=_.uuid,d=_.url;_._owner,_._own
erProp;if(o=l[d]){var m=_;if(o.complete||o.content)
{if(o.error)cc._throw(o.error);else u.call(m,o)}else{var
p=a.getQueue(o),v=p._callbackTable[f];v?v.unshift(u,m):p.addListener(f,u,m)}}}!
t&&i.onLoad&&i.onLoad(),r(t,i)}))}function c(t,e,i){var n=e.deferredLoadRaw;return
n?t instanceof cc.Asset&&t.constructor.preventDeferredLoadDependents&&(n=!1):i&&(t
instanceof cc.SceneAsset||t instanceof cc.Prefab)&&(n=t.asyncLoadAssets),n}function
u(t,e){var i,a;if("string"==typeof t.content)try{i=JSON.parse(t.content)}catch(e)
{return new Error(s.getError(4923,t.id,e.stack))}else{if("object"!
==n(t.content))return new Error(s.getError(4924));i=t.content}var u=o(i);a=u?
cc._MissingScript.safeFindClass:function(t){var e=r._getClassById(t);return e||
(cc.warnID(4903,t),Object)};var
_,f=cc.deserialize.Details.pool.get();try{_=cc.deserialize(i,f,
{classFinder:a,target:t.existingAsset,customEnv:t})}catch(e)
{cc.deserialize.Details.pool.put(f);var d=e.stack;return new
Error(s.getError(4925,t.id,d))}_._uuid=t.uuid;var
m=l(t,_,f,c(_,t,u));if(cc.deserialize.Details.pool.put(f),0===m.length)return
_.onLoad&&_.onLoad(),e(null,_);h(this.pipeline,t,_,m,e)}e.exports=u,u.isSceneObj=o}
),{"../CCDebug":49,"../platform/deserialize":215,"../platform/js":220,"./loading-
items":156}],166:[(function(t,e,i){"use strict";var
n=a(t("../../renderer/core/input-
assembler")),r=a(t("../../renderer/gfx")),s=t("./mesh-data");function a(t){return
t&&t.__esModule?t:{default:t}}var o=t("../renderer"),l=t("../event/event-
target");function h(t,e,i){t[e]=i._val}function c(t,e,i)
{t[e]=i.x,t[e+1]=i.y}function u(t,e,i){t[e]=i.x,t[e+1]=i.y,t[e+2]=i.z}var
_=cc.Class({name:"cc.Mesh",extends:cc.Asset,mixins:[l],properties:{_nativeAsset:
{override:!0,get:function(){return this._buffer},set:function(t)
{this._buffer=ArrayBuffer.isView(t)?t.buffer:t}},_vertexBundles:
{default:null,type:s.VertexBundle},_primitives:
{default:null,Primitive:s.Primitive},_minPos:cc.v3(),_maxPos:cc.v3(),subMeshes:
{get:function(){return this._subMeshes},set:function(t)
{this._subMeshes=t}}},ctor:function()
{this._subMeshes=[],this._ibs=[],this._vbs=[]},onLoad:function()
{this._subMeshes.length=0;for(var t=this._primitives,e=0;e<t.length;e++){var
i=t[e],s=i.data,a=new Uint16Array(this._buffer,s.offset,s.length/2),l=new
r.default.IndexBuffer(o.device,i.indexUnit,r.default.USAGE_STATIC,a,a.length),h=thi
s._vertexBundles[i.vertexBundleIndices[0]],c=h.data,u=new
r.default.VertexFormat(h.formats),_=new
Uint8Array(this._buffer,c.offset,c.length),f=new
r.default.VertexBuffer(o.device,u,r.default.USAGE_STATIC,_,h.verticesCount);this._s
ubMeshes.push(new
n.default(f,l)),this._ibs.push({buffer:l,data:a}),this._vbs.push({buffer:f,data:_})
}},init:function(t,e,i){this.clear();var n=new Uint8Array(t._bytes*e),s=new
r.default.VertexBuffer(o.device,t,i?
r.default.USAGE_DYNAMIC:r.default.USAGE_STATIC,n,e);this._vbs[0]={buffer:s,data:n,d
irty:!0},this.emit("init-format")},setVertices:function(t,e,i){i=i||0;var
n=this._vbs[i],s=n.buffer._format._attr2el[t];if(!s)return cc.warn("Cannot find
"+t+" attribute in vertex defines.");var a="number"==typeof
e[0],o=s.num,l=Float32Array,_=4;t===r.default.ATTR_COLOR&&(a?
(l=Float32Array,_=1):l=Uint32Array);var f=n[l.name];if(!f){var
d=n.data;f=n[l.name]=new l(d.buffer,d.byteOffset,d.byteLength/_)}var
m=s.stride/_,p=s.offset/_;if(a)for(var v=0,y=e.length/o;v<y;v++)for(var
g=v*o,x=v*m+p,b=0;b<o;b++)f[x+b]=e[g+b];else{var A=void
0;A=t===r.default.ATTR_COLOR?h:2===o?c:u;for(var C=0,S=e.length;C<S;C++)
{A(f,C*m+p,e[C])}}n.dirty=!0},setIndices:function(t,e,i){e=e||0;var s=new
Uint16Array(t),a=i?
r.default.USAGE_DYNAMIC:r.default.USAGE_STATIC,l=this._ibs[e];if(l)l.buffer._usage=
a,l.data=s,l.dirty=!0;else{var h=new
r.default.IndexBuffer(o.device,r.default.INDEX_FMT_UINT16,a,s,s.length);this._ibs[e
]={buffer:h,data:s,dirty:!1};var c=this._vbs[0];this._subMeshes[e]=new
n.default(c.buffer,h)}},setPrimitiveType:function(t,e){e=e||0,this._subMeshes[e]?
this._subMeshes[e]._primitiveType=t:cc.warn("Do not have sub mesh at index
"+e)},clear:function(){this._subMeshes.length=0;for(var
t=this._ibs,e=0;e<t.length;e++)t[e].buffer.destroy();t.length=0;for(var
i=this._vbs,n=0;n<i.length;n+
+)i[n].buffer.destroy();i.length=0},setBoundingBox:function(t,e)
{this._minPos=t,this._maxPos=e},destroy:function()
{this.clear()},_uploadData:function(){for(var t=this._vbs,e=0;e<t.length;e++){var
i=t[e];if(i.dirty){var
n=i.buffer,r=i.data;n._numVertices=r.byteLength/n._format._bytes,n._bytes=r.byteLen
gth,n.update(0,r),i.dirty=!1}}for(var s=this._ibs,a=0;a<s.length;a++){var
o=s[a];if(o.dirty){var
l=o.buffer,h=o.data;l._numIndices=h.length,l._bytes=h.byteLength,l.update(0,h),o.di
rty=!1}}}});cc.Mesh=e.exports=_}),{"../../renderer/core/input-
assembler":338,"../../renderer/gfx":348,"../event/event-
target":132,"../renderer":243,"./mesh-data":169}],167:[(function(t,e,i){"use
strict";var n=a(t("../geom-
utils")),r=a(t("../../renderer/gfx")),s=a(t("../assets/material/custom-
properties"));function a(t){return t&&t.__esModule?t:{default:t}}var
o=t("../components/CCRenderComponent"),l=t("./CCMesh"),h=t("../renderer/render-
flow"),c=t("../assets/material/CCMaterial"),u=cc.Enum({OFF:0,ON:1}),_=cc.Class({nam
e:"cc.MeshRenderer",extends:o,editor:!1,properties:{_mesh:
{default:null,type:l},_receiveShadows:!1,_shadowCastingMode:u.OFF,mesh:
{get:function(){return this._mesh},set:function(t){this._mesh!
==t&&(this._setMesh(t),t?(this.markForRender(!0),this._activateMaterial(!
0),this.markForUpdateRenderData(!0),this.node._renderFlag|
=h.FLAG_TRANSFORM):this.markForRender(!1))},type:l},textures:{default:
[],type:cc.Texture2D,visible:!1},receiveShadows:{get:function(){return
this._receiveShadows},set:function(t)
{this._receiveShadows=t,this._updateReceiveShadow()}},shadowCastingMode:
{get:function(){return this._shadowCastingMode},set:function(t)
{this._shadowCastingMode=t,this._updateCastShadow()},type:u}},statics:
{ShadowCastingMode:u},ctor:function()
{this._renderDatas=[],this._boundingBox=null,this._customProperties=new
s.default},onEnable:function()
{this._super(),this._setMesh(this._mesh),this._activateMaterial()},onDestroy:functi
on(){this._setMesh(null)},getRenderNode:function(){return
this.node},_setMesh:function(t){this._mesh&&this._mesh.off("init-
format",this._updateMeshAttribute,this),t&&t.on("init-
format",this._updateMeshAttribute,this),this._mesh=t},_getDefaultMaterial:function(
){return c.getBuiltinMaterial("unlit")},_activateMaterial:function(t){var
e=this._mesh;if(e&&0!==e.subMeshes.length)
{n.default&&(this._boundingBox=n.default.Aabb.fromPoints(n.default.Aabb.create(),e.
_minPos,e._maxPos));var
i=this.textures;if(i&&i.length>0)for(var r=0;r<i.length;r++){var
s=this.sharedMaterials[r];s||
((s=cc.Material.getInstantiatedMaterial(this._getDefaultMaterial(),this)).setProper
ty("diffuseTexture",i[r]),this.setMaterial(r,s))}var a=this.sharedMaterials;if(!
a[0]){var
o=this._getDefaultMaterial();a[0]=o}this._updateMeshAttribute(),this._updateReceive
Shadow(),this._updateCastShadow(),this.markForUpdateRenderData(!
0),this.markForRender(!0)}else
this.disableRender()},_updateReceiveShadow:function()
{this._customProperties.define("_USE_SHADOW_MAP",this._receiveShadows)},_updateCast
Shadow:function()
{this._customProperties.define("_SHADOW_CASTING",this._shadowCastingMode===u.ON)},_
updateMeshAttribute:function(){var t=this._mesh&&this._mesh.subMeshes;if(t){var
e=t[0]._vertexBuffer._format._attr2el;this._customProperties.define("_USE_ATTRIBUTE
_COLOR",!!
e[r.default.ATTR_COLOR]),this._customProperties.define("_USE_ATTRIBUTE_UV0",!!
e[r.default.ATTR_UV0]),this._customProperties.define("_USE_ATTRIBUTE_NORMAL",!!
e[r.default.ATTR_NORMAL])}}});cc.MeshRenderer=e.exports=_}),
{"../../renderer/gfx":348,"../assets/material/CCMaterial":75,"../assets/material/cu
stom-properties":76,"../components/CCRenderComponent":106,"../geom-
utils":137,"../renderer/render-flow":244,"./CCMesh":166}],168:[(function(t,e,i)
{"use strict";t("./CCMesh"),t("./CCMeshRenderer"),t("./mesh-renderer")}),
{"./CCMesh":166,"./CCMeshRenderer":167,"./mesh-renderer":170}],169:
[(function(t,e,i){"use strict";Object.defineProperty(i,"__esModule",{value:!
0}),i.Primitive=i.VertexBundle=i.VertexFormat=i.BufferRange=void 0;var
n=(function(t){return t&&t.__esModule?t:{default:t}})(t("../../renderer/gfx"));var