From 90b11604b71fca43bd5ebe4f68272bd967434c33 Mon Sep 17 00:00:00 2001 From: Dom Date: Wed, 3 Aug 2016 22:51:05 +0800 Subject: [PATCH] add support for percentage position of left,right,top,bottom,horizontalCenter and verticalCenter properties. --- build/eui/eui.d.ts | 102 ++++++++++--------- build/eui/eui.js | 84 +++++++++++---- build/eui/eui.min.js | 8 +- src/extension/eui/components/BitmapLabel.ts | 12 +-- src/extension/eui/components/Component.ts | 12 +-- src/extension/eui/components/EditableText.ts | 12 +-- src/extension/eui/components/Group.ts | 12 +-- src/extension/eui/components/Image.ts | 12 +-- src/extension/eui/components/Label.ts | 12 +-- src/extension/eui/core/UIComponent.ts | 79 +++++++++----- src/extension/eui/layouts/BasicLayout.ts | 58 +++++++---- 11 files changed, 253 insertions(+), 150 deletions(-) diff --git a/build/eui/eui.d.ts b/build/eui/eui.d.ts index 4b2d3ad9b6..74bb14354f 100644 --- a/build/eui/eui.d.ts +++ b/build/eui/eui.d.ts @@ -887,7 +887,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @language en_US * The horizontal distance in pixels from the right edge of the component to the @@ -909,7 +909,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @language en_US * The vertical distance in pixels from the top edge of the component to the @@ -931,7 +931,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @language en_US * The vertical distance in pixels from the bottom edge of the component to the @@ -953,7 +953,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @language en_US * The horizontal distance in pixels from the center of the component to the @@ -975,7 +975,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @language en_US * The vertical distance in pixels from the center of the component to the @@ -997,7 +997,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @language en_US * Specifies the width of a component as a percentage @@ -1594,32 +1594,32 @@ declare module eui.sys { * @private * 距父级容器离左边距离 */ - left: number; + left: number | string; /** * @private * 距父级容器右边距离 */ - right: number; + right: number | string; /** * @private * 距父级容器顶部距离 */ - top: number; + top: number | string; /** * @private * 距父级容器底部距离 */ - bottom: number; + bottom: number | string; /** * @private * 在父级容器中距水平中心位置的距离 */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @private * 在父级容器中距竖直中心位置的距离 */ - verticalCenter: number; + verticalCenter: number | string; /** * @private * 相对父级容器宽度的百分比 @@ -1975,7 +1975,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @copy eui.UIComponent#right * @@ -1983,7 +1983,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @copy eui.UIComponent#top * @@ -1991,7 +1991,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @copy eui.UIComponent#bottom * @@ -1999,7 +1999,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @copy eui.UIComponent#horizontalCenter * @@ -2007,7 +2007,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @copy eui.UIComponent#verticalCenter * @@ -2015,7 +2015,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @copy eui.UIComponent#percentWidth * @@ -2619,7 +2619,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @inheritDoc * @@ -2627,7 +2627,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @inheritDoc * @@ -2635,7 +2635,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @inheritDoc * @@ -2643,7 +2643,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @inheritDoc * @@ -2651,7 +2651,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @inheritDoc * @@ -2659,7 +2659,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @inheritDoc * @@ -3751,7 +3751,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @inheritDoc * @@ -3759,7 +3759,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @inheritDoc * @@ -3767,7 +3767,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @inheritDoc * @@ -3775,7 +3775,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @inheritDoc * @@ -3783,7 +3783,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @inheritDoc * @@ -3791,7 +3791,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @inheritDoc * @@ -4688,7 +4688,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @inheritDoc * @@ -4696,7 +4696,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @inheritDoc * @@ -4704,7 +4704,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @inheritDoc * @@ -4712,7 +4712,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @inheritDoc * @@ -4720,7 +4720,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @inheritDoc * @@ -4728,7 +4728,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @inheritDoc * @@ -6117,7 +6117,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @copy eui.UIComponent#right * @@ -6125,7 +6125,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @copy eui.UIComponent#top * @@ -6133,7 +6133,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @copy eui.UIComponent#bottom * @@ -6141,7 +6141,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @copy eui.UIComponent#horizontalCenter * @@ -6149,7 +6149,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @copy eui.UIComponent#verticalCenter * @@ -6157,7 +6157,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @copy eui.UIComponent#percentWidth * @@ -6667,7 +6667,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - left: number; + left: number | string; /** * @copy eui.UIComponent#right * @@ -6675,7 +6675,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - right: number; + right: number | string; /** * @copy eui.UIComponent#top * @@ -6683,7 +6683,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - top: number; + top: number | string; /** * @copy eui.UIComponent#bottom * @@ -6691,7 +6691,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - bottom: number; + bottom: number | string; /** * @copy eui.UIComponent#horizontalCenter * @@ -6699,7 +6699,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter: number; + horizontalCenter: number | string; /** * @copy eui.UIComponent#verticalCenter * @@ -6707,7 +6707,7 @@ declare module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter: number; + verticalCenter: number | string; /** * @copy eui.UIComponent#percentWidth * @@ -12958,6 +12958,12 @@ declare module eui { } } declare module eui.sys { + /** + * @private + * @param value 要格式化的相对值 + * @param total 在此值方向上的总长度 + */ + function formatRelative(value: number | string, total: number): number; /** * @private * 一个工具方法,使用BasicLayout规则测量目标对象。 diff --git a/build/eui/eui.js b/build/eui/eui.js index 2ad17c38d9..00f83e0b62 100644 --- a/build/eui/eui.js +++ b/build/eui/eui.js @@ -1876,7 +1876,12 @@ var eui; return this.$UIComponent[0 /* left */]; } ,function (value) { - value = +value; + if (!value || typeof value == "number") { + value = +value; + } + else { + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[0 /* left */] === value) return; @@ -1893,7 +1898,12 @@ var eui; return this.$UIComponent[1 /* right */]; } ,function (value) { - value = +value; + if (!value || typeof value == "number") { + value = +value; + } + else { + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[1 /* right */] === value) return; @@ -1910,7 +1920,12 @@ var eui; return this.$UIComponent[2 /* top */]; } ,function (value) { - value = +value; + if (!value || typeof value == "number") { + value = +value; + } + else { + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[2 /* top */] === value) return; @@ -1927,7 +1942,12 @@ var eui; return this.$UIComponent[3 /* bottom */]; } ,function (value) { - value = +value; + if (!value || typeof value == "number") { + value = +value; + } + else { + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[3 /* bottom */] == value) return; @@ -1944,7 +1964,12 @@ var eui; return this.$UIComponent[4 /* horizontalCenter */]; } ,function (value) { - value = +value; + if (!value || typeof value == "number") { + value = +value; + } + else { + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[4 /* horizontalCenter */] === value) return; @@ -1961,7 +1986,12 @@ var eui; return this.$UIComponent[5 /* verticalCenter */]; } ,function (value) { - value = +value; + if (!value || typeof value == "number") { + value = +value; + } + else { + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[5 /* verticalCenter */] === value) return; @@ -20528,6 +20558,24 @@ var eui; var sys; (function (sys) { var UIComponentClass = "eui.UIComponent"; + /** + * @private + * @param value 要格式化的相对值 + * @param total 在此值方向上的总长度 + */ + function formatRelative(value, total) { + if (!value || typeof value == "number") { + return value; + } + var str = value; + var index = str.indexOf("%"); + if (index == -1) { + return +str; + } + var percent = +str.substring(0, index); + return percent * 0.01 * total; + } + sys.formatRelative = formatRelative; /** * @private * 一个工具方法,使用BasicLayout规则测量目标对象。 @@ -20546,12 +20594,12 @@ var eui; continue; } var values = layoutElement.$UIComponent; - var hCenter = values[4 /* horizontalCenter */]; - var vCenter = values[5 /* verticalCenter */]; - var left = values[0 /* left */]; - var right = values[1 /* right */]; - var top = values[2 /* top */]; - var bottom = values[3 /* bottom */]; + var hCenter = +values[4 /* horizontalCenter */]; + var vCenter = +values[5 /* verticalCenter */]; + var left = +values[0 /* left */]; + var right = +values[1 /* right */]; + var top = +values[2 /* top */]; + var bottom = +values[3 /* bottom */]; var extX; var extY; layoutElement.getPreferredBounds(bounds); @@ -20606,12 +20654,12 @@ var eui; continue; } var values = layoutElement.$UIComponent; - var hCenter = values[4 /* horizontalCenter */]; - var vCenter = values[5 /* verticalCenter */]; - var left = values[0 /* left */]; - var right = values[1 /* right */]; - var top = values[2 /* top */]; - var bottom = values[3 /* bottom */]; + var hCenter = formatRelative(values[4 /* horizontalCenter */], unscaledWidth); + var vCenter = formatRelative(values[5 /* verticalCenter */], unscaledHeight); + var left = formatRelative(values[0 /* left */], unscaledWidth); + var right = formatRelative(values[1 /* right */], unscaledWidth); + var top = formatRelative(values[2 /* top */], unscaledHeight); + var bottom = formatRelative(values[3 /* bottom */], unscaledHeight); var percentWidth = values[6 /* percentWidth */]; var percentHeight = values[7 /* percentHeight */]; var childWidth = NaN; diff --git a/build/eui/eui.min.js b/build/eui/eui.min.js index 81a1cc6a99..e28043b2ed 100644 --- a/build/eui/eui.min.js +++ b/build/eui/eui.min.js @@ -1,6 +1,6 @@ -var eui;!function(t){function e(e){for(var i=e[0],n=i instanceof t.Watcher?i.getValue():i,s=e.length,r=1;s>r;r++){var a=e[r];a instanceof t.Watcher&&(a=a.getValue()),n+=a}return n}var i=function(){function i(){}var n=(__define,i);n.prototype;return i.bindProperty=function(e,i,n,s){var r=t.Watcher.watch(e,i,null,null);if(r){var a=function(t){n[s]=t};r.setHandler(a,null),a(r.getValue())}return r},i.bindHandler=function(e,i,n,s){var r=t.Watcher.watch(e,i,n,s);return r&&n.call(s,r.getValue()),r},i.$bindProperties=function(n,s,r,a,o){if(1==s.length)return i.bindProperty(n,s[0].split("."),a,o);for(var h=function(){a[o]=e(s)},l=r.length,u=0;l>u;u++){var d=r[u],c=s[d].split("."),p=t.Watcher.watch(n,c,null,null);p&&(s[d]=p,p.setHandler(h,null))}return h(),p},i}();t.Binding=i,egret.registerClass(i,"eui.Binding")}(eui||(eui={}));var eui;!function(t){function e(t,i){var n=Object.getOwnPropertyDescriptor(t,i);if(n)return n;var s=Object.getPrototypeOf(t);return s?e(s,i):null}function i(t,e){for(var i=t[n],s=i.length,r=0;s>r;r+=2){var a=i[r],o=i[r+1];a.call(o,e)}}var n="__listeners__",s="__bindables__",r=0,a=function(){function a(t,e,i,n){this.isExecuting=!1,this.property=t,this.handler=e,this.next=n,this.thisObject=i}var o=(__define,a),h=o.prototype;return a.watch=function(t,e,i,n){if(e.length>0){var s=e.shift(),r=a.watch(null,e,i,n),o=new a(s,i,n,r);return o.reset(t),o}return null},a.checkBindable=function(a,o){var h=a[s];if(h&&-1!=h.indexOf(o))return!0;var l=egret.is(a,"egret.IEventDispatcher");l||a[n]||(a[n]=[]);var u=e(a,o);if(u&&u.set&&u.get){var d=u.set;u.set=function(e){this[o]!=e&&(d.call(this,e),l?t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,o):i(this,o))}}else{if(u&&(u.get||u.set))return!1;r++;var c="_"+r+o;a[c]=u?u.value:null,u={enumerable:!0,configurable:!0},u.get=function(){return this[c]},u.set=function(e){this[c]!=e&&(this[c]=e,l?t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,o):i(this,o))}}Object.defineProperty(a,o,u),t.registerBindable(a,o)},h.unwatch=function(){this.reset(null),this.handler=null,this.next&&(this.next.handler=null)},h.getValue=function(){return this.next?this.next.getValue():this.getHostPropertyValue()},h.setHandler=function(t,e){this.handler=t,this.thisObject=e,this.next&&this.next.setHandler(t,e)},h.reset=function(e){var i=this.host;if(i)if(egret.is(i,"egret.IEventDispatcher"))i.removeEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.wrapHandler,this);else{var s=i[n],r=s.indexOf(this);s.splice(r-1,2)}if(this.host=e,e)if(a.checkBindable(e,this.property),egret.is(e,"egret.IEventDispatcher"))e.addEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.wrapHandler,this,!1,100);else{var s=e[n];s.push(this.onPropertyChange),s.push(this)}this.next&&this.next.reset(this.getHostPropertyValue())},h.getHostPropertyValue=function(){return this.host?this.host[this.property]:null},h.wrapHandler=function(t){this.onPropertyChange(t.property)},h.onPropertyChange=function(t){if(t==this.property&&!this.isExecuting)try{this.isExecuting=!0,this.next&&this.next.reset(this.getHostPropertyValue()),this.handler.call(this.thisObject,this.getValue())}finally{this.isExecuting=!1}},a}();t.Watcher=a,egret.registerClass(a,"eui.Watcher")}(eui||(eui={}));var eui;!function(t){function e(t,e,i,n){var s=t.prototype;s.__meta__=s.__meta__||{},s.__meta__[e]=i,n&&(s.__defaultProperty__=e)}t.registerProperty=e}(eui||(eui={}));var eui;!function(t){function e(t,e){if(t.hasOwnProperty(i))t[i].push(e);else{var n=[e];t[i]&&(n=t[i].concat(n)),t[i]=n}}var i="__bindables__";t.registerBindable=e}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(t){e.call(this),t?this._source=t:this._source=[]}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"source",function(){return this._source},function(e){e||(e=[]),this._source=e,this.dispatchCoEvent(t.CollectionEventKind.RESET)}),r.refresh=function(){this.dispatchCoEvent(t.CollectionEventKind.REFRESH)},n(r,"length",function(){return this._source.length}),r.addItem=function(e){this._source.push(e),this.dispatchCoEvent(t.CollectionEventKind.ADD,this._source.length-1,-1,[e])},r.addItemAt=function(e,i){0>i||i>this._source.length,this._source.splice(i,0,e),this.dispatchCoEvent(t.CollectionEventKind.ADD,i,-1,[e])},r.getItemAt=function(t){return this._source[t]},r.getItemIndex=function(t){for(var e=this._source.length,i=0;e>i;i++)if(this._source[i]===t)return i;return-1},r.itemUpdated=function(e){var i=this.getItemIndex(e);-1!=i&&this.dispatchCoEvent(t.CollectionEventKind.UPDATE,i,-1,[e])},r.removeAll=function(){var e=this._source.concat();this._source.length=0,this.dispatchCoEvent(t.CollectionEventKind.REMOVE,0,-1,e)},r.removeItemAt=function(e){if(!(0>e||e>=this._source.length)){var i=this._source.splice(e,1)[0];return this.dispatchCoEvent(t.CollectionEventKind.REMOVE,e,-1,[i]),i}},r.replaceItemAt=function(e,i){if(!(0>i||i>=this._source.length)){var n=this._source.splice(i,1,e)[0];return this.dispatchCoEvent(t.CollectionEventKind.REPLACE,i,-1,[e],[n]),n}},r.replaceAll=function(t){t||(t=[]);for(var e=t.length,i=this._source.length,n=e;i>n;n++)this.removeItemAt(e);for(n=0;e>n;n++)n>=i?this.addItemAt(t[n],n):this.replaceItemAt(t[n],n);this._source=t},r.dispatchCoEvent=function(e,i,n,s,r){t.CollectionEvent.dispatchCollectionEvent(this,t.CollectionEvent.COLLECTION_CHANGE,e,i,n,s,r)},i}(egret.EventDispatcher);t.ArrayCollection=e,egret.registerClass(e,"eui.ArrayCollection",["eui.ICollection","egret.IEventDispatcher"]),t.registerProperty(e,"source","Array",!0)}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e=function(t){function e(){t.call(this),this.targetLevel=Number.POSITIVE_INFINITY,this.invalidatePropertiesFlag=!1,this.invalidateClientPropertiesFlag=!1,this.invalidatePropertiesQueue=new i,this.invalidateSizeFlag=!1,this.invalidateClientSizeFlag=!1,this.invalidateSizeQueue=new i,this.invalidateDisplayListFlag=!1,this.invalidateDisplayListQueue=new i,this.eventDisplay=new egret.Bitmap,this.listenersAttached=!1}__extends(e,t);var n=(__define,e),s=n.prototype;return s.invalidateProperties=function(t){this.invalidatePropertiesFlag||(this.invalidatePropertiesFlag=!0,this.listenersAttached||this.attachListeners()),this.targetLevel<=t.$nestLevel&&(this.invalidateClientPropertiesFlag=!0),this.invalidatePropertiesQueue.insert(t)},s.validateProperties=function(){for(var t=this.invalidatePropertiesQueue,e=t.shift();e;)e.$stage&&e.validateProperties(),e=t.shift();t.isEmpty()&&(this.invalidatePropertiesFlag=!1)},s.invalidateSize=function(t){this.invalidateSizeFlag||(this.invalidateSizeFlag=!0,this.listenersAttached||this.attachListeners()),this.targetLevel<=t.$nestLevel&&(this.invalidateClientSizeFlag=!0),this.invalidateSizeQueue.insert(t)},s.validateSize=function(){for(var t=this.invalidateSizeQueue,e=t.pop();e;)e.$stage&&e.validateSize(),e=t.pop();t.isEmpty()&&(this.invalidateSizeFlag=!1)},s.invalidateDisplayList=function(t){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.listenersAttached||this.attachListeners()),this.invalidateDisplayListQueue.insert(t)},s.validateDisplayList=function(){for(var t=this.invalidateDisplayListQueue,e=t.shift();e;)e.$stage&&e.validateDisplayList(),e=t.shift();t.isEmpty()&&(this.invalidateDisplayListFlag=!1)},s.attachListeners=function(){this.eventDisplay.addEventListener(egret.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this),this.eventDisplay.addEventListener(egret.Event.RENDER,this.doPhasedInstantiationCallBack,this),egret.sys.$invalidateRenderFlag=!0,this.listenersAttached=!0},s.doPhasedInstantiationCallBack=function(t){this.eventDisplay.removeEventListener(egret.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this),this.eventDisplay.removeEventListener(egret.Event.RENDER,this.doPhasedInstantiationCallBack,this),this.doPhasedInstantiation()},s.doPhasedInstantiation=function(){this.invalidatePropertiesFlag&&this.validateProperties(),this.invalidateSizeFlag&&this.validateSize(),this.invalidateDisplayListFlag&&this.validateDisplayList(),this.invalidatePropertiesFlag||this.invalidateSizeFlag||this.invalidateDisplayListFlag?this.attachListeners():this.listenersAttached=!1},s.validateClient=function(t){var e,i=!1,n=this.targetLevel;this.targetLevel===Number.POSITIVE_INFINITY&&(this.targetLevel=t.$nestLevel);for(var s=this.invalidatePropertiesQueue,r=this.invalidateSizeQueue,a=this.invalidateDisplayListQueue;!i;){for(i=!0,e=s.removeSmallestChild(t);e;)e.$stage&&e.validateProperties(),e=s.removeSmallestChild(t);for(s.isEmpty()&&(this.invalidatePropertiesFlag=!1),this.invalidateClientPropertiesFlag=!1,e=r.removeLargestChild(t);e;){if(e.$stage&&e.validateSize(),this.invalidateClientPropertiesFlag&&(e=s.removeSmallestChild(t))){s.insert(e),i=!1;break}e=r.removeLargestChild(t)}for(r.isEmpty()&&(this.invalidateSizeFlag=!1),this.invalidateClientPropertiesFlag=!1,this.invalidateClientSizeFlag=!1,e=a.removeSmallestChild(t);e;){if(e.$stage&&e.validateDisplayList(),this.invalidateClientPropertiesFlag&&(e=s.removeSmallestChild(t))){s.insert(e),i=!1;break}if(this.invalidateClientSizeFlag&&(e=r.removeLargestChild(t))){r.insert(e),i=!1;break}e=a.removeSmallestChild(t)}a.isEmpty()&&(this.invalidateDisplayListFlag=!1)}n===Number.POSITIVE_INFINITY&&(this.targetLevel=Number.POSITIVE_INFINITY)},e}(egret.EventDispatcher);t.Validator=e,egret.registerClass(e,"eui.sys.Validator");var i=function(){function t(){this.depthBins={},this.minDepth=0,this.maxDepth=-1}var e=(__define,t),i=e.prototype;return i.insert=function(t){var e=t.$nestLevel;this.maxDepththis.maxDepth&&(this.maxDepth=e));var i=this.depthBins[e];i||(i=this.depthBins[e]=new n),i.insert(t)},i.pop=function(){var t,e=this.minDepth;if(e<=this.maxDepth){for(var i=this.depthBins[this.maxDepth];!i||0===i.length;){if(this.maxDepth--,this.maxDepthe)return null;i=this.depthBins[this.minDepth]}for(t=i.pop();!(i&&0!=i.length||(this.minDepth++,this.minDepth>e));)i=this.depthBins[this.minDepth]}return t},i.removeLargestChild=function(t){for(var e=t.$hashCode,i=t.$nestLevel,n=this.maxDepth,s=i;n>=s;){var r=this.depthBins[n];if(r&&r.length>0){if(n===i){if(r.map[e])return r.remove(t),t}else{if(!egret.is(t,"egret.DisplayObjectContainer"))break;for(var a=r.items,o=r.length,h=0;o>h;h++){var l=a[h];if(t.contains(l))return r.remove(l),l}}n--}else if(n==this.maxDepth&&this.maxDepth--,n--,s>n)break}return null},i.removeSmallestChild=function(t){for(var e=t.$nestLevel,i=e,n=this.maxDepth,s=t.$hashCode;n>=i;){var r=this.depthBins[i];if(r&&r.length>0){if(i===e){if(r.map[s])return r.remove(t),t}else{if(!egret.is(t,"egret.DisplayObjectContainer"))break;for(var a=r.items,o=r.length,h=0;o>h;h++){var l=a[h];if(t.contains(l))return r.remove(l),l}}i++}else if(i==this.minDepth&&this.minDepth++,i++,i>n)break}return null},i.isEmpty=function(){return this.minDepth>this.maxDepth},t}();egret.registerClass(i,"DepthQueue");var n=function(){function t(){this.map={},this.items=[],this.length=0}var e=(__define,t),i=e.prototype;return i.insert=function(t){var e=t.$hashCode;this.map[e]||(this.map[e]=!0,this.length++,this.items.push(t))},i.pop=function(){var t=this.items.pop();return t&&(this.length--,0===this.length?this.map={}:this.map[t.$hashCode]=!1),t},i.remove=function(t){var e=this.items.indexOf(t);e>=0&&(this.items.splice(e,1),this.length--,0===this.length?this.map={}:this.map[t.$hashCode]=!1)},t}();egret.registerClass(n,"DepthBin")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e;!function(e){function i(t){return 1===t.a&&0===t.b&&0===t.c&&1===t.d}function n(t,e){if("function"!=typeof t[e])return!1;var i=t[e].toString(),n=i.indexOf("{"),s=i.lastIndexOf("}");return i=i.substring(n+1,s),""==i.trim()}function s(t,e){for(var i in e)"prototype"!=i&&e.hasOwnProperty(i)&&(t[i]=e[i]);for(var s=t.prototype,r=e.prototype,a=Object.keys(r),o=a.length,h=0;o>h;h++){var l=a[h];if("__meta__"!=l&&(!s.hasOwnProperty(l)||n(s,l))){var u=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(s,l,u)}}}function r(t,e,i){s(t,h);var n=t.prototype;n.$super=e.prototype,i&&(n.$childAdded=function(t,e){this.invalidateSize(),this.invalidateDisplayList()},n.$childRemoved=function(t,e){this.invalidateSize(),this.invalidateDisplayList()})}var a="eui.UIComponent",o=new e.Validator,h=function(n){function s(){n.call(this),this.initializeUIValues()}__extends(s,n);var r=__define,h=s,l=h.prototype;return l.initializeUIValues=function(){this.$UIComponent={0:0/0,1:0/0,2:0/0,3:0/0,4:0/0,5:0/0,6:0/0,7:0/0,8:0/0,9:0/0,10:0,11:0,12:0,13:1e5,14:0,15:1e5,16:0,17:0,18:0/0,19:0/0,20:0,21:0,22:0,23:0,24:!0,25:!0,26:!0,27:!1,28:!1,29:!1},this.$includeInLayout=!0,this.$touchEnabled=!0},l.createChildren=function(){},l.childrenCreated=function(){},l.commitProperties=function(){var e=this.$UIComponent;(e[22]!=e[10]||e[23]!=e[11])&&(this.dispatchEventWith(egret.Event.RESIZE),e[22]=e[10],e[23]=e[11]),(e[20]!=this.$getX()||e[21]!=this.$getY())&&(t.UIEvent.dispatchUIEvent(this,t.UIEvent.MOVE),e[20]=this.$getX(),e[21]=this.$getY())},l.measure=function(){},l.updateDisplayList=function(t,e){},r(l,"includeInLayout",function(){return this.$includeInLayout},function(t){t=!!t,this.$includeInLayout!==t&&(this.$includeInLayout=!0,this.invalidateParentLayout(),this.$includeInLayout=t)}),l.$onAddToStage=function(e,i){this.$super.$onAddToStage.call(this,e,i),this.checkInvalidateFlag();var n=this.$UIComponent;n[29]||(n[29]=!0,this.createChildren(),this.childrenCreated(),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CREATION_COMPLETE))},l.checkInvalidateFlag=function(t){var e=this.$UIComponent;e[24]&&o.invalidateProperties(this),e[25]&&o.invalidateSize(this),e[26]&&o.invalidateDisplayList(this)},r(l,"left",function(){return this.$UIComponent[0]},function(t){t=+t;var e=this.$UIComponent;e[0]!==t&&(e[0]=t,this.invalidateParentLayout())}),r(l,"right",function(){return this.$UIComponent[1]},function(t){t=+t;var e=this.$UIComponent;e[1]!==t&&(e[1]=t,this.invalidateParentLayout())}),r(l,"top",function(){return this.$UIComponent[2]},function(t){t=+t;var e=this.$UIComponent;e[2]!==t&&(e[2]=t,this.invalidateParentLayout())}),r(l,"bottom",function(){return this.$UIComponent[3]},function(t){t=+t;var e=this.$UIComponent;e[3]!=t&&(e[3]=t,this.invalidateParentLayout())}),r(l,"horizontalCenter",function(){return this.$UIComponent[4]},function(t){t=+t;var e=this.$UIComponent;e[4]!==t&&(e[4]=t,this.invalidateParentLayout())}),r(l,"verticalCenter",function(){return this.$UIComponent[5]},function(t){t=+t;var e=this.$UIComponent;e[5]!==t&&(e[5]=t,this.invalidateParentLayout())}),r(l,"percentWidth",function(){return this.$UIComponent[6]},function(t){t=+t;var e=this.$UIComponent;e[6]!==t&&(e[6]=t,this.invalidateParentLayout())}),r(l,"percentHeight",function(){return this.$UIComponent[7]},function(t){t=+t;var e=this.$UIComponent;e[7]!==t&&(e[7]=t,this.invalidateParentLayout())}),r(l,"explicitWidth",function(){return this.$UIComponent[8]}),r(l,"explicitHeight",function(){return this.$UIComponent[9]}),l.$getWidth=function(){return this.validateSizeNow(),this.$UIComponent[10]},l.$setWidth=function(t){t=+t;var e=this.$UIComponent;return 0>t||e[10]===t&&e[8]===t?!1:(e[8]=t,isNaN(t)&&this.invalidateSize(),this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentLayout(),!0)},l.validateSizeNow=function(){this.validateSize(!0),this.updateFinalSize()},l.$getHeight=function(){return this.validateSizeNow(),this.$UIComponent[11]},l.$setHeight=function(t){t=+t;var e=this.$UIComponent;return 0>t||e[11]===t&&e[9]===t?!1:(e[9]=t,isNaN(t)&&this.invalidateSize(),this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentLayout(),!0)},l.$setScaleX=function(t){var e=this.$super.$setScaleX.call(this,t);return e&&this.invalidateParentLayout(),e},l.$setScaleY=function(t){var e=this.$super.$setScaleY.call(this,t);return e&&this.invalidateParentLayout(),e},r(l,"minWidth",function(){return this.$UIComponent[12]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[12]===t||(e[12]=t,this.invalidateSize(),this.invalidateParentLayout())}),r(l,"maxWidth",function(){return this.$UIComponent[13]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[13]===t||(e[13]=t,this.invalidateSize(),this.invalidateParentLayout())}),r(l,"minHeight",function(){return this.$UIComponent[14]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[14]===t||(e[14]=t,this.invalidateSize(),this.invalidateParentLayout())}),r(l,"maxHeight",function(){return this.$UIComponent[15]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[15]===t||(e[15]=t,this.invalidateSize(),this.invalidateParentLayout())}),l.setMeasuredSize=function(t,e){var i=this.$UIComponent;i[16]=Math.ceil(+t||0),i[17]=Math.ceil(+e||0)},l.setActualSize=function(t,e){var i=!1,n=this.$UIComponent;n[10]!==t&&(n[10]=t,i=!0),n[11]!==e&&(n[11]=e,i=!0),i&&(this.invalidateDisplayList(),this.dispatchEventWith(egret.Event.RESIZE))},l.$setX=function(t){var e=this.$super.$setX.call(this,t);return e&&(this.invalidateParentLayout(),this.invalidateProperties()),e},l.$setY=function(t){var e=this.$super.$setY.call(this,t);return e&&(this.invalidateParentLayout(),this.invalidateProperties()),e},l.invalidateProperties=function(){var t=this.$UIComponent;t[24]||(t[24]=!0,this.$stage&&o.invalidateProperties(this))},l.validateProperties=function(){var t=this.$UIComponent;t[24]&&(this.commitProperties(),t[24]=!1)},l.invalidateSize=function(){var t=this.$UIComponent;t[25]||(t[25]=!0,this.$stage&&o.invalidateSize(this))},l.validateSize=function(t){if(t){var e=this.$children;if(e)for(var i=e.length,n=0;i>n;n++){var s=e[n];egret.is(s,a)&&s.validateSize(!0)}}var r=this.$UIComponent;if(r[25]){var o=this.measureSizes();o&&(this.invalidateDisplayList(),this.invalidateParentLayout()),r[25]=!1}},l.measureSizes=function(){var t=!1,e=this.$UIComponent;if(!e[25])return t;(isNaN(e[8])||isNaN(e[9]))&&(this.measure(),e[16]e[13]&&(e[16]=e[13]),e[17]e[15]&&(e[17]=e[15]));var i=this.getPreferredUWidth(),n=this.getPreferredUHeight();return(i!==e[18]||n!==e[19])&&(e[18]=i,e[19]=n,t=!0),t},l.invalidateDisplayList=function(){var t=this.$UIComponent;t[26]||(t[26]=!0,this.$stage&&o.invalidateDisplayList(this))},l.validateDisplayList=function(){var t=this.$UIComponent;t[26]&&(this.updateFinalSize(),this.updateDisplayList(t[10],t[11]),t[26]=!1)},l.updateFinalSize=function(){var t=0,e=0,i=this.$UIComponent;t=i[27]?i[10]:isNaN(i[8])?i[16]:i[8],e=i[28]?i[11]:isNaN(i[9])?i[17]:i[9],this.setActualSize(t,e)},l.validateNow=function(){this.$stage&&o.validateClient(this)},l.invalidateParentLayout=function(){var t=this.$parent;t&&this.$includeInLayout&&egret.is(t,a)&&(t.invalidateSize(),t.invalidateDisplayList())},l.setLayoutBoundsSize=function(t,n){if(n=+n,t=+t,!(0>n||0>t)){var s,r,a=this.$UIComponent,o=a[13],h=a[15],l=Math.min(a[12],o),u=Math.min(a[14],h);isNaN(t)?(a[27]=!1,s=this.getPreferredUWidth()):(a[27]=!0,s=Math.max(l,Math.min(o,t))),isNaN(n)?(a[28]=!1,r=this.getPreferredUHeight()):(a[28]=!0,r=Math.max(u,Math.min(h,n)));var d=this.$getMatrix();if(i(d))return void this.setActualSize(s,r);var c=e.MatrixUtil.fitBounds(t,n,d,a[8],a[9],this.getPreferredUWidth(),this.getPreferredUHeight(),l,u,o,h);c||(c=egret.Point.create(l,u)),this.setActualSize(c.x,c.y),egret.Point.release(c)}},l.setLayoutBoundsPosition=function(e,n){var s=this.$getMatrix();if(!i(s)){var r=egret.$TempRectangle;this.getLayoutBounds(r),e+=this.$getX()-r.x,n+=this.$getY()-r.y}var a=this.$super.$setX.call(this,e);(this.$super.$setY.call(this,n)||a)&&t.UIEvent.dispatchUIEvent(this,t.UIEvent.MOVE)},l.getLayoutBounds=function(t){var e,i=this.$UIComponent;e=i[27]?i[10]:isNaN(i[8])?i[16]:i[8];var n;n=i[28]?i[11]:isNaN(i[9])?i[17]:i[9],this.applyMatrix(t,e,n)},l.getPreferredUWidth=function(){var t=this.$UIComponent;return isNaN(t[8])?t[16]:t[8]},l.getPreferredUHeight=function(){var t=this.$UIComponent;return isNaN(t[9])?t[17]:t[9]},l.getPreferredBounds=function(t){var e=this.getPreferredUWidth(),i=this.getPreferredUHeight();this.applyMatrix(t,e,i)},l.applyMatrix=function(t,e,n){var t=t.setTo(0,0,e,n),s=this.$getMatrix();i(s)?(t.x+=s.tx,t.y+=s.ty):s.$transformBounds(t)},s}(egret.DisplayObject);e.UIComponentImpl=h,egret.registerClass(h,"eui.sys.UIComponentImpl",["eui.UIComponent"]),e.mixin=s,e.implementUIComponent=r}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=t.sys.UIComponentImpl,i=function(i){function n(t){i.call(this),this.$createChildrenCalled=!1,this.$fontChanged=!1,this._widthConstraint=0/0,this.initializeUIValues(),this.text=t}__extends(n,i);var s=(__define,n),r=s.prototype;return r.$invalidateContentBounds=function(){i.prototype.$invalidateContentBounds.call(this),this.invalidateSize()},r.$setWidth=function(t){var n=i.prototype.$setWidth.call(this,t),s=e.prototype.$setWidth.call(this,t);return n&&s},r.$setHeight=function(t){var n=i.prototype.$setHeight.call(this,t),s=e.prototype.$setHeight.call(this,t);return n&&s},r.$setText=function(e){var n=i.prototype.$setText.call(this,e);return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"text"),n},r.$setFont=function(t){this.$BitmapText;return this.$font==t?!1:(this.$font=t,this.$createChildrenCalled?this.$parseFont():this.$fontChanged=!0,this.$BitmapText[6]=!0,!0)},r.$parseFont=function(){if(this.$fontChanged=!1,this.$font&&"string"==typeof this.$font){var e=this.$stage.getImplementation("eui.IAssetAdapter");e||(e=new t.DefaultAssetAdapter),e.getAsset(this.$font,this.$onFontChanged,this)}else this.$setFontData(this.$font)},r.$onFontChanged=function(t,e){e===this.$font&&this.$setFontData(t)},r.$setFontData=function(t){return t==this.$BitmapText[5]?!1:(this.$BitmapText[5]=t,this.$invalidateContentBounds(),!0)},r.createChildren=function(){this.$fontChanged&&this.$parseFont(),this.$createChildrenCalled=!0},r.childrenCreated=function(){},r.commitProperties=function(){},r.measure=function(){var t=this.$UIComponent,e=this.$BitmapText,n=e[0],s=0/0;isNaN(this._widthConstraint)?isNaN(t[8])?1e5!=t[13]&&(s=t[13]):s=t[8]:(s=this._widthConstraint,this._widthConstraint=0/0),i.prototype.$setWidth.call(this,s),this.setMeasuredSize(this.textWidth,this.textHeight),i.prototype.$setWidth.call(this,n)},r.updateDisplayList=function(t,e){i.prototype.$setWidth.call(this,t),i.prototype.$setHeight.call(this,e)},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,i){if(e.prototype.setLayoutBoundsSize.call(this,t,i),!isNaN(t)&&t!==this._widthConstraint&&0!=t){var n=this.$UIComponent;isNaN(n[9])&&t!=n[16]&&(this._widthConstraint=t,this.invalidateSize())}},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},n}(egret.BitmapText);t.BitmapLabel=i,egret.registerClass(i,"eui.BitmapLabel",["eui.UIComponent","eui.IDisplayText"]),t.sys.implementUIComponent(i,egret.BitmapText),t.registerBindable(i.prototype,"text")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.initializeUIValues(),this.$Component={0:null,1:null,2:"",3:!0,4:!1,5:!1,6:!0,7:!0,8:null},this.$touchEnabled=!0}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"hostComponentKey",function(){return this.$Component[0]},function(t){this.$Component[0]=t}),n(r,"skinName",function(){return this.$Component[1]},function(t){var e=this.$Component;if(e[5]=!0,e[1]!=t){if(t)e[1]=t;else if(this.$stage){var i=this.$stage.getImplementation("eui.Theme");if(i){var n=i.getSkinName(this);n&&(e[1]=n)}}this.$parseSkinName()}}),r.$parseSkinName=function(){var t,e=this.skinName;if(e)if(e.prototype)t=new e;else if("string"==typeof e){var i,n=e.trim();if("<"==n.charAt(0))i=EXML.parse(n);else if(i=egret.getDefinitionByName(e),!i&&-1!=n.toLowerCase().indexOf(".exml"))return void EXML.load(e,this.onExmlLoaded,this,!0);i&&(t=new i)}else t=e;this.setSkin(t)},r.onExmlLoaded=function(t,e){if(this.skinName==e){var i=new t;this.setSkin(i)}},n(r,"skin",function(){return this.$Component[8]}),r.setSkin=function(e){!e||e instanceof t.Skin||(e=null);var i=this.$Component,n=i[8];if(n){for(var s=n.skinParts,r=s.length,a=0;r>a;a++){var o=s[a];this[o]&&this.setSkinPart(o,null)}var h=n.$elementsContent;if(h){r=h.length;for(var a=0;r>a;a++){var l=h[a];l.$parent==this&&this.removeChild(l)}}n.hostComponent=null}if(i[8]=e,e){for(var s=e.skinParts,r=s.length,a=0;r>a;a++){var o=s[a],u=e[o];u&&this.setSkinPart(o,u)}if(h=e.$elementsContent)for(a=h.length-1;a>=0;a--)this.addChildAt(h[a],0);e.hostComponent=this}this.invalidateSize(),this.invalidateDisplayList(),this.dispatchEventWith(egret.Event.COMPLETE)},r.setSkinPart=function(t,e){var i=this[t];i&&this.partRemoved(t,i),this[t]=e,e&&this.partAdded(t,e)},r.partAdded=function(t,e){},r.partRemoved=function(t,e){},r.$setTouchChildren=function(t){t=!!t;var i=this.$Component;return i[6]=t,i[3]?(i[6]=t,e.prototype.$setTouchChildren.call(this,t)):!0},r.$setTouchEnabled=function(t){t=!!t;var i=this.$Component;return i[7]=t,i[3]?e.prototype.$setTouchEnabled.call(this,t):!0},n(r,"enabled",function(){return this.$Component[3]},function(t){t=!!t,this.$setEnabled(t)}),r.$setEnabled=function(t){var e=this.$Component;return t===e[3]?!1:(e[3]=t,t?(this.$touchEnabled=e[7],this.$touchChildren=e[6]):(this.$touchEnabled=!1,this.$touchChildren=!1),this.invalidateState(),!0)},n(r,"currentState",function(){var t=this.$Component;return t[2]?t[2]:this.getCurrentState()},function(t){var e=this.$Component;t!=e[2]&&(e[2]=t,this.invalidateState())}),r.invalidateState=function(){var t=this.$Component;t[4]||(t[4]=!0,this.invalidateProperties())},r.getCurrentState=function(){return""},r.createChildren=function(){var t=this.$Component;if(!t[1]){var e=this.$stage.getImplementation("eui.Theme");if(e){var i=e.getSkinName(this);i&&(t[1]=i,this.$parseSkinName())}}},r.childrenCreated=function(){},r.commitProperties=function(){t.sys.UIComponentImpl.prototype.commitProperties.call(this);var e=this.$Component;e[4]&&(e[4]=!1,e[8]&&(e[8].currentState=this.currentState))},r.measure=function(){t.sys.measure(this);var e=this.$Component[8];if(e){var i=this.$UIComponent;isNaN(e.width)?(i[16]e.maxWidth&&(i[16]=e.maxWidth)):i[16]=e.width,isNaN(e.height)?(i[17]e.maxHeight&&(i[17]=e.maxHeight)):i[17]=e.height}},r.updateDisplayList=function(e,i){t.sys.updateDisplayList(this,e,i)},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,e){},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},i}(egret.DisplayObjectContainer);t.Component=e,egret.registerClass(e,"eui.Component",["eui.UIComponent"]),t.registerProperty(e,"skinName","Class"),t.sys.implementUIComponent(e,egret.DisplayObjectContainer,!0)}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this),this.labelDisplay=null,this._label="",this.iconDisplay=null,this._icon=null,this.touchCaptured=!1,this.touchChildren=!1,this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this)}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"label",function(){return this._label},function(t){this._label=t,this.labelDisplay&&(this.labelDisplay.text=t)}),i(s,"icon",function(){return this._icon},function(t){this._icon=t,this.iconDisplay&&(this.iconDisplay.source=t)}),s.onTouchCancle=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.touchCaptured=!1,this.invalidateState()},s.onTouchBegin=function(t){this.$stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.touchCaptured=!0,this.invalidateState(),t.updateAfterEvent()},s.onStageTouchEnd=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.contains(t.target)&&this.buttonReleased(),this.touchCaptured=!1,this.invalidateState()},s.getCurrentState=function(){return this.enabled?this.touchCaptured?"down":"up":"disabled"},s.partAdded=function(t,e){e===this.labelDisplay?this.labelDisplay.text=this._label:e==this.iconDisplay&&(this.iconDisplay.source=this._icon)},s.buttonReleased=function(){},e}(t.Component);t.Button=e,egret.registerClass(e,"eui.Button")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.apply(this,arguments),this.$selected=!1,this.$autoSelected=!0}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"selected",function(){return this.$selected},function(t){this.$setSelected(t)}),r.$setSelected=function(e){return e=!!e,e===this.$selected?!1:(this.$selected=e,this.invalidateState(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selected"),!0)},r.getCurrentState=function(){var t=e.prototype.getCurrentState.call(this);if(this.$selected){var i=t+"AndSelected",n=this.skin;return n&&n.hasState(i)?i:"disabled"==t?"disabled":"down"}return t},r.buttonReleased=function(){this.$autoSelected&&(this.selected=!this.$selected,this.dispatchEventWith(egret.Event.CHANGE))},i}(t.Button);t.ToggleButton=e,egret.registerClass(e,"eui.ToggleButton"),t.registerBindable(e.prototype,"selected")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this)}__extends(e,t);var i=(__define,e);i.prototype;return e}(t.ToggleButton);t.CheckBox=e,egret.registerClass(e,"eui.CheckBox")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(t,i){void 0===i&&(i=[]),e.call(this),this.name=t,this.overrides=i}__extends(i,e);var n=(__define,i),s=n.prototype;return s.initialize=function(e,i){for(var n=this.overrides,s=n.length,r=0;s>r;r++){var a=n[r];if(a instanceof t.AddItems){var o=e[a.target];o&&o instanceof t.Image&&!o.$parent&&(i.addChild(o),i.removeChild(o))}}},i}(egret.HashObject);t.State=e,egret.registerClass(e,"eui.State")}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e=function(){function t(){}var e=__define,i=t,n=i.prototype;return e(n,"states",function(){return this.$stateValues.states},function(t){t||(t=[]);var e=this.$stateValues;e.states=t;for(var i={},n=t.length,s=0;n>s;s++){var r=t[s];i[r.name]=r}e.statesMap=i,e.parent&&this.commitCurrentState()}),e(n,"currentState",function(){return this.$stateValues.currentState},function(t){var e=this.$stateValues;e.explicitState=t,e.currentState=t,this.commitCurrentState()}),n.commitCurrentState=function(){var t=this.$stateValues;if(t.parent){var e=t.statesMap[t.currentState];if(!e){if(!(t.states.length>0))return;t.currentState=t.states[0].name}if(t.oldState!=t.currentState){var i=t.parent,n=t.statesMap[t.oldState];if(n)for(var s=n.overrides,r=s.length,a=0;r>a;a++)s[a].remove(this,i);if(t.oldState=t.currentState,n=t.statesMap[t.currentState])for(s=n.overrides,r=s.length,a=0;r>a;a++)s[a].apply(this,i)}}},n.hasState=function(t){return!!this.$stateValues.statesMap[t]},n.initializeStates=function(t){this.$stateValues.intialized=!0;for(var e=this.states,i=e.length,n=0;i>n;n++)e[n].initialize(this,t) -},t}();t.StateClient=e,egret.registerClass(e,"eui.sys.StateClient");var i=function(){function t(){this.intialized=!1,this.statesMap={},this.states=[],this.oldState=null,this.explicitState=null,this.currentState=null,this.parent=null,this.stateIsDirty=!1}var e=(__define,t);e.prototype;return t}();t.StateValues=i,egret.registerClass(i,"eui.sys.StateValues")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$layout=null,this.$stateValues=new t.sys.StateValues,this.initializeUIValues(),this.$Group={0:0,1:0,2:0,3:0,4:!1,5:!1},this.$stateValues.parent=this}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"elementsContent",void 0,function(t){if(t)for(var e=t.length,i=0;e>i;i++)this.addChild(t[i])}),n(r,"layout",function(){return this.$layout},function(t){this.$setLayout(t)}),r.$setLayout=function(t){return this.$layout==t?!1:(this.$layout&&(this.$layout.target=null),this.$layout=t,t&&(t.target=this),this.invalidateSize(),this.invalidateDisplayList(),!0)},n(r,"contentWidth",function(){return this.$Group[0]}),n(r,"contentHeight",function(){return this.$Group[1]}),r.setContentSize=function(e,i){e=Math.ceil(+e||0),i=Math.ceil(+i||0);var n=this.$Group,s=n[0]!==e,r=n[1]!==i;(s||r)&&(n[0]=e,n[1]=i,s&&t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"contentWidth"),r&&t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"contentHeight"))},n(r,"scrollEnabled",function(){return this.$Group[4]},function(t){t=!!t;var e=this.$Group;t!==e[4]&&(e[4]=t,this.updateScrollRect())}),n(r,"scrollH",function(){return this.$Group[2]},function(e){e=+e||0;var i=this.$Group;e!==i[2]&&(i[2]=e,this.updateScrollRect()&&this.$layout&&this.$layout.scrollPositionChanged(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"scrollH"))}),n(r,"scrollV",function(){return this.$Group[3]},function(e){e=+e||0;var i=this.$Group;e!=i[3]&&(i[3]=e,this.updateScrollRect()&&this.$layout&&this.$layout.scrollPositionChanged(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"scrollV"))}),r.updateScrollRect=function(){var t=this.$Group,e=t[4];if(e){var i=this.$UIComponent;this.scrollRect=egret.$TempRectangle.setTo(t[2],t[3],i[10],i[11])}else this.$scrollRect&&(this.scrollRect=null);return e},n(r,"numElements",function(){return this.$children.length}),r.getElementAt=function(t){return this.$children[t]},r.getVirtualElementAt=function(t){return this.getElementAt(t)},r.setVirtualElementIndicesInView=function(t,e){},n(r,"touchThrough",function(){return this.$Group[5]},function(t){this.$Group[5]=!!t}),r.$hitTest=function(t,i){var n=e.prototype.$hitTest.call(this,t,i);if(n||this.$Group[5])return n;if(!this.$visible||!this.touchEnabled)return null;var s=this.globalToLocal(t,i,egret.$TempPoint),r=this.$UIComponent,a=egret.$TempRectangle.setTo(0,0,r[10],r[11]),o=this.$scrollRect;return o&&(a.x=o.x,a.y=o.y),a.contains(s.x,s.y)?this:null},r.invalidateState=function(){var t=this.$stateValues;t.stateIsDirty||(t.stateIsDirty=!0,this.invalidateProperties())},r.getCurrentState=function(){return""},r.createChildren=function(){this.$layout||this.$setLayout(new t.BasicLayout),this.initializeStates(this.$stage)},r.childrenCreated=function(){},r.commitProperties=function(){t.sys.UIComponentImpl.prototype.commitProperties.call(this);var e=this.$stateValues;e.stateIsDirty&&(e.stateIsDirty=!1,e.explicitState||(e.currentState=this.getCurrentState(),this.commitCurrentState()))},r.measure=function(){return this.$layout?void this.$layout.measure():void this.setMeasuredSize(0,0)},r.updateDisplayList=function(t,e){this.$layout&&this.$layout.updateDisplayList(t,e),this.updateScrollRect()},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,e){},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},i}(egret.DisplayObjectContainer);t.Group=e,egret.registerClass(e,"eui.Group",["eui.IViewport","eui.UIComponent"]),t.sys.implementUIComponent(e,egret.DisplayObjectContainer,!0),t.sys.mixin(e,t.sys.StateClient),t.registerProperty(e,"elementsContent","Array",!0),t.registerProperty(e,"states","State[]")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$dataProviderChanged=!1,this.$dataProvider=null,this.$indexToRenderer=[],this.$DataGroup={0:!0,1:!1,2:{},3:{},4:!1,5:!1,6:null,7:null,8:!1,9:null,10:!1,11:!1,12:null,13:null,14:!1}}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"useVirtualLayout",function(){return this.$layout?this.$layout.$useVirtualLayout:this.$DataGroup[0]},function(t){t=!!t;var e=this.$DataGroup;t!==e[0]&&(e[0]=t,this.$layout&&(this.$layout.useVirtualLayout=t))}),r.$setLayout=function(t){if(t==this.$layout)return!1;this.$layout&&(this.$layout.setTypicalSize(0,0),this.$layout.removeEventListener("useVirtualLayoutChanged",this.onUseVirtualLayoutChanged,this)),this.$layout&&t&&this.$layout.$useVirtualLayout!=t.$useVirtualLayout&&this.onUseVirtualLayoutChanged();var i=e.prototype.$setLayout.call(this,t);if(t){var n=this.$DataGroup[9];n&&t.setTypicalSize(n.width,n.height),t.useVirtualLayout=this.$DataGroup[0],t.addEventListener("useVirtualLayoutChanged",this.onUseVirtualLayoutChanged,this)}return i},r.onUseVirtualLayoutChanged=function(t){var e=this.$DataGroup;e[1]=!0,e[10]=!0,this.removeDataProviderListener(),this.invalidateProperties()},r.setVirtualElementIndicesInView=function(t,e){if(this.$layout&&this.$layout.$useVirtualLayout)for(var i=this.$indexToRenderer,n=Object.keys(i),s=n.length,r=0;s>r;r++){var a=+n[r];(t>a||a>e)&&this.freeRendererByIndex(a)}},r.getElementAt=function(t){return this.$indexToRenderer[t]},r.getVirtualElementAt=function(t){if(t=0|+t,0>t||t>=this.$dataProvider.length)return null;var e=this.$indexToRenderer[t];if(!e){var i=this.$dataProvider.getItemAt(t);e=this.createVirtualRenderer(i),this.$indexToRenderer[t]=e,this.updateRenderer(e,t,i);var n=this.$DataGroup;n[4]&&(e.validateNow(),n[4]=!1,this.rendererAdded(e,t,i))}return e},r.freeRendererByIndex=function(t){var e=this.$indexToRenderer[t];e&&(delete this.$indexToRenderer[t],this.doFreeRenderer(e))},r.doFreeRenderer=function(t){var e=this.$DataGroup,i=e[2][t.$hashCode],n=i.$hashCode;e[3][n]||(e[3][n]=[]),e[3][n].push(t),t.visible=!1},r.invalidateSize=function(){this.$DataGroup[4]||e.prototype.invalidateSize.call(this)},r.createVirtualRenderer=function(t){var e,i=this.itemToRendererClass(t),n=i.$hashCode,s=this.$DataGroup,r=s[3];return r[n]&&r[n].length>0?(e=r[n].pop(),e.visible=!0,this.invalidateDisplayList(),e):(s[4]=!0,this.createOneRenderer(i))},r.createOneRenderer=function(t){var e=new t,i=this.$DataGroup;return i[2][e.$hashCode]=t,egret.is(e,"eui.IItemRenderer")?(i[13]&&this.setItemRenderSkinName(e,i[13]),this.addChild(e),e):null},r.setItemRenderSkinName=function(e,i){if(e&&e instanceof t.Component){var n=e;n.$Component[5]||(n.skinName=i,n.$Component[5]=!1)}},n(r,"dataProvider",function(){return this.$dataProvider},function(t){this.$setDataProvider(t)}),r.$setDataProvider=function(t){return this.$dataProvider==t?!1:(this.removeDataProviderListener(),this.$dataProvider=t,this.$dataProviderChanged=!0,this.$DataGroup[10]=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList(),!0)},r.removeDataProviderListener=function(){this.$dataProvider&&this.$dataProvider.removeEventListener(t.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this)},r.onCollectionChange=function(e){switch(e.kind){case t.CollectionEventKind.ADD:this.itemAddedHandler(e.items,e.location);break;case t.CollectionEventKind.REMOVE:this.itemRemovedHandler(e.items,e.location);break;case t.CollectionEventKind.UPDATE:case t.CollectionEventKind.REPLACE:this.itemUpdatedHandler(e.items[0],e.location);break;case t.CollectionEventKind.RESET:case t.CollectionEventKind.REFRESH:if(this.$layout&&this.$layout.$useVirtualLayout)for(var i=this.$indexToRenderer,n=Object.keys(i),s=n.length,r=s-1;r>=0;r--){var a=+n[r];this.freeRendererByIndex(a)}this.$dataProviderChanged=!0,this.invalidateProperties()}this.invalidateSize(),this.invalidateDisplayList()},r.itemAddedHandler=function(t,e){for(var i=t.length,n=0;i>n;n++)this.itemAdded(t[n],e+n);this.resetRenderersIndices()},r.itemRemovedHandler=function(t,e){for(var i=t.length,n=i-1;n>=0;n--)this.itemRemoved(t[n],e+n);this.resetRenderersIndices()},r.itemAdded=function(t,e){if(this.$layout&&this.$layout.elementAdded(e),this.$layout&&this.$layout.$useVirtualLayout)return void this.$indexToRenderer.splice(e,0,null);var i=this.createVirtualRenderer(t);if(this.$indexToRenderer.splice(e,0,i),i){this.updateRenderer(i,e,t);var n=this.$DataGroup;n[4]&&(n[4]=!1,this.rendererAdded(i,e,t))}},r.itemRemoved=function(t,e){this.$layout&&this.$layout.elementRemoved(e);var i=this.$indexToRenderer[e];this.$indexToRenderer.length>e&&this.$indexToRenderer.splice(e,1),i&&(this.$layout&&this.$layout.$useVirtualLayout?this.doFreeRenderer(i):(this.rendererRemoved(i,e,t),this.removeChild(i)))},r.resetRenderersIndices=function(){var t=this.$indexToRenderer;if(0!=t.length)if(this.$layout&&this.$layout.$useVirtualLayout)for(var e=Object.keys(t),i=e.length,n=0;i>n;n++){var s=+e[n];this.resetRendererItemIndex(s)}else{var r=t.length;for(s=0;r>s;s++)this.resetRendererItemIndex(s)}},r.itemUpdatedHandler=function(t,e){if(!this.$DataGroup[11]){var i=this.$indexToRenderer[e];i&&this.updateRenderer(i,e,t)}},r.resetRendererItemIndex=function(t){var e=this.$indexToRenderer[t];e&&(e.itemIndex=t)},n(r,"itemRenderer",function(){return this.$DataGroup[6]},function(t){var e=this.$DataGroup;e[6]!=t&&(e[6]=t,e[5]=!0,e[8]=!0,e[10]=!0,this.removeDataProviderListener(),this.invalidateProperties())}),n(r,"itemRendererSkinName",function(){return this.$DataGroup[13]},function(t){var e=this.$DataGroup;e[13]!=t&&(e[13]=t,this.$UIComponent[29]&&(e[14]=!0,this.invalidateProperties()))}),n(r,"itemRendererFunction",function(){return this.$DataGroup[7]},function(t){var e=this.$DataGroup;e[7]!=t&&(e[7]=t,e[5]=!0,e[8]=!0,this.removeDataProviderListener(),this.invalidateProperties())}),r.itemToRendererClass=function(e){var i,n=this.$DataGroup;return n[7]&&(i=n[7](e)),i||(i=n[6]),i||(i=t.ItemRenderer),i.$hashCode||(i.$hashCode=egret.$hashCount++),i},r.createChildren=function(){if(!this.$layout){var i=new t.VerticalLayout;i.gap=0,i.horizontalAlign=t.JustifyAlign.CONTENT_JUSTIFY,this.$setLayout(i)}e.prototype.createChildren.call(this)},r.commitProperties=function(){var i=this.$DataGroup;if((i[5]||this.$dataProviderChanged||i[1])&&(this.removeAllRenderers(),this.$layout&&this.$layout.clearVirtualLayoutCache(),this.setTypicalLayoutRect(null),i[1]=!1,i[5]=!1,this.$dataProvider&&this.$dataProvider.addEventListener(t.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this),this.$layout&&this.$layout.$useVirtualLayout?(this.invalidateSize(),this.invalidateDisplayList()):this.createRenderers(),this.$dataProviderChanged&&(this.$dataProviderChanged=!1,this.scrollV=this.scrollH=0)),e.prototype.commitProperties.call(this),i[8]&&(i[8]=!1,this.$dataProvider&&this.$dataProvider.length>0&&(i[12]=this.$dataProvider.getItemAt(0),this.measureRendererSize())),i[14]){i[14]=!1;for(var n=i[13],s=this.$indexToRenderer,r=Object.keys(s),a=r.length,o=0;a>o;o++){var h=r[o];this.setItemRenderSkinName(s[h],n)}for(var l=i[3],r=Object.keys(l),a=r.length,o=0;a>o;o++)for(var u=r[o],d=l[u],a=d.length,o=0;a>o;o++)this.setItemRenderSkinName(d[o],n)}},r.measure=function(){this.$layout&&this.$layout.$useVirtualLayout&&this.ensureTypicalLayoutElement(),e.prototype.measure.call(this)},r.updateDisplayList=function(t,i){var n=this.$layout&&this.$layout.$useVirtualLayout;n&&this.ensureTypicalLayoutElement(),e.prototype.updateDisplayList.call(this,t,i);var s=this.$DataGroup;if(n){var r=s[9];if(r){var a=this.$indexToRenderer[0];if(a){var o=egret.$TempRectangle;a.getPreferredBounds(o),(o.width!=r.width||o.height!=r.height)&&(s[9]=null)}}}},r.ensureTypicalLayoutElement=function(){this.$DataGroup[9]||this.$dataProvider&&this.$dataProvider.length>0&&(this.$DataGroup[12]=this.$dataProvider.getItemAt(0),this.measureRendererSize())},r.measureRendererSize=function(){var t=this.$DataGroup;if(!t[12])return void this.setTypicalLayoutRect(null);var e=this.createVirtualRenderer(t[12]);if(!e)return void this.setTypicalLayoutRect(null);this.updateRenderer(e,0,t[12]),e.validateNow();var i=egret.$TempRectangle;e.getPreferredBounds(i);var n=new egret.Rectangle(0,0,i.width,i.height);this.$layout&&this.$layout.$useVirtualLayout?(t[4]&&this.rendererAdded(e,0,t[12]),this.doFreeRenderer(e)):this.removeChild(e),this.setTypicalLayoutRect(n),t[4]=!1},r.setTypicalLayoutRect=function(t){this.$DataGroup[9]=t,this.$layout&&(t?this.$layout.setTypicalSize(t.width,t.height):this.$layout.setTypicalSize(0,0))},r.removeAllRenderers=function(){for(var t=this.$indexToRenderer,e=Object.keys(t),i=e.length,n=0;i>n;n++){var s=e[n],r=t[s];r&&(this.rendererRemoved(r,r.itemIndex,r.data),this.removeChild(r))}this.$indexToRenderer=[];var a=this.$DataGroup;if(a[10]){for(var o=a[3],e=Object.keys(o),i=e.length,n=0;i>n;n++)for(var h=e[n],l=o[h],i=l.length,n=0;i>n;n++)r=l[n],this.rendererRemoved(r,r.itemIndex,r.data),this.removeChild(r);a[3]={},a[2]={},a[10]=!1}},r.createRenderers=function(){if(this.$dataProvider)for(var t=0,e=this.$dataProvider.length,i=0;e>i;i++){var n=this.$dataProvider.getItemAt(i),s=this.itemToRendererClass(n),r=this.createOneRenderer(s);r&&(this.$indexToRenderer[t]=r,this.updateRenderer(r,t,n),this.rendererAdded(r,t,n),t++)}},r.updateRenderer=function(t,e,i){var n=this.$DataGroup;return n[11]=!0,t.itemIndex=e,t.data=i,n[11]=!1,t},n(r,"numElements",function(){return this.$dataProvider?this.$dataProvider.length:0}),r.rendererAdded=function(t,e,i){},r.rendererRemoved=function(t,e,i){},i}(t.Group);t.DataGroup=e,egret.registerClass(e,"eui.DataGroup"),t.registerProperty(e,"itemRenderer","Class"),t.registerProperty(e,"itemRendererSkinName","Class"),t.registerProperty(e,"dataProvider","eui.ICollection",!0)}(eui||(eui={}));var eui;!function(t){var e=t.sys.UIComponentImpl,i=function(i){function n(){i.call(this),this._widthConstraint=0/0,this.$isShowPrompt=!1,this.$promptColor=6710886,this.$isFocusIn=!1,this.initializeUIValues(),this.type=egret.TextFieldType.INPUT,this.$EditableText={0:null,1:16777215,2:!1}}__extends(n,i);var s=__define,r=n,a=r.prototype;return a.$invalidateContentBounds=function(){i.prototype.$invalidateContentBounds.call(this),this.invalidateSize()},a.$setWidth=function(t){var n=i.prototype.$setWidth.call(this,t),s=e.prototype.$setWidth.call(this,t);return n&&s},a.$setHeight=function(t){var n=i.prototype.$setHeight.call(this,t),s=e.prototype.$setHeight.call(this,t);return n&&s},a.$getText=function(){var t=i.prototype.$getText.call(this);return t==this.$EditableText[0]&&(t=""),t},a.$setText=function(e){var n=this.$EditableText[0];(n!=e||null==n)&&(this.$isShowPrompt=!1,this.textColor=this.$EditableText[1]),this.$isFocusIn||(""==e||null==e)&&(e=n,this.$isShowPrompt=!0,i.prototype.$setTextColor.call(this,this.$promptColor));var s=i.prototype.$setText.call(this,e);return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"text"),s},a.$onAddToStage=function(e,i){t.sys.UIComponentImpl.prototype.$onAddToStage.call(this,e,i),this.addEventListener(egret.FocusEvent.FOCUS_IN,this.onfocusIn,this),this.addEventListener(egret.FocusEvent.FOCUS_OUT,this.onfocusOut,this)},a.$onRemoveFromStage=function(){t.sys.UIComponentImpl.prototype.$onRemoveFromStage.call(this),this.removeEventListener(egret.FocusEvent.FOCUS_IN,this.onfocusIn,this),this.removeEventListener(egret.FocusEvent.FOCUS_OUT,this.onfocusOut,this)},s(a,"prompt",function(){return this.$EditableText[0]},function(t){var e=this.$EditableText,i=e[0];if(i!=t){e[0]=t;var n=this.text;n&&n!=i||this.showPromptText()}}),s(a,"promptColor",function(){return this.$promptColor},function(t){if(t=0|+t,this.$promptColor!=t){this.$promptColor=t;var e=this.text;e&&e!=this.$EditableText[0]||this.showPromptText()}}),a.onfocusOut=function(){this.$isFocusIn=!1,this.text||this.showPromptText()},a.onfocusIn=function(){this.$isFocusIn=!0,this.$isShowPrompt=!1,this.displayAsPassword=this.$EditableText[2];var t=this.$EditableText,e=this.text;e&&e!=t[0]||(this.textColor=t[1],this.text="")},a.showPromptText=function(){var t=this.$EditableText;this.$isShowPrompt=!0,i.prototype.$setTextColor.call(this,this.$promptColor),i.prototype.$setDisplayAsPassword.call(this,!1),this.text=t[0]},a.$setTextColor=function(t){return t=0|+t,this.$EditableText[1]=t,this.$isShowPrompt||i.prototype.$setTextColor.call(this,t),!0},a.$setDisplayAsPassword=function(t){return this.$EditableText[2]=t,this.$isShowPrompt||i.prototype.$setDisplayAsPassword.call(this,t),!0},a.createChildren=function(){this.onfocusOut()},a.childrenCreated=function(){},a.commitProperties=function(){},a.measure=function(){var t=this.$UIComponent,e=this.$TextField,n=e[3],s=0/0;isNaN(this._widthConstraint)?isNaN(t[8])?1e5!=t[13]&&(s=t[13]):s=t[8]:(s=this._widthConstraint,this._widthConstraint=0/0),i.prototype.$setWidth.call(this,s),this.setMeasuredSize(this.textWidth,this.textHeight),i.prototype.$setWidth.call(this,n)},a.updateDisplayList=function(t,e){i.prototype.$setWidth.call(this,t),i.prototype.$setHeight.call(this,e)},a.invalidateParentLayout=function(){},a.setMeasuredSize=function(t,e){},a.invalidateProperties=function(){},a.validateProperties=function(){},a.invalidateSize=function(){},a.validateSize=function(t){},a.invalidateDisplayList=function(){},a.validateDisplayList=function(){},a.validateNow=function(){},a.setLayoutBoundsSize=function(t,i){if(e.prototype.setLayoutBoundsSize.call(this,t,i),!isNaN(t)&&t!==this._widthConstraint&&0!=t){var n=this.$UIComponent;isNaN(n[9])&&t!=n[16]&&(this._widthConstraint=t,this.invalidateSize())}},a.setLayoutBoundsPosition=function(t,e){},a.getLayoutBounds=function(t){},a.getPreferredBounds=function(t){},n}(egret.TextField);t.EditableText=i,egret.registerClass(i,"eui.EditableText",["eui.UIComponent","eui.IDisplayText"]),t.sys.implementUIComponent(i,egret.TextField),t.registerBindable(i.prototype,"text")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.thumb=null,this.$viewport=null,this.autoVisibility=!0}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"viewport",function(){return this.$viewport},function(e){if(e!=this.$viewport){var i=this.$viewport;i&&(i.removeEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.onPropertyChanged,this),i.removeEventListener(egret.Event.RESIZE,this.onViewportResize,this)),this.$viewport=e,e&&(e.addEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.onPropertyChanged,this),e.addEventListener(egret.Event.RESIZE,this.onViewportResize,this)),this.invalidateDisplayList()}}),r.onViewportResize=function(t){this.invalidateDisplayList()},r.onPropertyChanged=function(t){},i}(t.Component);t.ScrollBarBase=e,egret.registerClass(e,"eui.ScrollBarBase")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.apply(this,arguments)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.updateDisplayList=function(e,i){t.prototype.updateDisplayList.call(this,e,i);var n=this.thumb,s=this.$viewport;if(n&&s){var r=egret.$TempRectangle;n.getPreferredBounds(r);var a=r.width,o=r.y,h=s.scrollH,l=s.contentWidth,u=s.width;if(0>=h){var d=a*(1- -h/(.5*u));d=Math.max(5,Math.round(d)),n.setLayoutBoundsSize(d,0/0),n.setLayoutBoundsPosition(0,o)}else if(h>=l-u)d=a*(1-(h-l+u)/(.5*u)),d=Math.max(5,Math.round(d)),n.setLayoutBoundsSize(d,0/0),n.setLayoutBoundsPosition(e-d,o);else{var c=(e-a)*h/(l-u);n.setLayoutBoundsSize(0/0,0/0),n.setLayoutBoundsPosition(c,o)}}},n.onPropertyChanged=function(t){switch(t.property){case"scrollH":case"contentWidth":this.invalidateDisplayList()}},e}(t.ScrollBarBase);t.HScrollBar=e,egret.registerClass(e,"eui.HScrollBar")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$Range={0:100,1:!1,2:0,3:!1,4:0,5:0,6:!1,7:1,8:!1,9:!1}}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"maximum",function(){return this.$Range[0]},function(t){t=+t||0;var e=this.$Range;t!==e[0]&&(e[0]=t,e[1]=!0,this.invalidateProperties(),this.invalidateDisplayList())}),n(r,"minimum",function(){return this.$Range[2]},function(t){t=+t||0;var e=this.$Range;t!==e[2]&&(e[2]=t,e[3]=!0,this.invalidateProperties(),this.invalidateDisplayList())}),n(r,"value",function(){var t=this.$Range;return t[6]?t[5]:t[4]},function(t){t=+t||0,this.$setValue(t)}),r.$setValue=function(t){if(t===this.value)return!1;var e=this.$Range;return e[5]=t,e[6]=!0,this.invalidateProperties(),!0},n(r,"snapInterval",function(){return this.$Range[7]},function(t){var e=this.$Range;e[9]=!0,t=+t||0,t!==e[7]&&(isNaN(t)?(e[7]=1,e[9]=!1):e[7]=t,e[8]=!0,this.invalidateProperties())}),r.commitProperties=function(){e.prototype.commitProperties.call(this);var t=this.$Range;if(t[2]>t[0]&&(t[1]?t[0]=t[2]:t[2]=t[0]),t[6]||t[1]||t[3]||t[8]){var i=t[6]?t[5]:t[4];t[6]=!1,t[1]=!1,t[3]=!1,t[8]=!1,this.setValue(this.nearestValidValue(i,t[7]))}},r.nearestValidSize=function(t){var e=this.snapInterval;if(0==e)return t;var i=Math.round(t/e)*e;return Math.abs(i)=(o-a)/2?o:a;return h/s+i[2]},r.setValue=function(e){var i=this.$Range;i[4]!==e&&(i[0]>i[2]?i[4]=Math.min(i[0],Math.max(i[2],e)):i[4]=e,i[6]=!1,this.invalidateDisplayList(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"value"))},r.updateDisplayList=function(t,i){e.prototype.updateDisplayList.call(this,t,i),this.updateSkinDisplayList()},r.updateSkinDisplayList=function(){},i}(t.Component);t.Range=e,egret.registerClass(e,"eui.Range"),t.registerBindable(e.prototype,"value")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.trackHighlight=null,this.thumb=null,this.track=null,this.$SliderBase={0:0,1:0,2:0,3:0,4:null,5:null,6:300,7:0,8:0,9:!0},this.maximum=10,this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this)}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"slideDuration",function(){return this.$SliderBase[6]},function(t){this.$SliderBase[6]=+t||0}),r.pointToValue=function(t,e){return this.minimum},n(r,"liveDragging",function(){return this.$SliderBase[9]},function(t){this.$SliderBase[9]=!!t}),n(r,"pendingValue",function(){return this.$SliderBase[7]},function(t){t=+t||0;var e=this.$SliderBase;t!==e[7]&&(e[7]=t,this.invalidateDisplayList())}),r.setValue=function(t){this.$SliderBase[7]=t,e.prototype.setValue.call(this,t)},r.partAdded=function(t,i){e.prototype.partAdded.call(this,t,i),i==this.thumb?(this.thumb.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onThumbTouchBegin,this),this.thumb.addEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this)):i==this.track?(this.track.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTrackTouchBegin,this),this.track.addEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this)):i===this.trackHighlight&&(this.trackHighlight.touchEnabled=!1,egret.is(this.trackHighlight,"egret.DisplayObjectContainer")&&(this.trackHighlight.touchChildren=!1))},r.partRemoved=function(t,i){e.prototype.partRemoved.call(this,t,i),i==this.thumb?(this.thumb.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onThumbTouchBegin,this),this.thumb.removeEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this)):i==this.track&&(this.track.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTrackTouchBegin,this),this.track.removeEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this))},r.onTrackOrThumbResize=function(t){this.updateSkinDisplayList()},r.onThumbTouchBegin=function(e){var i=this.$SliderBase;i[5]&&i[5].isPlaying&&this.stopAnimation();var n=this.$stage;n.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.onStageTouchMove,this),n.addEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this);var s=this.thumb.globalToLocal(e.stageX,e.stageY,egret.$TempPoint);i[0]=s.x,i[1]=s.y,t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_START)},r.onStageTouchMove=function(t){var e=this.$SliderBase;e[2]=t.$stageX,e[3]=t.$stageY;var i=this.track;if(i){var n=i.globalToLocal(e[2],e[3],egret.$TempPoint),s=this.pointToValue(n.x-e[0],n.y-e[1]);s=this.nearestValidValue(s,this.snapInterval),this.updateWhenTouchMove(s),t.updateAfterEvent()}},r.updateWhenTouchMove=function(t){t!=this.$SliderBase[7]&&(this.liveDragging?(this.setValue(t),this.dispatchEventWith(egret.Event.CHANGE)):this.pendingValue=t)},r.onStageTouchEnd=function(e){var i=e.$currentTarget;i.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onStageTouchMove,this),i.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END);var n=this.$SliderBase;this.liveDragging||this.value==n[7]||(this.setValue(n[7]),this.dispatchEventWith(egret.Event.CHANGE))},r.onTouchBegin=function(t){this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.stageTouchEndHandler,this),this.$SliderBase[4]=t.$target},r.stageTouchEndHandler=function(t){var e=t.$target,i=this.$SliderBase;t.$currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END,this.stageTouchEndHandler,this),i[4]!=e&&this.contains(e)&&egret.TouchEvent.dispatchTouchEvent(this,egret.TouchEvent.TOUCH_TAP,!0,!0,t.$stageX,t.$stageY,t.touchPointID),i[4]=null},r.$animationUpdateHandler=function(t){this.pendingValue=t.currentValue},r.animationEndHandler=function(e){this.setValue(this.$SliderBase[8]),this.dispatchEventWith(egret.Event.CHANGE),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END)},r.stopAnimation=function(){this.$SliderBase[5].stop(),this.setValue(this.nearestValidValue(this.pendingValue,this.snapInterval)),this.dispatchEventWith(egret.Event.CHANGE),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END)},r.onTrackTouchBegin=function(e){var i=this.thumb?this.thumb.width:0,n=this.thumb?this.thumb.height:0,s=e.$stageX-i/2,r=e.$stageY-n/2,a=this.track.globalToLocal(s,r,egret.$TempPoint),o=this.$Range,h=this.pointToValue(a.x,a.y);h=this.nearestValidValue(h,o[7]);var l=this.$SliderBase;if(h!=l[7])if(0!=l[6]){l[5]||(l[5]=new t.sys.Animation(this.$animationUpdateHandler,this),l[5].endFunction=this.animationEndHandler);var u=l[5];u.isPlaying&&this.stopAnimation(),l[8]=h,u.duration=l[6]*(Math.abs(l[7]-l[8])/(o[0]-o[2])),u.from=l[7],u.to=l[8],t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_START),u.play()}else this.setValue(h),this.dispatchEventWith(egret.Event.CHANGE)},i}(t.Range);t.SliderBase=e,egret.registerClass(e,"eui.SliderBase")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.pointToValue=function(t,e){if(!this.thumb||!this.track)return 0;var i=this.$Range,n=i[0]-i[2],s=this.getThumbRange();return i[2]+(0!=s?t/s*n:0)},n.getThumbRange=function(){var t=egret.$TempRectangle;this.track.getLayoutBounds(t);var e=t.width;return this.thumb.getLayoutBounds(t),e-t.width},n.updateSkinDisplayList=function(){if(this.thumb&&this.track){var t=this.$Range,e=this.getThumbRange(),i=t[0]-t[2],n=i>0?(this.pendingValue-t[2])/i*e:0,s=this.track.localToGlobal(n,0,egret.$TempPoint),r=s.x,a=s.y,o=this.thumb.$parent.globalToLocal(r,a,egret.$TempPoint).x,h=egret.$TempRectangle;if(this.thumb.getLayoutBounds(h),this.thumb.setLayoutBoundsPosition(Math.round(o),h.y),this.trackHighlight&&this.trackHighlight.$parent){var l=this.trackHighlight.$parent.globalToLocal(r,a,egret.$TempPoint).x-n;this.trackHighlight.x=Math.round(l),this.trackHighlight.width=Math.round(n)}}},e}(t.SliderBase);t.HSlider=e,egret.registerClass(e,"eui.HSlider")}(eui||(eui={}));var eui;!function(t){var e=[],i={},n={},s=function(){function t(){}var s=(__define,t),r=s.prototype;return r.getAsset=function(t,s,r){var a=i[t];if(a)return void a.push([s,r]);var o=e.pop();o||(o=new egret.ImageLoader),i[t]=[[s,r]],n[o.$hashCode]=t,o.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),o.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this),o.load(t)},r.onLoadFinish=function(t){var s=t.currentTarget;s.removeEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),s.removeEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this);var r;t.$type==egret.Event.COMPLETE&&(r=new egret.Texture,r._setBitmapData(s.data),s.data=null),e.push(s);var a=n[s.$hashCode];delete n[s.$hashCode];var o=i[a];delete i[a];for(var h=o.length,l=0;h>l;l++){var u=o[l];u[0].call(u[1],r,a)}},t}();t.DefaultAssetAdapter=s,egret.registerClass(s,"eui.DefaultAssetAdapter",["eui.IAssetAdapter"])}(eui||(eui={}));var eui;!function(t){var e=new t.DefaultAssetAdapter,i=function(i){function n(t){i.call(this),this.sourceChanged=!1,this._source=null,this.initializeUIValues(),t&&(this.source=t)}__extends(n,i);var s=__define,r=n,a=r.prototype;return s(a,"scale9Grid",function(){return this.$scale9Grid},function(t){this.$scale9Grid=t,this.$invalidateContentBounds(),this.invalidateDisplayList()}),s(a,"fillMode",function(){return this.$fillMode},function(t){t!=this.$fillMode&&(this.$fillMode=t,this.invalidateDisplayList())}),a.$setFillMode=function(t){var e=i.prototype.$setFillMode.call(this,t);return this.invalidateDisplayList(),e},s(a,"source",function(){return this._source},function(t){t!=this._source&&(this._source=t,this.$stage?this.parseSource():(this.sourceChanged=!0,this.invalidateProperties()))}),a.$setBitmapData=function(t){if(t==this.$Bitmap[0])return!1;var e=i.prototype.$setBitmapData.call(this,t);return this.sourceChanged=!1,this.invalidateSize(),this.invalidateDisplayList(),e},a.parseSource=function(){this.sourceChanged=!1;var t=this._source;if(t&&"string"==typeof t){var i=this.$stage.getImplementation("eui.IAssetAdapter");i||(i=e),i.getAsset(this._source,this.contentChanged,this)}else this.$setBitmapData(t)},a.contentChanged=function(t,e){e===this._source&&egret.is(t,"egret.Texture")&&(this.$setBitmapData(t),t&&this.dispatchEventWith(egret.Event.COMPLETE))},a.$measureContentBounds=function(t){var e=(this.$Bitmap,this.$Bitmap[0]);if(e){var i=this.$UIComponent,n=i[10],s=i[11];if(isNaN(n)||isNaN(s))return void t.setEmpty();"clip"==this.$fillMode&&(n>e.$getTextureWidth()&&(n=e.$getTextureWidth()),s>e.$getTextureHeight()&&(s=e.$getTextureHeight())),t.setTo(0,0,n,s)}else t.setEmpty()},a.$render=function(){var t=this.$Bitmap[0];if(t){var e=this.$UIComponent,i=e[10],n=e[11];if(0!==i&&0!==n){var s=this.$Bitmap;egret.sys.BitmapNode.$updateTextureData(this.$renderNode,s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],i,n,s[13],s[14],this.scale9Grid,this.$fillMode,s[10])}}},a.createChildren=function(){this.sourceChanged&&this.parseSource()},a.childrenCreated=function(){},a.commitProperties=function(){t.sys.UIComponentImpl.prototype.commitProperties.call(this),this.sourceChanged&&this.parseSource()},a.measure=function(){var t=this.$Bitmap[0];t?this.setMeasuredSize(t.$getTextureWidth(),t.$getTextureHeight()):this.setMeasuredSize(0,0)},a.updateDisplayList=function(t,e){this.$invalidateContentBounds()},a.invalidateParentLayout=function(){},a.setMeasuredSize=function(t,e){},a.invalidateProperties=function(){},a.validateProperties=function(){},a.invalidateSize=function(){},a.validateSize=function(t){},a.invalidateDisplayList=function(){},a.validateDisplayList=function(){},a.validateNow=function(){},a.setLayoutBoundsSize=function(t,e){},a.setLayoutBoundsPosition=function(t,e){},a.getLayoutBounds=function(t){},a.getPreferredBounds=function(t){},n +var eui;!function(t){function e(e){for(var i=e[0],n=i instanceof t.Watcher?i.getValue():i,s=e.length,r=1;s>r;r++){var a=e[r];a instanceof t.Watcher&&(a=a.getValue()),n+=a}return n}var i=function(){function i(){}var n=(__define,i);n.prototype;return i.bindProperty=function(e,i,n,s){var r=t.Watcher.watch(e,i,null,null);if(r){var a=function(t){n[s]=t};r.setHandler(a,null),a(r.getValue())}return r},i.bindHandler=function(e,i,n,s){var r=t.Watcher.watch(e,i,n,s);return r&&n.call(s,r.getValue()),r},i.$bindProperties=function(n,s,r,a,o){if(1==s.length)return i.bindProperty(n,s[0].split("."),a,o);for(var h=function(){a[o]=e(s)},l=r.length,u=0;l>u;u++){var d=r[u],c=s[d].split("."),p=t.Watcher.watch(n,c,null,null);p&&(s[d]=p,p.setHandler(h,null))}return h(),p},i}();t.Binding=i,egret.registerClass(i,"eui.Binding")}(eui||(eui={}));var eui;!function(t){function e(t,i){var n=Object.getOwnPropertyDescriptor(t,i);if(n)return n;var s=Object.getPrototypeOf(t);return s?e(s,i):null}function i(t,e){for(var i=t[n],s=i.length,r=0;s>r;r+=2){var a=i[r],o=i[r+1];a.call(o,e)}}var n="__listeners__",s="__bindables__",r=0,a=function(){function a(t,e,i,n){this.isExecuting=!1,this.property=t,this.handler=e,this.next=n,this.thisObject=i}var o=(__define,a),h=o.prototype;return a.watch=function(t,e,i,n){if(e.length>0){var s=e.shift(),r=a.watch(null,e,i,n),o=new a(s,i,n,r);return o.reset(t),o}return null},a.checkBindable=function(a,o){var h=a[s];if(h&&-1!=h.indexOf(o))return!0;var l=egret.is(a,"egret.IEventDispatcher");l||a[n]||(a[n]=[]);var u=e(a,o);if(u&&u.set&&u.get){var d=u.set;u.set=function(e){this[o]!=e&&(d.call(this,e),l?t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,o):i(this,o))}}else{if(u&&(u.get||u.set))return!1;r++;var c="_"+r+o;a[c]=u?u.value:null,u={enumerable:!0,configurable:!0},u.get=function(){return this[c]},u.set=function(e){this[c]!=e&&(this[c]=e,l?t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,o):i(this,o))}}Object.defineProperty(a,o,u),t.registerBindable(a,o)},h.unwatch=function(){this.reset(null),this.handler=null,this.next&&(this.next.handler=null)},h.getValue=function(){return this.next?this.next.getValue():this.getHostPropertyValue()},h.setHandler=function(t,e){this.handler=t,this.thisObject=e,this.next&&this.next.setHandler(t,e)},h.reset=function(e){var i=this.host;if(i)if(egret.is(i,"egret.IEventDispatcher"))i.removeEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.wrapHandler,this);else{var s=i[n],r=s.indexOf(this);s.splice(r-1,2)}if(this.host=e,e)if(a.checkBindable(e,this.property),egret.is(e,"egret.IEventDispatcher"))e.addEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.wrapHandler,this,!1,100);else{var s=e[n];s.push(this.onPropertyChange),s.push(this)}this.next&&this.next.reset(this.getHostPropertyValue())},h.getHostPropertyValue=function(){return this.host?this.host[this.property]:null},h.wrapHandler=function(t){this.onPropertyChange(t.property)},h.onPropertyChange=function(t){if(t==this.property&&!this.isExecuting)try{this.isExecuting=!0,this.next&&this.next.reset(this.getHostPropertyValue()),this.handler.call(this.thisObject,this.getValue())}finally{this.isExecuting=!1}},a}();t.Watcher=a,egret.registerClass(a,"eui.Watcher")}(eui||(eui={}));var eui;!function(t){function e(t,e,i,n){var s=t.prototype;s.__meta__=s.__meta__||{},s.__meta__[e]=i,n&&(s.__defaultProperty__=e)}t.registerProperty=e}(eui||(eui={}));var eui;!function(t){function e(t,e){if(t.hasOwnProperty(i))t[i].push(e);else{var n=[e];t[i]&&(n=t[i].concat(n)),t[i]=n}}var i="__bindables__";t.registerBindable=e}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(t){e.call(this),t?this._source=t:this._source=[]}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"source",function(){return this._source},function(e){e||(e=[]),this._source=e,this.dispatchCoEvent(t.CollectionEventKind.RESET)}),r.refresh=function(){this.dispatchCoEvent(t.CollectionEventKind.REFRESH)},n(r,"length",function(){return this._source.length}),r.addItem=function(e){this._source.push(e),this.dispatchCoEvent(t.CollectionEventKind.ADD,this._source.length-1,-1,[e])},r.addItemAt=function(e,i){0>i||i>this._source.length,this._source.splice(i,0,e),this.dispatchCoEvent(t.CollectionEventKind.ADD,i,-1,[e])},r.getItemAt=function(t){return this._source[t]},r.getItemIndex=function(t){for(var e=this._source.length,i=0;e>i;i++)if(this._source[i]===t)return i;return-1},r.itemUpdated=function(e){var i=this.getItemIndex(e);-1!=i&&this.dispatchCoEvent(t.CollectionEventKind.UPDATE,i,-1,[e])},r.removeAll=function(){var e=this._source.concat();this._source.length=0,this.dispatchCoEvent(t.CollectionEventKind.REMOVE,0,-1,e)},r.removeItemAt=function(e){if(!(0>e||e>=this._source.length)){var i=this._source.splice(e,1)[0];return this.dispatchCoEvent(t.CollectionEventKind.REMOVE,e,-1,[i]),i}},r.replaceItemAt=function(e,i){if(!(0>i||i>=this._source.length)){var n=this._source.splice(i,1,e)[0];return this.dispatchCoEvent(t.CollectionEventKind.REPLACE,i,-1,[e],[n]),n}},r.replaceAll=function(t){t||(t=[]);for(var e=t.length,i=this._source.length,n=e;i>n;n++)this.removeItemAt(e);for(n=0;e>n;n++)n>=i?this.addItemAt(t[n],n):this.replaceItemAt(t[n],n);this._source=t},r.dispatchCoEvent=function(e,i,n,s,r){t.CollectionEvent.dispatchCollectionEvent(this,t.CollectionEvent.COLLECTION_CHANGE,e,i,n,s,r)},i}(egret.EventDispatcher);t.ArrayCollection=e,egret.registerClass(e,"eui.ArrayCollection",["eui.ICollection","egret.IEventDispatcher"]),t.registerProperty(e,"source","Array",!0)}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e=function(t){function e(){t.call(this),this.targetLevel=Number.POSITIVE_INFINITY,this.invalidatePropertiesFlag=!1,this.invalidateClientPropertiesFlag=!1,this.invalidatePropertiesQueue=new i,this.invalidateSizeFlag=!1,this.invalidateClientSizeFlag=!1,this.invalidateSizeQueue=new i,this.invalidateDisplayListFlag=!1,this.invalidateDisplayListQueue=new i,this.eventDisplay=new egret.Bitmap,this.listenersAttached=!1}__extends(e,t);var n=(__define,e),s=n.prototype;return s.invalidateProperties=function(t){this.invalidatePropertiesFlag||(this.invalidatePropertiesFlag=!0,this.listenersAttached||this.attachListeners()),this.targetLevel<=t.$nestLevel&&(this.invalidateClientPropertiesFlag=!0),this.invalidatePropertiesQueue.insert(t)},s.validateProperties=function(){for(var t=this.invalidatePropertiesQueue,e=t.shift();e;)e.$stage&&e.validateProperties(),e=t.shift();t.isEmpty()&&(this.invalidatePropertiesFlag=!1)},s.invalidateSize=function(t){this.invalidateSizeFlag||(this.invalidateSizeFlag=!0,this.listenersAttached||this.attachListeners()),this.targetLevel<=t.$nestLevel&&(this.invalidateClientSizeFlag=!0),this.invalidateSizeQueue.insert(t)},s.validateSize=function(){for(var t=this.invalidateSizeQueue,e=t.pop();e;)e.$stage&&e.validateSize(),e=t.pop();t.isEmpty()&&(this.invalidateSizeFlag=!1)},s.invalidateDisplayList=function(t){this.invalidateDisplayListFlag||(this.invalidateDisplayListFlag=!0,this.listenersAttached||this.attachListeners()),this.invalidateDisplayListQueue.insert(t)},s.validateDisplayList=function(){for(var t=this.invalidateDisplayListQueue,e=t.shift();e;)e.$stage&&e.validateDisplayList(),e=t.shift();t.isEmpty()&&(this.invalidateDisplayListFlag=!1)},s.attachListeners=function(){this.eventDisplay.addEventListener(egret.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this),this.eventDisplay.addEventListener(egret.Event.RENDER,this.doPhasedInstantiationCallBack,this),egret.sys.$invalidateRenderFlag=!0,this.listenersAttached=!0},s.doPhasedInstantiationCallBack=function(t){this.eventDisplay.removeEventListener(egret.Event.ENTER_FRAME,this.doPhasedInstantiationCallBack,this),this.eventDisplay.removeEventListener(egret.Event.RENDER,this.doPhasedInstantiationCallBack,this),this.doPhasedInstantiation()},s.doPhasedInstantiation=function(){this.invalidatePropertiesFlag&&this.validateProperties(),this.invalidateSizeFlag&&this.validateSize(),this.invalidateDisplayListFlag&&this.validateDisplayList(),this.invalidatePropertiesFlag||this.invalidateSizeFlag||this.invalidateDisplayListFlag?this.attachListeners():this.listenersAttached=!1},s.validateClient=function(t){var e,i=!1,n=this.targetLevel;this.targetLevel===Number.POSITIVE_INFINITY&&(this.targetLevel=t.$nestLevel);for(var s=this.invalidatePropertiesQueue,r=this.invalidateSizeQueue,a=this.invalidateDisplayListQueue;!i;){for(i=!0,e=s.removeSmallestChild(t);e;)e.$stage&&e.validateProperties(),e=s.removeSmallestChild(t);for(s.isEmpty()&&(this.invalidatePropertiesFlag=!1),this.invalidateClientPropertiesFlag=!1,e=r.removeLargestChild(t);e;){if(e.$stage&&e.validateSize(),this.invalidateClientPropertiesFlag&&(e=s.removeSmallestChild(t))){s.insert(e),i=!1;break}e=r.removeLargestChild(t)}for(r.isEmpty()&&(this.invalidateSizeFlag=!1),this.invalidateClientPropertiesFlag=!1,this.invalidateClientSizeFlag=!1,e=a.removeSmallestChild(t);e;){if(e.$stage&&e.validateDisplayList(),this.invalidateClientPropertiesFlag&&(e=s.removeSmallestChild(t))){s.insert(e),i=!1;break}if(this.invalidateClientSizeFlag&&(e=r.removeLargestChild(t))){r.insert(e),i=!1;break}e=a.removeSmallestChild(t)}a.isEmpty()&&(this.invalidateDisplayListFlag=!1)}n===Number.POSITIVE_INFINITY&&(this.targetLevel=Number.POSITIVE_INFINITY)},e}(egret.EventDispatcher);t.Validator=e,egret.registerClass(e,"eui.sys.Validator");var i=function(){function t(){this.depthBins={},this.minDepth=0,this.maxDepth=-1}var e=(__define,t),i=e.prototype;return i.insert=function(t){var e=t.$nestLevel;this.maxDepththis.maxDepth&&(this.maxDepth=e));var i=this.depthBins[e];i||(i=this.depthBins[e]=new n),i.insert(t)},i.pop=function(){var t,e=this.minDepth;if(e<=this.maxDepth){for(var i=this.depthBins[this.maxDepth];!i||0===i.length;){if(this.maxDepth--,this.maxDepthe)return null;i=this.depthBins[this.minDepth]}for(t=i.pop();!(i&&0!=i.length||(this.minDepth++,this.minDepth>e));)i=this.depthBins[this.minDepth]}return t},i.removeLargestChild=function(t){for(var e=t.$hashCode,i=t.$nestLevel,n=this.maxDepth,s=i;n>=s;){var r=this.depthBins[n];if(r&&r.length>0){if(n===i){if(r.map[e])return r.remove(t),t}else{if(!egret.is(t,"egret.DisplayObjectContainer"))break;for(var a=r.items,o=r.length,h=0;o>h;h++){var l=a[h];if(t.contains(l))return r.remove(l),l}}n--}else if(n==this.maxDepth&&this.maxDepth--,n--,s>n)break}return null},i.removeSmallestChild=function(t){for(var e=t.$nestLevel,i=e,n=this.maxDepth,s=t.$hashCode;n>=i;){var r=this.depthBins[i];if(r&&r.length>0){if(i===e){if(r.map[s])return r.remove(t),t}else{if(!egret.is(t,"egret.DisplayObjectContainer"))break;for(var a=r.items,o=r.length,h=0;o>h;h++){var l=a[h];if(t.contains(l))return r.remove(l),l}}i++}else if(i==this.minDepth&&this.minDepth++,i++,i>n)break}return null},i.isEmpty=function(){return this.minDepth>this.maxDepth},t}();egret.registerClass(i,"DepthQueue");var n=function(){function t(){this.map={},this.items=[],this.length=0}var e=(__define,t),i=e.prototype;return i.insert=function(t){var e=t.$hashCode;this.map[e]||(this.map[e]=!0,this.length++,this.items.push(t))},i.pop=function(){var t=this.items.pop();return t&&(this.length--,0===this.length?this.map={}:this.map[t.$hashCode]=!1),t},i.remove=function(t){var e=this.items.indexOf(t);e>=0&&(this.items.splice(e,1),this.length--,0===this.length?this.map={}:this.map[t.$hashCode]=!1)},t}();egret.registerClass(n,"DepthBin")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e;!function(e){function i(t){return 1===t.a&&0===t.b&&0===t.c&&1===t.d}function n(t,e){if("function"!=typeof t[e])return!1;var i=t[e].toString(),n=i.indexOf("{"),s=i.lastIndexOf("}");return i=i.substring(n+1,s),""==i.trim()}function s(t,e){for(var i in e)"prototype"!=i&&e.hasOwnProperty(i)&&(t[i]=e[i]);for(var s=t.prototype,r=e.prototype,a=Object.keys(r),o=a.length,h=0;o>h;h++){var l=a[h];if("__meta__"!=l&&(!s.hasOwnProperty(l)||n(s,l))){var u=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(s,l,u)}}}function r(t,e,i){s(t,h);var n=t.prototype;n.$super=e.prototype,i&&(n.$childAdded=function(t,e){this.invalidateSize(),this.invalidateDisplayList()},n.$childRemoved=function(t,e){this.invalidateSize(),this.invalidateDisplayList()})}var a="eui.UIComponent",o=new e.Validator,h=function(n){function s(){n.call(this),this.initializeUIValues()}__extends(s,n);var r=__define,h=s,l=h.prototype;return l.initializeUIValues=function(){this.$UIComponent={0:0/0,1:0/0,2:0/0,3:0/0,4:0/0,5:0/0,6:0/0,7:0/0,8:0/0,9:0/0,10:0,11:0,12:0,13:1e5,14:0,15:1e5,16:0,17:0,18:0/0,19:0/0,20:0,21:0,22:0,23:0,24:!0,25:!0,26:!0,27:!1,28:!1,29:!1},this.$includeInLayout=!0,this.$touchEnabled=!0},l.createChildren=function(){},l.childrenCreated=function(){},l.commitProperties=function(){var e=this.$UIComponent;(e[22]!=e[10]||e[23]!=e[11])&&(this.dispatchEventWith(egret.Event.RESIZE),e[22]=e[10],e[23]=e[11]),(e[20]!=this.$getX()||e[21]!=this.$getY())&&(t.UIEvent.dispatchUIEvent(this,t.UIEvent.MOVE),e[20]=this.$getX(),e[21]=this.$getY())},l.measure=function(){},l.updateDisplayList=function(t,e){},r(l,"includeInLayout",function(){return this.$includeInLayout},function(t){t=!!t,this.$includeInLayout!==t&&(this.$includeInLayout=!0,this.invalidateParentLayout(),this.$includeInLayout=t)}),l.$onAddToStage=function(e,i){this.$super.$onAddToStage.call(this,e,i),this.checkInvalidateFlag();var n=this.$UIComponent;n[29]||(n[29]=!0,this.createChildren(),this.childrenCreated(),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CREATION_COMPLETE))},l.checkInvalidateFlag=function(t){var e=this.$UIComponent;e[24]&&o.invalidateProperties(this),e[25]&&o.invalidateSize(this),e[26]&&o.invalidateDisplayList(this)},r(l,"left",function(){return this.$UIComponent[0]},function(t){t=t&&"number"!=typeof t?t.toString().trim():+t;var e=this.$UIComponent;e[0]!==t&&(e[0]=t,this.invalidateParentLayout())}),r(l,"right",function(){return this.$UIComponent[1]},function(t){t=t&&"number"!=typeof t?t.toString().trim():+t;var e=this.$UIComponent;e[1]!==t&&(e[1]=t,this.invalidateParentLayout())}),r(l,"top",function(){return this.$UIComponent[2]},function(t){t=t&&"number"!=typeof t?t.toString().trim():+t;var e=this.$UIComponent;e[2]!==t&&(e[2]=t,this.invalidateParentLayout())}),r(l,"bottom",function(){return this.$UIComponent[3]},function(t){t=t&&"number"!=typeof t?t.toString().trim():+t;var e=this.$UIComponent;e[3]!=t&&(e[3]=t,this.invalidateParentLayout())}),r(l,"horizontalCenter",function(){return this.$UIComponent[4]},function(t){t=t&&"number"!=typeof t?t.toString().trim():+t;var e=this.$UIComponent;e[4]!==t&&(e[4]=t,this.invalidateParentLayout())}),r(l,"verticalCenter",function(){return this.$UIComponent[5]},function(t){t=t&&"number"!=typeof t?t.toString().trim():+t;var e=this.$UIComponent;e[5]!==t&&(e[5]=t,this.invalidateParentLayout())}),r(l,"percentWidth",function(){return this.$UIComponent[6]},function(t){t=+t;var e=this.$UIComponent;e[6]!==t&&(e[6]=t,this.invalidateParentLayout())}),r(l,"percentHeight",function(){return this.$UIComponent[7]},function(t){t=+t;var e=this.$UIComponent;e[7]!==t&&(e[7]=t,this.invalidateParentLayout())}),r(l,"explicitWidth",function(){return this.$UIComponent[8]}),r(l,"explicitHeight",function(){return this.$UIComponent[9]}),l.$getWidth=function(){return this.validateSizeNow(),this.$UIComponent[10]},l.$setWidth=function(t){t=+t;var e=this.$UIComponent;return 0>t||e[10]===t&&e[8]===t?!1:(e[8]=t,isNaN(t)&&this.invalidateSize(),this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentLayout(),!0)},l.validateSizeNow=function(){this.validateSize(!0),this.updateFinalSize()},l.$getHeight=function(){return this.validateSizeNow(),this.$UIComponent[11]},l.$setHeight=function(t){t=+t;var e=this.$UIComponent;return 0>t||e[11]===t&&e[9]===t?!1:(e[9]=t,isNaN(t)&&this.invalidateSize(),this.invalidateProperties(),this.invalidateDisplayList(),this.invalidateParentLayout(),!0)},l.$setScaleX=function(t){var e=this.$super.$setScaleX.call(this,t);return e&&this.invalidateParentLayout(),e},l.$setScaleY=function(t){var e=this.$super.$setScaleY.call(this,t);return e&&this.invalidateParentLayout(),e},r(l,"minWidth",function(){return this.$UIComponent[12]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[12]===t||(e[12]=t,this.invalidateSize(),this.invalidateParentLayout())}),r(l,"maxWidth",function(){return this.$UIComponent[13]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[13]===t||(e[13]=t,this.invalidateSize(),this.invalidateParentLayout())}),r(l,"minHeight",function(){return this.$UIComponent[14]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[14]===t||(e[14]=t,this.invalidateSize(),this.invalidateParentLayout())}),r(l,"maxHeight",function(){return this.$UIComponent[15]},function(t){t=+t||0;var e=this.$UIComponent;0>t||e[15]===t||(e[15]=t,this.invalidateSize(),this.invalidateParentLayout())}),l.setMeasuredSize=function(t,e){var i=this.$UIComponent;i[16]=Math.ceil(+t||0),i[17]=Math.ceil(+e||0)},l.setActualSize=function(t,e){var i=!1,n=this.$UIComponent;n[10]!==t&&(n[10]=t,i=!0),n[11]!==e&&(n[11]=e,i=!0),i&&(this.invalidateDisplayList(),this.dispatchEventWith(egret.Event.RESIZE))},l.$setX=function(t){var e=this.$super.$setX.call(this,t);return e&&(this.invalidateParentLayout(),this.invalidateProperties()),e},l.$setY=function(t){var e=this.$super.$setY.call(this,t);return e&&(this.invalidateParentLayout(),this.invalidateProperties()),e},l.invalidateProperties=function(){var t=this.$UIComponent;t[24]||(t[24]=!0,this.$stage&&o.invalidateProperties(this))},l.validateProperties=function(){var t=this.$UIComponent;t[24]&&(this.commitProperties(),t[24]=!1)},l.invalidateSize=function(){var t=this.$UIComponent;t[25]||(t[25]=!0,this.$stage&&o.invalidateSize(this))},l.validateSize=function(t){if(t){var e=this.$children;if(e)for(var i=e.length,n=0;i>n;n++){var s=e[n];egret.is(s,a)&&s.validateSize(!0)}}var r=this.$UIComponent;if(r[25]){var o=this.measureSizes();o&&(this.invalidateDisplayList(),this.invalidateParentLayout()),r[25]=!1}},l.measureSizes=function(){var t=!1,e=this.$UIComponent;if(!e[25])return t;(isNaN(e[8])||isNaN(e[9]))&&(this.measure(),e[16]e[13]&&(e[16]=e[13]),e[17]e[15]&&(e[17]=e[15]));var i=this.getPreferredUWidth(),n=this.getPreferredUHeight();return(i!==e[18]||n!==e[19])&&(e[18]=i,e[19]=n,t=!0),t},l.invalidateDisplayList=function(){var t=this.$UIComponent;t[26]||(t[26]=!0,this.$stage&&o.invalidateDisplayList(this))},l.validateDisplayList=function(){var t=this.$UIComponent;t[26]&&(this.updateFinalSize(),this.updateDisplayList(t[10],t[11]),t[26]=!1)},l.updateFinalSize=function(){var t=0,e=0,i=this.$UIComponent;t=i[27]?i[10]:isNaN(i[8])?i[16]:i[8],e=i[28]?i[11]:isNaN(i[9])?i[17]:i[9],this.setActualSize(t,e)},l.validateNow=function(){this.$stage&&o.validateClient(this)},l.invalidateParentLayout=function(){var t=this.$parent;t&&this.$includeInLayout&&egret.is(t,a)&&(t.invalidateSize(),t.invalidateDisplayList())},l.setLayoutBoundsSize=function(t,n){if(n=+n,t=+t,!(0>n||0>t)){var s,r,a=this.$UIComponent,o=a[13],h=a[15],l=Math.min(a[12],o),u=Math.min(a[14],h);isNaN(t)?(a[27]=!1,s=this.getPreferredUWidth()):(a[27]=!0,s=Math.max(l,Math.min(o,t))),isNaN(n)?(a[28]=!1,r=this.getPreferredUHeight()):(a[28]=!0,r=Math.max(u,Math.min(h,n)));var d=this.$getMatrix();if(i(d))return void this.setActualSize(s,r);var c=e.MatrixUtil.fitBounds(t,n,d,a[8],a[9],this.getPreferredUWidth(),this.getPreferredUHeight(),l,u,o,h);c||(c=egret.Point.create(l,u)),this.setActualSize(c.x,c.y),egret.Point.release(c)}},l.setLayoutBoundsPosition=function(e,n){var s=this.$getMatrix();if(!i(s)){var r=egret.$TempRectangle;this.getLayoutBounds(r),e+=this.$getX()-r.x,n+=this.$getY()-r.y}var a=this.$super.$setX.call(this,e);(this.$super.$setY.call(this,n)||a)&&t.UIEvent.dispatchUIEvent(this,t.UIEvent.MOVE)},l.getLayoutBounds=function(t){var e,i=this.$UIComponent;e=i[27]?i[10]:isNaN(i[8])?i[16]:i[8];var n;n=i[28]?i[11]:isNaN(i[9])?i[17]:i[9],this.applyMatrix(t,e,n)},l.getPreferredUWidth=function(){var t=this.$UIComponent;return isNaN(t[8])?t[16]:t[8]},l.getPreferredUHeight=function(){var t=this.$UIComponent;return isNaN(t[9])?t[17]:t[9]},l.getPreferredBounds=function(t){var e=this.getPreferredUWidth(),i=this.getPreferredUHeight();this.applyMatrix(t,e,i)},l.applyMatrix=function(t,e,n){var t=t.setTo(0,0,e,n),s=this.$getMatrix();i(s)?(t.x+=s.tx,t.y+=s.ty):s.$transformBounds(t)},s}(egret.DisplayObject);e.UIComponentImpl=h,egret.registerClass(h,"eui.sys.UIComponentImpl",["eui.UIComponent"]),e.mixin=s,e.implementUIComponent=r}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=t.sys.UIComponentImpl,i=function(i){function n(t){i.call(this),this.$createChildrenCalled=!1,this.$fontChanged=!1,this._widthConstraint=0/0,this.initializeUIValues(),this.text=t}__extends(n,i);var s=(__define,n),r=s.prototype;return r.$invalidateContentBounds=function(){i.prototype.$invalidateContentBounds.call(this),this.invalidateSize()},r.$setWidth=function(t){var n=i.prototype.$setWidth.call(this,t),s=e.prototype.$setWidth.call(this,t);return n&&s},r.$setHeight=function(t){var n=i.prototype.$setHeight.call(this,t),s=e.prototype.$setHeight.call(this,t);return n&&s},r.$setText=function(e){var n=i.prototype.$setText.call(this,e);return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"text"),n},r.$setFont=function(t){this.$BitmapText;return this.$font==t?!1:(this.$font=t,this.$createChildrenCalled?this.$parseFont():this.$fontChanged=!0,this.$BitmapText[6]=!0,!0)},r.$parseFont=function(){if(this.$fontChanged=!1,this.$font&&"string"==typeof this.$font){var e=this.$stage.getImplementation("eui.IAssetAdapter");e||(e=new t.DefaultAssetAdapter),e.getAsset(this.$font,this.$onFontChanged,this)}else this.$setFontData(this.$font)},r.$onFontChanged=function(t,e){e===this.$font&&this.$setFontData(t)},r.$setFontData=function(t){return t==this.$BitmapText[5]?!1:(this.$BitmapText[5]=t,this.$invalidateContentBounds(),!0)},r.createChildren=function(){this.$fontChanged&&this.$parseFont(),this.$createChildrenCalled=!0},r.childrenCreated=function(){},r.commitProperties=function(){},r.measure=function(){var t=this.$UIComponent,e=this.$BitmapText,n=e[0],s=0/0;isNaN(this._widthConstraint)?isNaN(t[8])?1e5!=t[13]&&(s=t[13]):s=t[8]:(s=this._widthConstraint,this._widthConstraint=0/0),i.prototype.$setWidth.call(this,s),this.setMeasuredSize(this.textWidth,this.textHeight),i.prototype.$setWidth.call(this,n)},r.updateDisplayList=function(t,e){i.prototype.$setWidth.call(this,t),i.prototype.$setHeight.call(this,e)},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,i){if(e.prototype.setLayoutBoundsSize.call(this,t,i),!isNaN(t)&&t!==this._widthConstraint&&0!=t){var n=this.$UIComponent;isNaN(n[9])&&t!=n[16]&&(this._widthConstraint=t,this.invalidateSize())}},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},n}(egret.BitmapText);t.BitmapLabel=i,egret.registerClass(i,"eui.BitmapLabel",["eui.UIComponent","eui.IDisplayText"]),t.sys.implementUIComponent(i,egret.BitmapText),t.registerBindable(i.prototype,"text")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.initializeUIValues(),this.$Component={0:null,1:null,2:"",3:!0,4:!1,5:!1,6:!0,7:!0,8:null},this.$touchEnabled=!0}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"hostComponentKey",function(){return this.$Component[0]},function(t){this.$Component[0]=t}),n(r,"skinName",function(){return this.$Component[1]},function(t){var e=this.$Component;if(e[5]=!0,e[1]!=t){if(t)e[1]=t;else if(this.$stage){var i=this.$stage.getImplementation("eui.Theme");if(i){var n=i.getSkinName(this);n&&(e[1]=n)}}this.$parseSkinName()}}),r.$parseSkinName=function(){var t,e=this.skinName;if(e)if(e.prototype)t=new e;else if("string"==typeof e){var i,n=e.trim();if("<"==n.charAt(0))i=EXML.parse(n);else if(i=egret.getDefinitionByName(e),!i&&-1!=n.toLowerCase().indexOf(".exml"))return void EXML.load(e,this.onExmlLoaded,this,!0);i&&(t=new i)}else t=e;this.setSkin(t)},r.onExmlLoaded=function(t,e){if(this.skinName==e){var i=new t;this.setSkin(i)}},n(r,"skin",function(){return this.$Component[8]}),r.setSkin=function(e){!e||e instanceof t.Skin||(e=null);var i=this.$Component,n=i[8];if(n){for(var s=n.skinParts,r=s.length,a=0;r>a;a++){var o=s[a];this[o]&&this.setSkinPart(o,null)}var h=n.$elementsContent;if(h){r=h.length;for(var a=0;r>a;a++){var l=h[a];l.$parent==this&&this.removeChild(l)}}n.hostComponent=null}if(i[8]=e,e){for(var s=e.skinParts,r=s.length,a=0;r>a;a++){var o=s[a],u=e[o];u&&this.setSkinPart(o,u)}if(h=e.$elementsContent)for(a=h.length-1;a>=0;a--)this.addChildAt(h[a],0);e.hostComponent=this}this.invalidateSize(),this.invalidateDisplayList(),this.dispatchEventWith(egret.Event.COMPLETE)},r.setSkinPart=function(t,e){var i=this[t];i&&this.partRemoved(t,i),this[t]=e,e&&this.partAdded(t,e)},r.partAdded=function(t,e){},r.partRemoved=function(t,e){},r.$setTouchChildren=function(t){t=!!t;var i=this.$Component;return i[6]=t,i[3]?(i[6]=t,e.prototype.$setTouchChildren.call(this,t)):!0},r.$setTouchEnabled=function(t){t=!!t;var i=this.$Component;return i[7]=t,i[3]?e.prototype.$setTouchEnabled.call(this,t):!0},n(r,"enabled",function(){return this.$Component[3]},function(t){t=!!t,this.$setEnabled(t)}),r.$setEnabled=function(t){var e=this.$Component;return t===e[3]?!1:(e[3]=t,t?(this.$touchEnabled=e[7],this.$touchChildren=e[6]):(this.$touchEnabled=!1,this.$touchChildren=!1),this.invalidateState(),!0)},n(r,"currentState",function(){var t=this.$Component;return t[2]?t[2]:this.getCurrentState()},function(t){var e=this.$Component;t!=e[2]&&(e[2]=t,this.invalidateState())}),r.invalidateState=function(){var t=this.$Component;t[4]||(t[4]=!0,this.invalidateProperties())},r.getCurrentState=function(){return""},r.createChildren=function(){var t=this.$Component;if(!t[1]){var e=this.$stage.getImplementation("eui.Theme");if(e){var i=e.getSkinName(this);i&&(t[1]=i,this.$parseSkinName())}}},r.childrenCreated=function(){},r.commitProperties=function(){t.sys.UIComponentImpl.prototype.commitProperties.call(this);var e=this.$Component;e[4]&&(e[4]=!1,e[8]&&(e[8].currentState=this.currentState))},r.measure=function(){t.sys.measure(this);var e=this.$Component[8];if(e){var i=this.$UIComponent;isNaN(e.width)?(i[16]e.maxWidth&&(i[16]=e.maxWidth)):i[16]=e.width,isNaN(e.height)?(i[17]e.maxHeight&&(i[17]=e.maxHeight)):i[17]=e.height}},r.updateDisplayList=function(e,i){t.sys.updateDisplayList(this,e,i)},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,e){},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},i}(egret.DisplayObjectContainer);t.Component=e,egret.registerClass(e,"eui.Component",["eui.UIComponent"]),t.registerProperty(e,"skinName","Class"),t.sys.implementUIComponent(e,egret.DisplayObjectContainer,!0)}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this),this.labelDisplay=null,this._label="",this.iconDisplay=null,this._icon=null,this.touchCaptured=!1,this.touchChildren=!1,this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this)}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"label",function(){return this._label},function(t){this._label=t,this.labelDisplay&&(this.labelDisplay.text=t)}),i(s,"icon",function(){return this._icon},function(t){this._icon=t,this.iconDisplay&&(this.iconDisplay.source=t)}),s.onTouchCancle=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.touchCaptured=!1,this.invalidateState()},s.onTouchBegin=function(t){this.$stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.touchCaptured=!0,this.invalidateState(),t.updateAfterEvent()},s.onStageTouchEnd=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.contains(t.target)&&this.buttonReleased(),this.touchCaptured=!1,this.invalidateState()},s.getCurrentState=function(){return this.enabled?this.touchCaptured?"down":"up":"disabled"},s.partAdded=function(t,e){e===this.labelDisplay?this.labelDisplay.text=this._label:e==this.iconDisplay&&(this.iconDisplay.source=this._icon)},s.buttonReleased=function(){},e}(t.Component);t.Button=e,egret.registerClass(e,"eui.Button")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.apply(this,arguments),this.$selected=!1,this.$autoSelected=!0}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"selected",function(){return this.$selected},function(t){this.$setSelected(t)}),r.$setSelected=function(e){return e=!!e,e===this.$selected?!1:(this.$selected=e,this.invalidateState(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selected"),!0)},r.getCurrentState=function(){var t=e.prototype.getCurrentState.call(this);if(this.$selected){var i=t+"AndSelected",n=this.skin;return n&&n.hasState(i)?i:"disabled"==t?"disabled":"down"}return t},r.buttonReleased=function(){this.$autoSelected&&(this.selected=!this.$selected,this.dispatchEventWith(egret.Event.CHANGE))},i}(t.Button);t.ToggleButton=e,egret.registerClass(e,"eui.ToggleButton"),t.registerBindable(e.prototype,"selected")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this)}__extends(e,t);var i=(__define,e);i.prototype;return e}(t.ToggleButton);t.CheckBox=e,egret.registerClass(e,"eui.CheckBox")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(t,i){void 0===i&&(i=[]),e.call(this),this.name=t,this.overrides=i}__extends(i,e);var n=(__define,i),s=n.prototype;return s.initialize=function(e,i){for(var n=this.overrides,s=n.length,r=0;s>r;r++){var a=n[r];if(a instanceof t.AddItems){var o=e[a.target];o&&o instanceof t.Image&&!o.$parent&&(i.addChild(o),i.removeChild(o))}}},i}(egret.HashObject);t.State=e,egret.registerClass(e,"eui.State")}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e=function(){function t(){}var e=__define,i=t,n=i.prototype;return e(n,"states",function(){return this.$stateValues.states},function(t){t||(t=[]);var e=this.$stateValues;e.states=t;for(var i={},n=t.length,s=0;n>s;s++){var r=t[s];i[r.name]=r}e.statesMap=i,e.parent&&this.commitCurrentState()}),e(n,"currentState",function(){return this.$stateValues.currentState},function(t){var e=this.$stateValues;e.explicitState=t,e.currentState=t,this.commitCurrentState()}),n.commitCurrentState=function(){var t=this.$stateValues;if(t.parent){var e=t.statesMap[t.currentState];if(!e){if(!(t.states.length>0))return;t.currentState=t.states[0].name}if(t.oldState!=t.currentState){var i=t.parent,n=t.statesMap[t.oldState];if(n)for(var s=n.overrides,r=s.length,a=0;r>a;a++)s[a].remove(this,i);if(t.oldState=t.currentState,n=t.statesMap[t.currentState])for(s=n.overrides,r=s.length,a=0;r>a;a++)s[a].apply(this,i) +}}},n.hasState=function(t){return!!this.$stateValues.statesMap[t]},n.initializeStates=function(t){this.$stateValues.intialized=!0;for(var e=this.states,i=e.length,n=0;i>n;n++)e[n].initialize(this,t)},t}();t.StateClient=e,egret.registerClass(e,"eui.sys.StateClient");var i=function(){function t(){this.intialized=!1,this.statesMap={},this.states=[],this.oldState=null,this.explicitState=null,this.currentState=null,this.parent=null,this.stateIsDirty=!1}var e=(__define,t);e.prototype;return t}();t.StateValues=i,egret.registerClass(i,"eui.sys.StateValues")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$layout=null,this.$stateValues=new t.sys.StateValues,this.initializeUIValues(),this.$Group={0:0,1:0,2:0,3:0,4:!1,5:!1},this.$stateValues.parent=this}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"elementsContent",void 0,function(t){if(t)for(var e=t.length,i=0;e>i;i++)this.addChild(t[i])}),n(r,"layout",function(){return this.$layout},function(t){this.$setLayout(t)}),r.$setLayout=function(t){return this.$layout==t?!1:(this.$layout&&(this.$layout.target=null),this.$layout=t,t&&(t.target=this),this.invalidateSize(),this.invalidateDisplayList(),!0)},n(r,"contentWidth",function(){return this.$Group[0]}),n(r,"contentHeight",function(){return this.$Group[1]}),r.setContentSize=function(e,i){e=Math.ceil(+e||0),i=Math.ceil(+i||0);var n=this.$Group,s=n[0]!==e,r=n[1]!==i;(s||r)&&(n[0]=e,n[1]=i,s&&t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"contentWidth"),r&&t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"contentHeight"))},n(r,"scrollEnabled",function(){return this.$Group[4]},function(t){t=!!t;var e=this.$Group;t!==e[4]&&(e[4]=t,this.updateScrollRect())}),n(r,"scrollH",function(){return this.$Group[2]},function(e){e=+e||0;var i=this.$Group;e!==i[2]&&(i[2]=e,this.updateScrollRect()&&this.$layout&&this.$layout.scrollPositionChanged(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"scrollH"))}),n(r,"scrollV",function(){return this.$Group[3]},function(e){e=+e||0;var i=this.$Group;e!=i[3]&&(i[3]=e,this.updateScrollRect()&&this.$layout&&this.$layout.scrollPositionChanged(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"scrollV"))}),r.updateScrollRect=function(){var t=this.$Group,e=t[4];if(e){var i=this.$UIComponent;this.scrollRect=egret.$TempRectangle.setTo(t[2],t[3],i[10],i[11])}else this.$scrollRect&&(this.scrollRect=null);return e},n(r,"numElements",function(){return this.$children.length}),r.getElementAt=function(t){return this.$children[t]},r.getVirtualElementAt=function(t){return this.getElementAt(t)},r.setVirtualElementIndicesInView=function(t,e){},n(r,"touchThrough",function(){return this.$Group[5]},function(t){this.$Group[5]=!!t}),r.$hitTest=function(t,i){var n=e.prototype.$hitTest.call(this,t,i);if(n||this.$Group[5])return n;if(!this.$visible||!this.touchEnabled)return null;var s=this.globalToLocal(t,i,egret.$TempPoint),r=this.$UIComponent,a=egret.$TempRectangle.setTo(0,0,r[10],r[11]),o=this.$scrollRect;return o&&(a.x=o.x,a.y=o.y),a.contains(s.x,s.y)?this:null},r.invalidateState=function(){var t=this.$stateValues;t.stateIsDirty||(t.stateIsDirty=!0,this.invalidateProperties())},r.getCurrentState=function(){return""},r.createChildren=function(){this.$layout||this.$setLayout(new t.BasicLayout),this.initializeStates(this.$stage)},r.childrenCreated=function(){},r.commitProperties=function(){t.sys.UIComponentImpl.prototype.commitProperties.call(this);var e=this.$stateValues;e.stateIsDirty&&(e.stateIsDirty=!1,e.explicitState||(e.currentState=this.getCurrentState(),this.commitCurrentState()))},r.measure=function(){return this.$layout?void this.$layout.measure():void this.setMeasuredSize(0,0)},r.updateDisplayList=function(t,e){this.$layout&&this.$layout.updateDisplayList(t,e),this.updateScrollRect()},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,e){},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},i}(egret.DisplayObjectContainer);t.Group=e,egret.registerClass(e,"eui.Group",["eui.IViewport","eui.UIComponent"]),t.sys.implementUIComponent(e,egret.DisplayObjectContainer,!0),t.sys.mixin(e,t.sys.StateClient),t.registerProperty(e,"elementsContent","Array",!0),t.registerProperty(e,"states","State[]")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$dataProviderChanged=!1,this.$dataProvider=null,this.$indexToRenderer=[],this.$DataGroup={0:!0,1:!1,2:{},3:{},4:!1,5:!1,6:null,7:null,8:!1,9:null,10:!1,11:!1,12:null,13:null,14:!1}}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"useVirtualLayout",function(){return this.$layout?this.$layout.$useVirtualLayout:this.$DataGroup[0]},function(t){t=!!t;var e=this.$DataGroup;t!==e[0]&&(e[0]=t,this.$layout&&(this.$layout.useVirtualLayout=t))}),r.$setLayout=function(t){if(t==this.$layout)return!1;this.$layout&&(this.$layout.setTypicalSize(0,0),this.$layout.removeEventListener("useVirtualLayoutChanged",this.onUseVirtualLayoutChanged,this)),this.$layout&&t&&this.$layout.$useVirtualLayout!=t.$useVirtualLayout&&this.onUseVirtualLayoutChanged();var i=e.prototype.$setLayout.call(this,t);if(t){var n=this.$DataGroup[9];n&&t.setTypicalSize(n.width,n.height),t.useVirtualLayout=this.$DataGroup[0],t.addEventListener("useVirtualLayoutChanged",this.onUseVirtualLayoutChanged,this)}return i},r.onUseVirtualLayoutChanged=function(t){var e=this.$DataGroup;e[1]=!0,e[10]=!0,this.removeDataProviderListener(),this.invalidateProperties()},r.setVirtualElementIndicesInView=function(t,e){if(this.$layout&&this.$layout.$useVirtualLayout)for(var i=this.$indexToRenderer,n=Object.keys(i),s=n.length,r=0;s>r;r++){var a=+n[r];(t>a||a>e)&&this.freeRendererByIndex(a)}},r.getElementAt=function(t){return this.$indexToRenderer[t]},r.getVirtualElementAt=function(t){if(t=0|+t,0>t||t>=this.$dataProvider.length)return null;var e=this.$indexToRenderer[t];if(!e){var i=this.$dataProvider.getItemAt(t);e=this.createVirtualRenderer(i),this.$indexToRenderer[t]=e,this.updateRenderer(e,t,i);var n=this.$DataGroup;n[4]&&(e.validateNow(),n[4]=!1,this.rendererAdded(e,t,i))}return e},r.freeRendererByIndex=function(t){var e=this.$indexToRenderer[t];e&&(delete this.$indexToRenderer[t],this.doFreeRenderer(e))},r.doFreeRenderer=function(t){var e=this.$DataGroup,i=e[2][t.$hashCode],n=i.$hashCode;e[3][n]||(e[3][n]=[]),e[3][n].push(t),t.visible=!1},r.invalidateSize=function(){this.$DataGroup[4]||e.prototype.invalidateSize.call(this)},r.createVirtualRenderer=function(t){var e,i=this.itemToRendererClass(t),n=i.$hashCode,s=this.$DataGroup,r=s[3];return r[n]&&r[n].length>0?(e=r[n].pop(),e.visible=!0,this.invalidateDisplayList(),e):(s[4]=!0,this.createOneRenderer(i))},r.createOneRenderer=function(t){var e=new t,i=this.$DataGroup;return i[2][e.$hashCode]=t,egret.is(e,"eui.IItemRenderer")?(i[13]&&this.setItemRenderSkinName(e,i[13]),this.addChild(e),e):null},r.setItemRenderSkinName=function(e,i){if(e&&e instanceof t.Component){var n=e;n.$Component[5]||(n.skinName=i,n.$Component[5]=!1)}},n(r,"dataProvider",function(){return this.$dataProvider},function(t){this.$setDataProvider(t)}),r.$setDataProvider=function(t){return this.$dataProvider==t?!1:(this.removeDataProviderListener(),this.$dataProvider=t,this.$dataProviderChanged=!0,this.$DataGroup[10]=!0,this.invalidateProperties(),this.invalidateSize(),this.invalidateDisplayList(),!0)},r.removeDataProviderListener=function(){this.$dataProvider&&this.$dataProvider.removeEventListener(t.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this)},r.onCollectionChange=function(e){switch(e.kind){case t.CollectionEventKind.ADD:this.itemAddedHandler(e.items,e.location);break;case t.CollectionEventKind.REMOVE:this.itemRemovedHandler(e.items,e.location);break;case t.CollectionEventKind.UPDATE:case t.CollectionEventKind.REPLACE:this.itemUpdatedHandler(e.items[0],e.location);break;case t.CollectionEventKind.RESET:case t.CollectionEventKind.REFRESH:if(this.$layout&&this.$layout.$useVirtualLayout)for(var i=this.$indexToRenderer,n=Object.keys(i),s=n.length,r=s-1;r>=0;r--){var a=+n[r];this.freeRendererByIndex(a)}this.$dataProviderChanged=!0,this.invalidateProperties()}this.invalidateSize(),this.invalidateDisplayList()},r.itemAddedHandler=function(t,e){for(var i=t.length,n=0;i>n;n++)this.itemAdded(t[n],e+n);this.resetRenderersIndices()},r.itemRemovedHandler=function(t,e){for(var i=t.length,n=i-1;n>=0;n--)this.itemRemoved(t[n],e+n);this.resetRenderersIndices()},r.itemAdded=function(t,e){if(this.$layout&&this.$layout.elementAdded(e),this.$layout&&this.$layout.$useVirtualLayout)return void this.$indexToRenderer.splice(e,0,null);var i=this.createVirtualRenderer(t);if(this.$indexToRenderer.splice(e,0,i),i){this.updateRenderer(i,e,t);var n=this.$DataGroup;n[4]&&(n[4]=!1,this.rendererAdded(i,e,t))}},r.itemRemoved=function(t,e){this.$layout&&this.$layout.elementRemoved(e);var i=this.$indexToRenderer[e];this.$indexToRenderer.length>e&&this.$indexToRenderer.splice(e,1),i&&(this.$layout&&this.$layout.$useVirtualLayout?this.doFreeRenderer(i):(this.rendererRemoved(i,e,t),this.removeChild(i)))},r.resetRenderersIndices=function(){var t=this.$indexToRenderer;if(0!=t.length)if(this.$layout&&this.$layout.$useVirtualLayout)for(var e=Object.keys(t),i=e.length,n=0;i>n;n++){var s=+e[n];this.resetRendererItemIndex(s)}else{var r=t.length;for(s=0;r>s;s++)this.resetRendererItemIndex(s)}},r.itemUpdatedHandler=function(t,e){if(!this.$DataGroup[11]){var i=this.$indexToRenderer[e];i&&this.updateRenderer(i,e,t)}},r.resetRendererItemIndex=function(t){var e=this.$indexToRenderer[t];e&&(e.itemIndex=t)},n(r,"itemRenderer",function(){return this.$DataGroup[6]},function(t){var e=this.$DataGroup;e[6]!=t&&(e[6]=t,e[5]=!0,e[8]=!0,e[10]=!0,this.removeDataProviderListener(),this.invalidateProperties())}),n(r,"itemRendererSkinName",function(){return this.$DataGroup[13]},function(t){var e=this.$DataGroup;e[13]!=t&&(e[13]=t,this.$UIComponent[29]&&(e[14]=!0,this.invalidateProperties()))}),n(r,"itemRendererFunction",function(){return this.$DataGroup[7]},function(t){var e=this.$DataGroup;e[7]!=t&&(e[7]=t,e[5]=!0,e[8]=!0,this.removeDataProviderListener(),this.invalidateProperties())}),r.itemToRendererClass=function(e){var i,n=this.$DataGroup;return n[7]&&(i=n[7](e)),i||(i=n[6]),i||(i=t.ItemRenderer),i.$hashCode||(i.$hashCode=egret.$hashCount++),i},r.createChildren=function(){if(!this.$layout){var i=new t.VerticalLayout;i.gap=0,i.horizontalAlign=t.JustifyAlign.CONTENT_JUSTIFY,this.$setLayout(i)}e.prototype.createChildren.call(this)},r.commitProperties=function(){var i=this.$DataGroup;if((i[5]||this.$dataProviderChanged||i[1])&&(this.removeAllRenderers(),this.$layout&&this.$layout.clearVirtualLayoutCache(),this.setTypicalLayoutRect(null),i[1]=!1,i[5]=!1,this.$dataProvider&&this.$dataProvider.addEventListener(t.CollectionEvent.COLLECTION_CHANGE,this.onCollectionChange,this),this.$layout&&this.$layout.$useVirtualLayout?(this.invalidateSize(),this.invalidateDisplayList()):this.createRenderers(),this.$dataProviderChanged&&(this.$dataProviderChanged=!1,this.scrollV=this.scrollH=0)),e.prototype.commitProperties.call(this),i[8]&&(i[8]=!1,this.$dataProvider&&this.$dataProvider.length>0&&(i[12]=this.$dataProvider.getItemAt(0),this.measureRendererSize())),i[14]){i[14]=!1;for(var n=i[13],s=this.$indexToRenderer,r=Object.keys(s),a=r.length,o=0;a>o;o++){var h=r[o];this.setItemRenderSkinName(s[h],n)}for(var l=i[3],r=Object.keys(l),a=r.length,o=0;a>o;o++)for(var u=r[o],d=l[u],a=d.length,o=0;a>o;o++)this.setItemRenderSkinName(d[o],n)}},r.measure=function(){this.$layout&&this.$layout.$useVirtualLayout&&this.ensureTypicalLayoutElement(),e.prototype.measure.call(this)},r.updateDisplayList=function(t,i){var n=this.$layout&&this.$layout.$useVirtualLayout;n&&this.ensureTypicalLayoutElement(),e.prototype.updateDisplayList.call(this,t,i);var s=this.$DataGroup;if(n){var r=s[9];if(r){var a=this.$indexToRenderer[0];if(a){var o=egret.$TempRectangle;a.getPreferredBounds(o),(o.width!=r.width||o.height!=r.height)&&(s[9]=null)}}}},r.ensureTypicalLayoutElement=function(){this.$DataGroup[9]||this.$dataProvider&&this.$dataProvider.length>0&&(this.$DataGroup[12]=this.$dataProvider.getItemAt(0),this.measureRendererSize())},r.measureRendererSize=function(){var t=this.$DataGroup;if(!t[12])return void this.setTypicalLayoutRect(null);var e=this.createVirtualRenderer(t[12]);if(!e)return void this.setTypicalLayoutRect(null);this.updateRenderer(e,0,t[12]),e.validateNow();var i=egret.$TempRectangle;e.getPreferredBounds(i);var n=new egret.Rectangle(0,0,i.width,i.height);this.$layout&&this.$layout.$useVirtualLayout?(t[4]&&this.rendererAdded(e,0,t[12]),this.doFreeRenderer(e)):this.removeChild(e),this.setTypicalLayoutRect(n),t[4]=!1},r.setTypicalLayoutRect=function(t){this.$DataGroup[9]=t,this.$layout&&(t?this.$layout.setTypicalSize(t.width,t.height):this.$layout.setTypicalSize(0,0))},r.removeAllRenderers=function(){for(var t=this.$indexToRenderer,e=Object.keys(t),i=e.length,n=0;i>n;n++){var s=e[n],r=t[s];r&&(this.rendererRemoved(r,r.itemIndex,r.data),this.removeChild(r))}this.$indexToRenderer=[];var a=this.$DataGroup;if(a[10]){for(var o=a[3],e=Object.keys(o),i=e.length,n=0;i>n;n++)for(var h=e[n],l=o[h],i=l.length,n=0;i>n;n++)r=l[n],this.rendererRemoved(r,r.itemIndex,r.data),this.removeChild(r);a[3]={},a[2]={},a[10]=!1}},r.createRenderers=function(){if(this.$dataProvider)for(var t=0,e=this.$dataProvider.length,i=0;e>i;i++){var n=this.$dataProvider.getItemAt(i),s=this.itemToRendererClass(n),r=this.createOneRenderer(s);r&&(this.$indexToRenderer[t]=r,this.updateRenderer(r,t,n),this.rendererAdded(r,t,n),t++)}},r.updateRenderer=function(t,e,i){var n=this.$DataGroup;return n[11]=!0,t.itemIndex=e,t.data=i,n[11]=!1,t},n(r,"numElements",function(){return this.$dataProvider?this.$dataProvider.length:0}),r.rendererAdded=function(t,e,i){},r.rendererRemoved=function(t,e,i){},i}(t.Group);t.DataGroup=e,egret.registerClass(e,"eui.DataGroup"),t.registerProperty(e,"itemRenderer","Class"),t.registerProperty(e,"itemRendererSkinName","Class"),t.registerProperty(e,"dataProvider","eui.ICollection",!0)}(eui||(eui={}));var eui;!function(t){var e=t.sys.UIComponentImpl,i=function(i){function n(){i.call(this),this._widthConstraint=0/0,this.$isShowPrompt=!1,this.$promptColor=6710886,this.$isFocusIn=!1,this.initializeUIValues(),this.type=egret.TextFieldType.INPUT,this.$EditableText={0:null,1:16777215,2:!1}}__extends(n,i);var s=__define,r=n,a=r.prototype;return a.$invalidateContentBounds=function(){i.prototype.$invalidateContentBounds.call(this),this.invalidateSize()},a.$setWidth=function(t){var n=i.prototype.$setWidth.call(this,t),s=e.prototype.$setWidth.call(this,t);return n&&s},a.$setHeight=function(t){var n=i.prototype.$setHeight.call(this,t),s=e.prototype.$setHeight.call(this,t);return n&&s},a.$getText=function(){var t=i.prototype.$getText.call(this);return t==this.$EditableText[0]&&(t=""),t},a.$setText=function(e){var n=this.$EditableText[0];(n!=e||null==n)&&(this.$isShowPrompt=!1,this.textColor=this.$EditableText[1]),this.$isFocusIn||(""==e||null==e)&&(e=n,this.$isShowPrompt=!0,i.prototype.$setTextColor.call(this,this.$promptColor));var s=i.prototype.$setText.call(this,e);return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"text"),s},a.$onAddToStage=function(e,i){t.sys.UIComponentImpl.prototype.$onAddToStage.call(this,e,i),this.addEventListener(egret.FocusEvent.FOCUS_IN,this.onfocusIn,this),this.addEventListener(egret.FocusEvent.FOCUS_OUT,this.onfocusOut,this)},a.$onRemoveFromStage=function(){t.sys.UIComponentImpl.prototype.$onRemoveFromStage.call(this),this.removeEventListener(egret.FocusEvent.FOCUS_IN,this.onfocusIn,this),this.removeEventListener(egret.FocusEvent.FOCUS_OUT,this.onfocusOut,this)},s(a,"prompt",function(){return this.$EditableText[0]},function(t){var e=this.$EditableText,i=e[0];if(i!=t){e[0]=t;var n=this.text;n&&n!=i||this.showPromptText()}}),s(a,"promptColor",function(){return this.$promptColor},function(t){if(t=0|+t,this.$promptColor!=t){this.$promptColor=t;var e=this.text;e&&e!=this.$EditableText[0]||this.showPromptText()}}),a.onfocusOut=function(){this.$isFocusIn=!1,this.text||this.showPromptText()},a.onfocusIn=function(){this.$isFocusIn=!0,this.$isShowPrompt=!1,this.displayAsPassword=this.$EditableText[2];var t=this.$EditableText,e=this.text;e&&e!=t[0]||(this.textColor=t[1],this.text="")},a.showPromptText=function(){var t=this.$EditableText;this.$isShowPrompt=!0,i.prototype.$setTextColor.call(this,this.$promptColor),i.prototype.$setDisplayAsPassword.call(this,!1),this.text=t[0]},a.$setTextColor=function(t){return t=0|+t,this.$EditableText[1]=t,this.$isShowPrompt||i.prototype.$setTextColor.call(this,t),!0},a.$setDisplayAsPassword=function(t){return this.$EditableText[2]=t,this.$isShowPrompt||i.prototype.$setDisplayAsPassword.call(this,t),!0},a.createChildren=function(){this.onfocusOut()},a.childrenCreated=function(){},a.commitProperties=function(){},a.measure=function(){var t=this.$UIComponent,e=this.$TextField,n=e[3],s=0/0;isNaN(this._widthConstraint)?isNaN(t[8])?1e5!=t[13]&&(s=t[13]):s=t[8]:(s=this._widthConstraint,this._widthConstraint=0/0),i.prototype.$setWidth.call(this,s),this.setMeasuredSize(this.textWidth,this.textHeight),i.prototype.$setWidth.call(this,n)},a.updateDisplayList=function(t,e){i.prototype.$setWidth.call(this,t),i.prototype.$setHeight.call(this,e)},a.invalidateParentLayout=function(){},a.setMeasuredSize=function(t,e){},a.invalidateProperties=function(){},a.validateProperties=function(){},a.invalidateSize=function(){},a.validateSize=function(t){},a.invalidateDisplayList=function(){},a.validateDisplayList=function(){},a.validateNow=function(){},a.setLayoutBoundsSize=function(t,i){if(e.prototype.setLayoutBoundsSize.call(this,t,i),!isNaN(t)&&t!==this._widthConstraint&&0!=t){var n=this.$UIComponent;isNaN(n[9])&&t!=n[16]&&(this._widthConstraint=t,this.invalidateSize())}},a.setLayoutBoundsPosition=function(t,e){},a.getLayoutBounds=function(t){},a.getPreferredBounds=function(t){},n}(egret.TextField);t.EditableText=i,egret.registerClass(i,"eui.EditableText",["eui.UIComponent","eui.IDisplayText"]),t.sys.implementUIComponent(i,egret.TextField),t.registerBindable(i.prototype,"text")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.thumb=null,this.$viewport=null,this.autoVisibility=!0}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"viewport",function(){return this.$viewport},function(e){if(e!=this.$viewport){var i=this.$viewport;i&&(i.removeEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.onPropertyChanged,this),i.removeEventListener(egret.Event.RESIZE,this.onViewportResize,this)),this.$viewport=e,e&&(e.addEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.onPropertyChanged,this),e.addEventListener(egret.Event.RESIZE,this.onViewportResize,this)),this.invalidateDisplayList()}}),r.onViewportResize=function(t){this.invalidateDisplayList()},r.onPropertyChanged=function(t){},i}(t.Component);t.ScrollBarBase=e,egret.registerClass(e,"eui.ScrollBarBase")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.apply(this,arguments)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.updateDisplayList=function(e,i){t.prototype.updateDisplayList.call(this,e,i);var n=this.thumb,s=this.$viewport;if(n&&s){var r=egret.$TempRectangle;n.getPreferredBounds(r);var a=r.width,o=r.y,h=s.scrollH,l=s.contentWidth,u=s.width;if(0>=h){var d=a*(1- -h/(.5*u));d=Math.max(5,Math.round(d)),n.setLayoutBoundsSize(d,0/0),n.setLayoutBoundsPosition(0,o)}else if(h>=l-u)d=a*(1-(h-l+u)/(.5*u)),d=Math.max(5,Math.round(d)),n.setLayoutBoundsSize(d,0/0),n.setLayoutBoundsPosition(e-d,o);else{var c=(e-a)*h/(l-u);n.setLayoutBoundsSize(0/0,0/0),n.setLayoutBoundsPosition(c,o)}}},n.onPropertyChanged=function(t){switch(t.property){case"scrollH":case"contentWidth":this.invalidateDisplayList()}},e}(t.ScrollBarBase);t.HScrollBar=e,egret.registerClass(e,"eui.HScrollBar")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$Range={0:100,1:!1,2:0,3:!1,4:0,5:0,6:!1,7:1,8:!1,9:!1}}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"maximum",function(){return this.$Range[0]},function(t){t=+t||0;var e=this.$Range;t!==e[0]&&(e[0]=t,e[1]=!0,this.invalidateProperties(),this.invalidateDisplayList())}),n(r,"minimum",function(){return this.$Range[2]},function(t){t=+t||0;var e=this.$Range;t!==e[2]&&(e[2]=t,e[3]=!0,this.invalidateProperties(),this.invalidateDisplayList())}),n(r,"value",function(){var t=this.$Range;return t[6]?t[5]:t[4]},function(t){t=+t||0,this.$setValue(t)}),r.$setValue=function(t){if(t===this.value)return!1;var e=this.$Range;return e[5]=t,e[6]=!0,this.invalidateProperties(),!0},n(r,"snapInterval",function(){return this.$Range[7]},function(t){var e=this.$Range;e[9]=!0,t=+t||0,t!==e[7]&&(isNaN(t)?(e[7]=1,e[9]=!1):e[7]=t,e[8]=!0,this.invalidateProperties())}),r.commitProperties=function(){e.prototype.commitProperties.call(this);var t=this.$Range;if(t[2]>t[0]&&(t[1]?t[0]=t[2]:t[2]=t[0]),t[6]||t[1]||t[3]||t[8]){var i=t[6]?t[5]:t[4];t[6]=!1,t[1]=!1,t[3]=!1,t[8]=!1,this.setValue(this.nearestValidValue(i,t[7]))}},r.nearestValidSize=function(t){var e=this.snapInterval;if(0==e)return t;var i=Math.round(t/e)*e;return Math.abs(i)=(o-a)/2?o:a;return h/s+i[2]},r.setValue=function(e){var i=this.$Range;i[4]!==e&&(i[0]>i[2]?i[4]=Math.min(i[0],Math.max(i[2],e)):i[4]=e,i[6]=!1,this.invalidateDisplayList(),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"value"))},r.updateDisplayList=function(t,i){e.prototype.updateDisplayList.call(this,t,i),this.updateSkinDisplayList()},r.updateSkinDisplayList=function(){},i}(t.Component);t.Range=e,egret.registerClass(e,"eui.Range"),t.registerBindable(e.prototype,"value")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.trackHighlight=null,this.thumb=null,this.track=null,this.$SliderBase={0:0,1:0,2:0,3:0,4:null,5:null,6:300,7:0,8:0,9:!0},this.maximum=10,this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this)}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"slideDuration",function(){return this.$SliderBase[6]},function(t){this.$SliderBase[6]=+t||0}),r.pointToValue=function(t,e){return this.minimum},n(r,"liveDragging",function(){return this.$SliderBase[9]},function(t){this.$SliderBase[9]=!!t}),n(r,"pendingValue",function(){return this.$SliderBase[7]},function(t){t=+t||0;var e=this.$SliderBase;t!==e[7]&&(e[7]=t,this.invalidateDisplayList())}),r.setValue=function(t){this.$SliderBase[7]=t,e.prototype.setValue.call(this,t)},r.partAdded=function(t,i){e.prototype.partAdded.call(this,t,i),i==this.thumb?(this.thumb.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onThumbTouchBegin,this),this.thumb.addEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this)):i==this.track?(this.track.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTrackTouchBegin,this),this.track.addEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this)):i===this.trackHighlight&&(this.trackHighlight.touchEnabled=!1,egret.is(this.trackHighlight,"egret.DisplayObjectContainer")&&(this.trackHighlight.touchChildren=!1))},r.partRemoved=function(t,i){e.prototype.partRemoved.call(this,t,i),i==this.thumb?(this.thumb.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onThumbTouchBegin,this),this.thumb.removeEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this)):i==this.track&&(this.track.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTrackTouchBegin,this),this.track.removeEventListener(egret.Event.RESIZE,this.onTrackOrThumbResize,this))},r.onTrackOrThumbResize=function(t){this.updateSkinDisplayList()},r.onThumbTouchBegin=function(e){var i=this.$SliderBase;i[5]&&i[5].isPlaying&&this.stopAnimation();var n=this.$stage;n.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.onStageTouchMove,this),n.addEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this);var s=this.thumb.globalToLocal(e.stageX,e.stageY,egret.$TempPoint);i[0]=s.x,i[1]=s.y,t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_START)},r.onStageTouchMove=function(t){var e=this.$SliderBase;e[2]=t.$stageX,e[3]=t.$stageY;var i=this.track;if(i){var n=i.globalToLocal(e[2],e[3],egret.$TempPoint),s=this.pointToValue(n.x-e[0],n.y-e[1]);s=this.nearestValidValue(s,this.snapInterval),this.updateWhenTouchMove(s),t.updateAfterEvent()}},r.updateWhenTouchMove=function(t){t!=this.$SliderBase[7]&&(this.liveDragging?(this.setValue(t),this.dispatchEventWith(egret.Event.CHANGE)):this.pendingValue=t)},r.onStageTouchEnd=function(e){var i=e.$currentTarget;i.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onStageTouchMove,this),i.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END);var n=this.$SliderBase;this.liveDragging||this.value==n[7]||(this.setValue(n[7]),this.dispatchEventWith(egret.Event.CHANGE))},r.onTouchBegin=function(t){this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.stageTouchEndHandler,this),this.$SliderBase[4]=t.$target},r.stageTouchEndHandler=function(t){var e=t.$target,i=this.$SliderBase;t.$currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END,this.stageTouchEndHandler,this),i[4]!=e&&this.contains(e)&&egret.TouchEvent.dispatchTouchEvent(this,egret.TouchEvent.TOUCH_TAP,!0,!0,t.$stageX,t.$stageY,t.touchPointID),i[4]=null},r.$animationUpdateHandler=function(t){this.pendingValue=t.currentValue},r.animationEndHandler=function(e){this.setValue(this.$SliderBase[8]),this.dispatchEventWith(egret.Event.CHANGE),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END)},r.stopAnimation=function(){this.$SliderBase[5].stop(),this.setValue(this.nearestValidValue(this.pendingValue,this.snapInterval)),this.dispatchEventWith(egret.Event.CHANGE),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END)},r.onTrackTouchBegin=function(e){var i=this.thumb?this.thumb.width:0,n=this.thumb?this.thumb.height:0,s=e.$stageX-i/2,r=e.$stageY-n/2,a=this.track.globalToLocal(s,r,egret.$TempPoint),o=this.$Range,h=this.pointToValue(a.x,a.y);h=this.nearestValidValue(h,o[7]);var l=this.$SliderBase;if(h!=l[7])if(0!=l[6]){l[5]||(l[5]=new t.sys.Animation(this.$animationUpdateHandler,this),l[5].endFunction=this.animationEndHandler);var u=l[5];u.isPlaying&&this.stopAnimation(),l[8]=h,u.duration=l[6]*(Math.abs(l[7]-l[8])/(o[0]-o[2])),u.from=l[7],u.to=l[8],t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_START),u.play()}else this.setValue(h),this.dispatchEventWith(egret.Event.CHANGE)},i}(t.Range);t.SliderBase=e,egret.registerClass(e,"eui.SliderBase")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.pointToValue=function(t,e){if(!this.thumb||!this.track)return 0;var i=this.$Range,n=i[0]-i[2],s=this.getThumbRange();return i[2]+(0!=s?t/s*n:0)},n.getThumbRange=function(){var t=egret.$TempRectangle;this.track.getLayoutBounds(t);var e=t.width;return this.thumb.getLayoutBounds(t),e-t.width},n.updateSkinDisplayList=function(){if(this.thumb&&this.track){var t=this.$Range,e=this.getThumbRange(),i=t[0]-t[2],n=i>0?(this.pendingValue-t[2])/i*e:0,s=this.track.localToGlobal(n,0,egret.$TempPoint),r=s.x,a=s.y,o=this.thumb.$parent.globalToLocal(r,a,egret.$TempPoint).x,h=egret.$TempRectangle;if(this.thumb.getLayoutBounds(h),this.thumb.setLayoutBoundsPosition(Math.round(o),h.y),this.trackHighlight&&this.trackHighlight.$parent){var l=this.trackHighlight.$parent.globalToLocal(r,a,egret.$TempPoint).x-n;this.trackHighlight.x=Math.round(l),this.trackHighlight.width=Math.round(n)}}},e}(t.SliderBase);t.HSlider=e,egret.registerClass(e,"eui.HSlider")}(eui||(eui={}));var eui;!function(t){var e=[],i={},n={},s=function(){function t(){}var s=(__define,t),r=s.prototype;return r.getAsset=function(t,s,r){var a=i[t];if(a)return void a.push([s,r]);var o=e.pop();o||(o=new egret.ImageLoader),i[t]=[[s,r]],n[o.$hashCode]=t,o.addEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),o.addEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this),o.load(t)},r.onLoadFinish=function(t){var s=t.currentTarget;s.removeEventListener(egret.Event.COMPLETE,this.onLoadFinish,this),s.removeEventListener(egret.IOErrorEvent.IO_ERROR,this.onLoadFinish,this);var r;t.$type==egret.Event.COMPLETE&&(r=new egret.Texture,r._setBitmapData(s.data),s.data=null),e.push(s);var a=n[s.$hashCode];delete n[s.$hashCode];var o=i[a];delete i[a];for(var h=o.length,l=0;h>l;l++){var u=o[l];u[0].call(u[1],r,a)}},t}();t.DefaultAssetAdapter=s,egret.registerClass(s,"eui.DefaultAssetAdapter",["eui.IAssetAdapter"])}(eui||(eui={}));var eui;!function(t){var e=new t.DefaultAssetAdapter,i=function(i){function n(t){i.call(this),this.sourceChanged=!1,this._source=null,this.initializeUIValues(),t&&(this.source=t)}__extends(n,i);var s=__define,r=n,a=r.prototype;return s(a,"scale9Grid",function(){return this.$scale9Grid},function(t){this.$scale9Grid=t,this.$invalidateContentBounds(),this.invalidateDisplayList()}),s(a,"fillMode",function(){return this.$fillMode},function(t){t!=this.$fillMode&&(this.$fillMode=t,this.invalidateDisplayList())}),a.$setFillMode=function(t){var e=i.prototype.$setFillMode.call(this,t);return this.invalidateDisplayList(),e},s(a,"source",function(){return this._source},function(t){t!=this._source&&(this._source=t,this.$stage?this.parseSource():(this.sourceChanged=!0,this.invalidateProperties()))}),a.$setBitmapData=function(t){if(t==this.$Bitmap[0])return!1;var e=i.prototype.$setBitmapData.call(this,t);return this.sourceChanged=!1,this.invalidateSize(),this.invalidateDisplayList(),e},a.parseSource=function(){this.sourceChanged=!1;var t=this._source;if(t&&"string"==typeof t){var i=this.$stage.getImplementation("eui.IAssetAdapter");i||(i=e),i.getAsset(this._source,this.contentChanged,this)}else this.$setBitmapData(t)},a.contentChanged=function(t,e){e===this._source&&egret.is(t,"egret.Texture")&&(this.$setBitmapData(t),t&&this.dispatchEventWith(egret.Event.COMPLETE))},a.$measureContentBounds=function(t){var e=(this.$Bitmap,this.$Bitmap[0]);if(e){var i=this.$UIComponent,n=i[10],s=i[11];if(isNaN(n)||isNaN(s))return void t.setEmpty();"clip"==this.$fillMode&&(n>e.$getTextureWidth()&&(n=e.$getTextureWidth()),s>e.$getTextureHeight()&&(s=e.$getTextureHeight())),t.setTo(0,0,n,s)}else t.setEmpty()},a.$render=function(){var t=this.$Bitmap[0];if(t){var e=this.$UIComponent,i=e[10],n=e[11];if(0!==i&&0!==n){var s=this.$Bitmap;egret.sys.BitmapNode.$updateTextureData(this.$renderNode,s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9],i,n,s[13],s[14],this.scale9Grid,this.$fillMode,s[10])}}},a.createChildren=function(){this.sourceChanged&&this.parseSource()},a.childrenCreated=function(){},a.commitProperties=function(){t.sys.UIComponentImpl.prototype.commitProperties.call(this),this.sourceChanged&&this.parseSource()},a.measure=function(){var t=this.$Bitmap[0];t?this.setMeasuredSize(t.$getTextureWidth(),t.$getTextureHeight()):this.setMeasuredSize(0,0)},a.updateDisplayList=function(t,e){this.$invalidateContentBounds()},a.invalidateParentLayout=function(){},a.setMeasuredSize=function(t,e){},a.invalidateProperties=function(){},a.validateProperties=function(){},a.invalidateSize=function(){},a.validateSize=function(t){},a.invalidateDisplayList=function(){},a.validateDisplayList=function(){},a.validateNow=function(){},a.setLayoutBoundsSize=function(t,e){},a.setLayoutBoundsPosition=function(t,e){},a.getLayoutBounds=function(t){},a.getPreferredBounds=function(t){},n }(egret.Bitmap);t.Image=i,egret.registerClass(i,"eui.Image",["eui.UIComponent"]),t.sys.implementUIComponent(i,egret.Bitmap),t.registerProperty(i,"scale9Grid","egret.Rectangle")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this._data=null,this._selected=!1,this.itemIndex=-1,this.touchCaptured=!1,this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this)}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"data",function(){return this._data},function(e){this._data=e,t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"data"),this.dataChanged()}),r.dataChanged=function(){},n(r,"selected",function(){return this._selected},function(t){this._selected!=t&&(this._selected=t,this.invalidateState())}),r.onTouchCancle=function(t){this.touchCaptured=!1;var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.invalidateState()},r.onTouchBegin=function(t){this.$stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.touchCaptured=!0,this.invalidateState(),t.updateAfterEvent()},r.onStageTouchEnd=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancle,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.onStageTouchEnd,this),this.touchCaptured=!1,this.invalidateState()},r.getCurrentState=function(){var t="up";if(this.touchCaptured&&(t="down"),this._selected){var e=t+"AndSelected",i=this.skin;return i&&i.hasState(e)?e:"disabled"==t?"disabled":"down"}return t},i}(t.Component);t.ItemRenderer=e,egret.registerClass(e,"eui.ItemRenderer",["eui.IItemRenderer","eui.UIComponent"]),t.registerBindable(e.prototype,"data")}(eui||(eui={}));var eui;!function(t){var e=t.sys.UIComponentImpl,i=function(i){function n(t){i.call(this),this._widthConstraint=0/0,this.availableWidth=0/0,this.initializeUIValues(),this.text=t}__extends(n,i);var s=(__define,n),r=s.prototype;return r.$invalidateContentBounds=function(){i.prototype.$invalidateContentBounds.call(this),this.invalidateSize()},r.$setWidth=function(t){var n=i.prototype.$setWidth.call(this,t),s=e.prototype.$setWidth.call(this,t);return n&&s},r.$setHeight=function(t){var n=i.prototype.$setHeight.call(this,t),s=e.prototype.$setHeight.call(this,t);return n&&s},r.$setText=function(e){var n=i.prototype.$setText.call(this,e);return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"text"),n},r.createChildren=function(){},r.childrenCreated=function(){},r.commitProperties=function(){},r.measure=function(){var t=this.$UIComponent,e=this.$TextField,n=e[3];isNaN(this._widthConstraint)?isNaN(t[8])?1e5!=t[13]&&(this.availableWidth=t[13]):this.availableWidth=t[8]:(this.availableWidth=this._widthConstraint,this._widthConstraint=0/0),i.prototype.$setWidth.call(this,this.availableWidth),this.setMeasuredSize(this.textWidth,this.textHeight),i.prototype.$setWidth.call(this,n)},r.updateDisplayList=function(t,e){i.prototype.$setWidth.call(this,t),i.prototype.$setHeight.call(this,e)},r.invalidateParentLayout=function(){},r.setMeasuredSize=function(t,e){},r.invalidateProperties=function(){},r.validateProperties=function(){},r.invalidateSize=function(){},r.validateSize=function(t){},r.invalidateDisplayList=function(){},r.validateDisplayList=function(){},r.validateNow=function(){},r.setLayoutBoundsSize=function(t,i){if(e.prototype.setLayoutBoundsSize.call(this,t,i),this._widthConstraint=t,!isNaN(t)&&t!==this._widthConstraint&&0!=t){var n=this.$UIComponent;isNaN(n[9])&&t!=n[16]&&this.invalidateSize()}},r.setLayoutBoundsPosition=function(t,e){},r.getLayoutBounds=function(t){},r.getPreferredBounds=function(t){},n}(egret.TextField);t.Label=i,egret.registerClass(i,"eui.Label",["eui.UIComponent","eui.IDisplayText"]),t.sys.implementUIComponent(i,egret.TextField),t.registerBindable(i.prototype,"text")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.$ListBase={0:!1,1:!1,2:-2,3:-1,4:!1,5:void 0,6:!1,7:null,8:!1}}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"requireSelection",function(){return this.$ListBase[0]},function(t){t=!!t;var e=this.$ListBase;t!==e[0]&&(e[0]=t,t&&(e[1]=!0,this.invalidateProperties()))}),n(r,"selectedIndex",function(){return this.$getSelectedIndex()},function(t){t=0|+t,this.setSelectedIndex(t,!1)}),r.$getSelectedIndex=function(){var t=this.$ListBase;return t[2]!=i.NO_PROPOSED_SELECTION?t[2]:t[3]},r.setSelectedIndex=function(t,e){if(t!=this.selectedIndex){var i=this.$ListBase;e&&(i[4]=i[4]||e),i[2]=t,this.invalidateProperties()}},n(r,"selectedItem",function(){var t=this.$ListBase;if(void 0!==t[5])return t[5];var e=this.$getSelectedIndex();if(e!=i.NO_SELECTION&&null!=this.$dataProvider)return this.$dataProvider.length>e?this.$dataProvider.getItemAt(e):void 0},function(t){this.setSelectedItem(t,!1)}),r.setSelectedItem=function(t,e){if(void 0===e&&(e=!1),this.selectedItem!==t){var i=this.$ListBase;e&&(i[4]=i[4]||e),i[5]=t,this.invalidateProperties()}},r.commitProperties=function(){var n=this.$dataProviderChanged;e.prototype.commitProperties.call(this);var s=this.$ListBase,r=this.$getSelectedIndex(),a=this.$dataProvider;n&&(r>=0&&a&&r0&&(s[2]=0)),void 0!==s[5]&&(a?s[2]=a.getItemIndex(s[5]):s[2]=i.NO_SELECTION,s[5]=void 0);var o=!1;s[2]!=i.NO_PROPOSED_SELECTION&&(o=this.commitSelection()),s[6]&&(s[6]=!1,o||t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedIndex"))},r.updateRenderer=function(t,i,n){return this.itemSelected(i,this.$isItemIndexSelected(i)),e.prototype.updateRenderer.call(this,t,i,n)},r.itemSelected=function(t,e){var i=this.$indexToRenderer[t];i&&(i.selected=e)},r.$isItemIndexSelected=function(t){return t==this.selectedIndex},r.commitSelection=function(e){void 0===e&&(e=!0);var n=this.$dataProvider,s=this.$ListBase,r=n?n.length-1:-1,a=s[3],o=s[2];if(or&&(o=r),s[0]&&o==i.NO_SELECTION&&n&&n.length>0)return s[2]=i.NO_PROPOSED_SELECTION,s[4]=!1,!1;if(s[4]){var h=this.dispatchEventWith(egret.Event.CHANGING,!1,!0);if(!h)return this.itemSelected(s[2],!1),s[2]=i.NO_PROPOSED_SELECTION,s[4]=!1,!1}return s[3]=o,s[2]=i.NO_PROPOSED_SELECTION,a!=i.NO_SELECTION&&this.itemSelected(a,!1),s[3]!=i.NO_SELECTION&&this.itemSelected(s[3],!0),e&&(s[4]&&(this.dispatchEventWith(egret.Event.CHANGE),s[4]=!1),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedIndex"),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedItem")),!0},r.adjustSelection=function(t,e){void 0===e&&(e=!1);var n=this.$ListBase;n[2]!=i.NO_PROPOSED_SELECTION?n[2]=t:n[3]=t,n[6]=!0,this.invalidateProperties()},r.itemAdded=function(t,n){e.prototype.itemAdded.call(this,t,n);var s=this.$getSelectedIndex();s==i.NO_SELECTION?this.$ListBase[0]&&this.adjustSelection(n,!0):s>=n&&this.adjustSelection(s+1,!0)},r.itemRemoved=function(t,n){if(e.prototype.itemRemoved.call(this,t,n),this.selectedIndex!=i.NO_SELECTION){var s=this.$getSelectedIndex();n==s?this.requireSelection&&this.$dataProvider&&this.$dataProvider.length>0?0==n?(this.$ListBase[2]=0,this.invalidateProperties()):this.setSelectedIndex(0,!1):this.adjustSelection(-1,!1):s>n&&this.adjustSelection(s-1,!1)}},r.onCollectionChange=function(n){e.prototype.onCollectionChange.call(this,n),n.kind==t.CollectionEventKind.RESET?0==this.$dataProvider.length&&this.setSelectedIndex(i.NO_SELECTION,!1):n.kind==t.CollectionEventKind.REFRESH&&this.dataProviderRefreshed()},r.dataProviderRefreshed=function(){this.setSelectedIndex(i.NO_SELECTION,!1)},r.rendererAdded=function(t,e,i){t.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onRendererTouchBegin,this),t.addEventListener(egret.TouchEvent.TOUCH_END,this.onRendererTouchEnd,this),t.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onRendererTouchCancle,this)},r.rendererRemoved=function(t,e,i){t.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onRendererTouchBegin,this),t.removeEventListener(egret.TouchEvent.TOUCH_END,this.onRendererTouchEnd,this),t.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onRendererTouchCancle,this)},r.onRendererTouchBegin=function(t){var e=this.$ListBase;t.$isDefaultPrevented||(e[8]=!1,e[7]=t.$currentTarget,this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.stage_touchEndHandler,this))},r.onRendererTouchCancle=function(t){var e=this.$ListBase;e[7]=null,e[8]=!0,this.$stage&&this.$stage.removeEventListener(egret.TouchEvent.TOUCH_END,this.stage_touchEndHandler,this)},r.onRendererTouchEnd=function(e){var i=this.$ListBase,n=e.$currentTarget,s=i[7];n==s&&(i[8]||(this.setSelectedIndex(n.itemIndex,!0),t.ItemTapEvent.dispatchItemTapEvent(this,t.ItemTapEvent.ITEM_TAP,n)),i[8]=!1)},r.stage_touchEndHandler=function(t){var e=t.$currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_END,this.stage_touchEndHandler,this),this.$ListBase[7]=null},i.NO_SELECTION=-1,i.NO_PROPOSED_SELECTION=-2,i}(t.DataGroup);t.ListBase=e,egret.registerClass(e,"eui.ListBase"),t.registerBindable(e.prototype,"selectedIndex"),t.registerBindable(e.prototype,"selectedItem")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){var t=this;e.apply(this,arguments),this.allowMultipleSelection=!1,this._selectedIndices=[],this.isValidIndex=function(e,i,n){return t.$dataProvider&&e>=0&&e0?this._proposedSelectedIndices[0]:-1:this.$getSelectedIndex()},function(t){this.setSelectedIndex(t)}),n(r,"selectedItems",function(){var t=[],e=this.selectedIndices;if(e)for(var i=e.length,n=0;i>n;n++)t[n]=this.$dataProvider.getItemAt(e[n]);return t},function(t){var e=[];if(t)for(var i=t.length,n=0;i>n;n++){var s=this.$dataProvider.getItemIndex(t[n]);if(-1!=s&&e.splice(0,0,s),-1==s){e=[];break}}this.setSelectedIndices(e,!1)}),r.setSelectedIndices=function(t,e){var i=this.$ListBase;e&&(i[4]=i[4]||e),t?this._proposedSelectedIndices=t:this._proposedSelectedIndices=[],this.invalidateProperties()},r.commitProperties=function(){e.prototype.commitProperties.call(this),this._proposedSelectedIndices&&this.commitSelection()},r.commitSelection=function(i){void 0===i&&(i=!0);var n=this.$ListBase,s=n[3];if(this._proposedSelectedIndices){if(this._proposedSelectedIndices=this._proposedSelectedIndices.filter(this.isValidIndex),!this.allowMultipleSelection&&this._proposedSelectedIndices.length>0){var r=[];r.push(this._proposedSelectedIndices[0]),this._proposedSelectedIndices=r}this._proposedSelectedIndices.length>0?n[2]=this._proposedSelectedIndices[0]:n[2]=-1}var a=e.prototype.commitSelection.call(this,!1);if(!a)return this._proposedSelectedIndices=null,!1;var o=this.$getSelectedIndex();return o>t.ListBase.NO_SELECTION&&(this._proposedSelectedIndices?-1==this._proposedSelectedIndices.indexOf(o)&&this._proposedSelectedIndices.push(o):this._proposedSelectedIndices=[o]),this._proposedSelectedIndices&&(-1!=this._proposedSelectedIndices.indexOf(s)&&this.itemSelected(s,!0),this.commitMultipleSelection()),i&&a&&(n[4]&&(this.dispatchEventWith(egret.Event.CHANGE),n[4]=!1),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedIndex"),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedItem")),a},r.commitMultipleSelection=function(){var t,e,i=[],n=[],s=this._selectedIndices,r=this._proposedSelectedIndices;if(s.length>0&&r.length>0){for(e=r.length,t=0;e>t;t++)-1==s.indexOf(r[t])&&n.push(r[t]);for(e=s.length,t=0;e>t;t++)-1==r.indexOf(s[t])&&i.push(s[t])}else s.length>0?i=s:r.length>0&&(n=r);if(this._selectedIndices=r,i.length>0)for(e=i.length,t=0;e>t;t++)this.itemSelected(i[t],!1);if(n.length>0)for(e=n.length,t=0;e>t;t++)this.itemSelected(n[t],!0);this._proposedSelectedIndices=null},r.$isItemIndexSelected=function(t){return this.allowMultipleSelection?-1!=this._selectedIndices.indexOf(t):e.prototype.$isItemIndexSelected.call(this,t)},r.dataProviderRefreshed=function(){this.allowMultipleSelection||e.prototype.dataProviderRefreshed.call(this)},r.calculateSelectedIndices=function(t){var e=[],i=this._selectedIndices,n=i.length;if(n>0){if(1==n&&i[0]==t)return this.$ListBase[0]?(e.splice(0,0,i[0]),e):e;for(var s=!1,r=0;n>r;r++)i[r]==t?s=!0:i[r]!=t&&e.splice(0,0,i[r]);return s||e.splice(0,0,t),e}return e.splice(0,0,t),e},r.onRendererTouchEnd=function(i){if(this.allowMultipleSelection){var n=i.currentTarget,s=this.$ListBase[7];if(n!=s)return;this.setSelectedIndices(this.calculateSelectedIndices(n.itemIndex),!0),t.ItemTapEvent.dispatchItemTapEvent(this,t.ItemTapEvent.ITEM_TAP,n)}else e.prototype.onRendererTouchEnd.call(this,i)},i}(t.ListBase);t.List=e,egret.registerClass(e,"eui.List")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.closeButton=null,this.moveArea=null,this.titleDisplay=null,this._title="",this.offsetPointX=0,this.offsetPointY=0,this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onWindowTouchBegin,this,!1,100)}__extends(i,e);var n=__define,s=i,r=s.prototype;return r.onWindowTouchBegin=function(t){this.$parent.addChild(this)},n(r,"elementsContent",void 0,function(t){if(t)for(var e=t.length,i=0;e>i;i++)this.addChild(t[i])}),n(r,"title",function(){return this._title},function(t){this._title=t,this.titleDisplay&&(this.titleDisplay.text=this.title)}),r.partAdded=function(t,i){e.prototype.partAdded.call(this,t,i),i==this.titleDisplay?this.titleDisplay.text=this._title:i==this.moveArea?this.moveArea.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this):i==this.closeButton&&this.closeButton.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onCloseButtonClick,this)},r.partRemoved=function(t,i){e.prototype.partRemoved.call(this,t,i),i==this.moveArea?this.moveArea.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBegin,this):i==this.closeButton&&this.closeButton.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onCloseButtonClick,this)},r.onCloseButtonClick=function(e){t.UIEvent.dispatchUIEvent(this,t.UIEvent.CLOSING,!0,!0)&&this.close()},r.close=function(){this.$parent&&this.$parent.removeChild(this)},r.onTouchBegin=function(t){this.$includeInLayout=!1,this.offsetPointX=this.x-t.$stageX,this.offsetPointY=this.y-t.$stageY,this.$stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),this.$stage.addEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEnd,this)},r.onTouchMove=function(t){this.x=t.$stageX+this.offsetPointX,this.y=t.$stageY+this.offsetPointY},r.onTouchEnd=function(t){this.$stage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),this.$stage.removeEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEnd,this)},i}(t.Component);t.Panel=e,egret.registerClass(e,"eui.Panel"),t.registerProperty(e,"elementsContent","Array",!0)}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.thumb=null,this.labelDisplay=null,this._labelFunction=null,this._slideDuration=500,this._direction=t.Direction.LTR,this.slideToValue=0,this.animationValue=0,this.thumbInitX=0,this.thumbInitY=0,this.animation=new t.sys.Animation(this.animationUpdateHandler,this)}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"labelFunction",function(){return this._labelFunction},function(t){this._labelFunction!=t&&(this._labelFunction=t,this.invalidateDisplayList())}),r.valueToLabel=function(t,e){return null!=this.labelFunction?this._labelFunction(t,e):t+" / "+e},n(r,"slideDuration",function(){return this._slideDuration},function(t){t=0|+t,this._slideDuration!==t&&(this._slideDuration=t,this.animation.isPlaying&&(this.animation.stop(),this.setValue(this.slideToValue)))}),n(r,"direction",function(){return this._direction},function(t){this._direction!=t&&(this.thumb&&(this.thumb.x=this.thumbInitX),this.thumb&&(this.thumb.y=this.thumbInitY),this._direction=t,this.invalidateDisplayList())}),r.$setValue=function(t){if(this.value===t)return!1;var i=this.$Range,n=e.prototype.$setValue.call(this,t);if(this._slideDuration>0&&this.$stage){this.validateProperties();var s=this.animation;if(s.isPlaying&&(this.animationValue=this.slideToValue,this.invalidateDisplayList(),s.stop()),this.slideToValue=this.nearestValidValue(t,i[7]),this.slideToValue===this.animationValue)return n;var r=this._slideDuration*(Math.abs(this.animationValue-this.slideToValue)/(i[0]-i[2]));s.duration=r===1/0?0:r,s.from=this.animationValue,s.to=this.slideToValue,s.play()}else this.animationValue=this.value;return n},r.animationUpdateHandler=function(t){var e=this.$Range,i=this.nearestValidValue(t.currentValue,e[7]);this.animationValue=Math.min(e[0],Math.max(e[2],i)),this.invalidateDisplayList()},r.partAdded=function(t,i){e.prototype.partAdded.call(this,t,i),i===this.thumb&&(this.thumb.x&&(this.thumbInitX=this.thumb.x),this.thumb.y&&(this.thumbInitY=this.thumb.y),this.thumb.addEventListener(egret.Event.RESIZE,this.onThumbResize,this))},r.partRemoved=function(t,i){e.prototype.partRemoved.call(this,t,i),i===this.thumb&&this.thumb.removeEventListener(egret.Event.RESIZE,this.onThumbResize,this)},r.onThumbResize=function(t){this.updateSkinDisplayList()},r.updateSkinDisplayList=function(){var e=this.animation.isPlaying?this.animationValue:this.value,i=this.maximum,n=this.thumb;if(n){var s=n.width,r=n.height,a=Math.round(e/i*s);(0>a||a===1/0)&&(a=0);var o=Math.round(e/i*r);(0>o||o===1/0)&&(o=0);var h=n.$scrollRect;h||(h=egret.$TempRectangle),h.setTo(0,0,s,r);var l=n.x-h.x,u=n.y-h.y;switch(this._direction){case t.Direction.LTR:h.width=a,n.x=l;break;case t.Direction.RTL:h.width=a,h.x=s-a,n.x=h.x;break;case t.Direction.TTB:h.height=o,n.y=u;break;case t.Direction.BTT:h.height=o,h.y=r-o,n.y=h.y}n.scrollRect=h}this.labelDisplay&&(this.labelDisplay.text=this.valueToLabel(e,i))},i}(t.Range);t.ProgressBar=e,egret.registerClass(e,"eui.ProgressBar")}(eui||(eui={}));var eui;!function(t){var e={},i=function(i){function n(){i.call(this),this.$indexNumber=0,this.$radioButtonGroup=null,this._group=null,this.groupChanged=!1,this._groupName="radioGroup",this._value=null,this.groupName="radioGroup"}__extends(n,i);var s=__define,r=n,a=r.prototype;return s(a,"enabled",function(){return this.$Component[3]?!this.$radioButtonGroup||this.$radioButtonGroup.$enabled:!1},function(t){this.$setEnabled(t)}),s(a,"group",function(){if(!this._group&&this._groupName){var i=e[this._groupName];i||(i=new t.RadioButtonGroup,i.$name=this._groupName,e[this._groupName]=i),this._group=i}return this._group},function(t){this._group!=t&&(this.$radioButtonGroup&&this.$radioButtonGroup.$removeInstance(this,!1),this._group=t,this._groupName=t?this.group.$name:"radioGroup",this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())}),s(a,"groupName",function(){return this._groupName},function(t){t&&""!=t&&(this._groupName=t,this.$radioButtonGroup&&this.$radioButtonGroup.$removeInstance(this,!1),this._group=null,this.groupChanged=!0,this.invalidateProperties(),this.invalidateDisplayList())}),a.$setSelected=function(t){var e=i.prototype.$setSelected.call(this,t);return this.invalidateDisplayList(),e},s(a,"value",function(){return this._value},function(e){this._value!=e&&(this._value=e,this.$selected&&this.group&&t.PropertyEvent.dispatchPropertyEvent(this.group,t.PropertyEvent.PROPERTY_CHANGE,"selectedValue"))}),a.commitProperties=function(){this.groupChanged&&(this.addToGroup(),this.groupChanged=!1),i.prototype.commitProperties.call(this)},a.updateDisplayList=function(t,e){i.prototype.updateDisplayList.call(this,t,e),this.group&&(this.$selected?this._group.$setSelection(this,!1):this.group.selection==this&&this._group.$setSelection(null,!1))},a.buttonReleased=function(){this.enabled&&!this.selected&&(this.$radioButtonGroup||this.addToGroup(),i.prototype.buttonReleased.call(this),this.group.$setSelection(this,!0))},a.addToGroup=function(){var t=this.group;return t&&t.$addInstance(this),t},n}(t.ToggleButton);t.RadioButton=i,egret.registerClass(i,"eui.RadioButton")}(eui||(eui={}));var eui;!function(t){function e(t,i){var n=t.parent,s=i.parent;if(!n||!s)return 0;var r=t.$nestLevel,a=i.$nestLevel,o=0,h=0;return n==s&&(o=n.getChildIndex(t),h=s.getChildIndex(i)),r>a||o>h?1:a>r||h>o?-1:t==i?0:e(n,s)}var i=0,n=function(n){function s(){n.call(this),this.$name=null,this.radioButtons=[],this.$enabled=!0,this._selectedValue=null,this._selection=null,this.$name="_radioButtonGroup"+i++}__extends(s,n);var r=__define,a=s,o=a.prototype;return o.getRadioButtonAt=function(t){return this.radioButtons[t]},r(o,"enabled",function(){return this.$enabled},function(t){if(t=!!t,this.$enabled!==t){this.$enabled=t;for(var e=this.radioButtons,i=e.length,n=0;i>n;n++)e[n].invalidateState()}}),r(o,"numRadioButtons",function(){return this.radioButtons.length}),r(o,"selectedValue",function(){return this.selection?null!=this.selection.value?this.selection.value:this.selection.label:null},function(e){if(this._selectedValue=e,null==e)return void this.$setSelection(null,!1);for(var i=this.numRadioButtons,n=0;i>n;n++){var s=this.radioButtons[n];if(s.value==e||s.label==e){this.changeSelection(n,!1),this._selectedValue=null,t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedValue");break}}}),r(o,"selection",function(){return this._selection},function(t){this._selection!=t&&this.$setSelection(t,!1)}),o.$addInstance=function(t){t.addEventListener(egret.Event.REMOVED,this.removedHandler,this);var i=this.radioButtons;i.push(t),i.sort(e);for(var n=i.length,s=0;n>s;s++)i[s].$indexNumber=s;this._selectedValue&&(this.selectedValue=this._selectedValue),1==t.selected&&(this.selection=t),t.$radioButtonGroup=this,t.invalidateState()},o.$removeInstance=function(t,e){if(t)for(var i=!1,n=this.radioButtons,s=n.length,r=0;s>r;r++){var a=n[r];i?a.$indexNumber=a.$indexNumber-1:a==t&&(e&&t.addEventListener(egret.Event.ADDED,this.addedHandler,this),t==this._selection&&(this._selection=null),t.$radioButtonGroup=null,t.invalidateState(),this.radioButtons.splice(r,1),i=!0,r--,s--)}},o.$setSelection=function(e,i){if(this._selection==e)return!1;if(e){for(var n=this.numRadioButtons,s=0;n>s;s++)if(e==this.getRadioButtonAt(s)){this.changeSelection(s,i);break}}else this._selection&&(this._selection.selected=!1,this._selection=null,i&&this.dispatchEventWith(egret.Event.CHANGE));return t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"selectedValue"),!0},o.changeSelection=function(t,e){var i=this.getRadioButtonAt(t);i&&i!=this._selection&&(this._selection&&(this._selection.selected=!1),this._selection=i,this._selection.selected=!0,e&&this.dispatchEventWith(egret.Event.CHANGE))},o.addedHandler=function(t){var e=t.target;e&&(e.removeEventListener(egret.Event.ADDED,this.addedHandler,this),this.$addInstance(e))},o.removedHandler=function(t){var e=t.target;e&&(e.removeEventListener(egret.Event.REMOVED,this.removedHandler,this),this.$removeInstance(e,!0))},s}(egret.EventDispatcher);t.RadioButtonGroup=n,egret.registerClass(n,"eui.RadioButtonGroup"),t.registerBindable(n.prototype,"selectedValue")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(e,i,n){t.call(this),this.$fillColor=0,this.$fillAlpha=1,this.$strokeColor=4473924,this.$strokeAlpha=1,this.$strokeWeight=0,this.$ellipseWidth=0,this.$ellipseHeight=0,this.touchChildren=!1,this.$graphics=new egret.Graphics,this.$graphics.$setTarget(this),this.width=e,this.height=i,this.fillColor=n}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"graphics",function(){return this.$graphics}),s.$measureContentBounds=function(t){this.$graphics&&t.setTo(0,0,this.width,this.height)},i(s,"fillColor",function(){return this.$fillColor},function(t){void 0!=t&&this.$fillColor!=t&&(this.$fillColor=t,this.invalidateDisplayList())}),i(s,"fillAlpha",function(){return this.$fillAlpha},function(t){this.$fillAlpha!=t&&(this.$fillAlpha=t,this.invalidateDisplayList())}),i(s,"strokeColor",function(){return this.$strokeColor},function(t){this.$strokeColor!=t&&(this.$strokeColor=t,this.invalidateDisplayList())}),i(s,"strokeAlpha",function(){return this.$strokeAlpha},function(t){this.$strokeAlpha!=t&&(this.$strokeAlpha=t,this.invalidateDisplayList())}),i(s,"strokeWeight",function(){return this.$strokeWeight},function(t){this.$strokeWeight!=t&&(this.$strokeWeight=t,this.invalidateDisplayList())}),i(s,"ellipseWidth",function(){return this.$ellipseWidth},function(t){this.$ellipseWidth!=t&&(this.$ellipseWidth=t,this.invalidateDisplayList())}),i(s,"ellipseHeight",function(){return this.$ellipseHeight},function(t){this.$ellipseHeight!=t&&(this.$ellipseHeight=t,this.invalidateDisplayList())}),s.updateDisplayList=function(t,e){var i=this.graphics;i.clear(),this.$strokeWeight>0&&(i.beginFill(this.$fillColor,0),i.lineStyle(this.$strokeWeight,this.$strokeColor,this.$strokeAlpha,!0,"normal","square","miter"),0==this.$ellipseWidth?i.drawRect(this.$strokeWeight/2,this.$strokeWeight/2,t-this.$strokeWeight,e-this.$strokeWeight):i.drawRoundRect(this.$strokeWeight/2,this.$strokeWeight/2,t-this.$strokeWeight,e-this.$strokeWeight,this.$ellipseWidth,0),i.endFill()),i.beginFill(this.$fillColor,this.$fillAlpha),i.lineStyle(this.$strokeWeight,this.$strokeColor,0,!0,"normal","square","miter"),0==this.$ellipseWidth?i.drawRect(this.$strokeWeight,this.$strokeWeight,t-2*this.$strokeWeight,e-2*this.$strokeWeight):i.drawRoundRect(this.$strokeWeight,this.$strokeWeight,t-2*this.$strokeWeight,e-2*this.$strokeWeight,this.$ellipseWidth,0),i.endFill(),this.$invalidateContentBounds()},e}(t.Component);t.Rect=e,egret.registerClass(e,"eui.Rect")}(eui||(eui={}));var eui;!function(t){var e,i=function(i){function n(){i.call(this),this.$bounces=!0,this.horizontalScrollBar=null,this.verticalScrollBar=null;var e=new t.sys.TouchScroll(this.horizontalUpdateHandler,this.horizontalEndHandler,this),n=new t.sys.TouchScroll(this.verticalUpdateHandler,this.verticalEndHanlder,this);this.$Scroller={0:"auto",1:"auto",2:null,3:0,4:0,5:!1,6:!1,7:!1,8:e,9:n,10:null,11:!1,12:!1}}__extends(n,i);var s=__define,r=n,a=r.prototype;return s(a,"bounces",function(){return this.$bounces},function(t){this.$bounces=!!t;var e=this.$Scroller[8];e&&(e.$bounces=this.$bounces);var i=this.$Scroller[9];i&&(i.$bounces=this.$bounces)}),s(a,"throwSpeed",function(){return this.$Scroller[8].$scrollFactor},function(t){t=+t,0>t&&(t=0),this.$Scroller[8].$scrollFactor=t,this.$Scroller[9].$scrollFactor=t}),a.$getThrowInfo=function(i,n){return e?(e.currentPos=i,e.toPos=n):e=new t.ScrollerThrowEvent(t.ScrollerThrowEvent.THROW,!1,!1,i,n),e},s(a,"scrollPolicyV",function(){return this.$Scroller[0]},function(t){var e=this.$Scroller;e[0]!=t&&(e[0]=t,this.checkScrollPolicy())}),s(a,"scrollPolicyH",function(){return this.$Scroller[1]},function(t){var e=this.$Scroller;e[1]!=t&&(e[1]=t,this.checkScrollPolicy())}),a.stopAnimation=function(){var e=this.$Scroller,i=e[9],n=e[8];i.animation.isPlaying?t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END):n.animation.isPlaying&&t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END),i.stop(),n.stop();var s=this.verticalScrollBar,r=this.horizontalScrollBar;s&&s.autoVisibility&&(s.visible=!1),r&&r.autoVisibility&&(r.visible=!1)},s(a,"viewport",function(){return this.$Scroller[10]},function(t){var e=this.$Scroller;t!=e[10]&&(this.uninstallViewport(),e[10]=t,e[11]=!1,this.installViewport())}),a.installViewport=function(){var t=this.viewport;t&&(this.addChildAt(t,0),t.scrollEnabled=!0,t.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBeginCapture,this,!0),t.addEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEndCapture,this,!0),t.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onTouchTapCapture,this,!0),t.addEventListener(egret.Event.REMOVED,this.onViewPortRemove,this)),this.horizontalScrollBar&&(this.horizontalScrollBar.viewport=t),this.verticalScrollBar&&(this.verticalScrollBar.viewport=t)},a.uninstallViewport=function(){this.horizontalScrollBar&&(this.horizontalScrollBar.viewport=null),this.verticalScrollBar&&(this.verticalScrollBar.viewport=null);var t=this.viewport;t&&(t.scrollEnabled=!1,t.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchBeginCapture,this,!0),t.removeEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEndCapture,this,!0),t.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.onTouchTapCapture,this,!0),t.removeEventListener(egret.Event.REMOVED,this.onViewPortRemove,this),0==this.$Scroller[11]&&this.removeChild(t))},a.onViewPortRemove=function(t){t.target==this.viewport&&(this.$Scroller[11]=!0,this.viewport=null)},a.setSkin=function(t){i.prototype.setSkin.call(this,t);var e=this.viewport;e&&this.addChildAt(e,0)},a.onTouchBeginCapture=function(t){this.$Scroller[12]=!1;var e=this.checkScrollPolicy();e&&this.onTouchBegin(t)},a.onTouchEndCapture=function(t){this.$Scroller[12]&&(t.stopPropagation(),this.onTouchEnd(t))},a.onTouchTapCapture=function(t){this.$Scroller[12]&&t.stopPropagation()},a.checkScrollPolicy=function(){var t=this.$Scroller,e=t[10];if(!e)return!1;var i,n=e.$UIComponent;switch(t[1]){case"auto":i=e.contentWidth>n[10]||0!==e.scrollH?!0:!1;break;case"on":i=!0;break;case"off":i=!1}t[6]=i;var s;switch(t[0]){case"auto":s=e.contentHeight>n[11]||0!==e.scrollV?!0:!1;break;case"on":s=!0;break;case"off":s=!1}return t[7]=s,i||s},a.onTouchBegin=function(t){if(!t.isDefaultPrevented()&&this.checkScrollPolicy()){this.downTarget=t.target;var e=this.$Scroller;this.stopAnimation(),e[3]=t.$stageX,e[4]=t.$stageY,e[6]&&e[8].start(t.$stageX),e[7]&&e[9].start(t.$stageY);var i=this.$stage;this.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),i.addEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEnd,this,!0),this.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancel,this),this.addEventListener(egret.Event.REMOVED_FROM_STAGE,this.onRemoveListeners,this)}},a.onTouchMove=function(e){if(!e.isDefaultPrevented()){var i=this.$Scroller;if(!i[5]){if(Math.abs(i[3]-e.$stageX)h;h++)if(s[h]===e){o=h;break}s.splice(0,o+1),a-=o+1,this.$dispatchPropagationEvent(i,s,a),egret.Event.release(i)}},a.onTouchEnd=function(t){var e=this.$Scroller;e[5]=!1,this.onRemoveListeners();var i=e[10],n=i.$UIComponent;e[8].isStarted()&&e[8].finish(i.scrollH,i.contentWidth-n[10]),e[9].isStarted()&&e[9].finish(i.scrollV,i.contentHeight-n[11])},a.onRemoveListeners=function(){var t=this.$stage;this.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),t.removeEventListener(egret.TouchEvent.TOUCH_END,this.onTouchEnd,this,!0),t.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.onTouchMove,this),this.removeEventListener(egret.TouchEvent.TOUCH_CANCEL,this.onTouchCancel,!0),this.removeEventListener(egret.Event.REMOVED_FROM_STAGE,this.onRemoveListeners,this) },a.horizontalUpdateHandler=function(t){this.dispatchEventWith(egret.Event.CHANGE),this.$Scroller[10].scrollH=t},a.verticalUpdateHandler=function(t){this.dispatchEventWith(egret.Event.CHANGE),this.$Scroller[10].scrollV=t},a.horizontalEndHandler=function(){this.$Scroller[9].isPlaying()||this.onChangeEnd()},a.verticalEndHanlder=function(){this.$Scroller[8].isPlaying()||this.onChangeEnd()},a.onChangeEnd=function(){var e=this.$Scroller,i=this.horizontalScrollBar,n=this.verticalScrollBar;(i&&i.visible||n&&n.visible)&&(e[2]||(e[2]=new egret.Timer(200,1),e[2].addEventListener(egret.TimerEvent.TIMER_COMPLETE,this.onAutoHideTimer,this)),e[2].reset(),e[2].start()),t.UIEvent.dispatchUIEvent(this,t.UIEvent.CHANGE_END)},a.onAutoHideTimer=function(t){var e=this.horizontalScrollBar,i=this.verticalScrollBar;e&&e.autoVisibility&&(e.visible=!1),i&&i.autoVisibility&&(i.visible=!1)},a.updateDisplayList=function(t,e){i.prototype.updateDisplayList.call(this,t,e);var n=this.viewport;n&&(n.setLayoutBoundsSize(t,e),n.setLayoutBoundsPosition(0,0))},a.partAdded=function(t,e){i.prototype.partAdded.call(this,t,e),e==this.horizontalScrollBar?(this.horizontalScrollBar.touchChildren=!1,this.horizontalScrollBar.touchEnabled=!1,this.horizontalScrollBar.viewport=this.viewport,this.horizontalScrollBar.autoVisibility&&(this.horizontalScrollBar.visible=!1)):e==this.verticalScrollBar&&(this.verticalScrollBar.touchChildren=!1,this.verticalScrollBar.touchEnabled=!1,this.verticalScrollBar.viewport=this.viewport,this.verticalScrollBar.autoVisibility&&(this.verticalScrollBar.visible=!1))},n.scrollThreshold=5,n}(t.Component);t.Scroller=i,egret.registerClass(i,"eui.Scroller"),t.registerProperty(i,"viewport","eui.IViewport",!0)}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.apply(this,arguments),this.maxWidth=1e5,this.minWidth=0,this.maxHeight=1e5,this.minHeight=0,this.width=0/0,this.height=0/0,this.$elementsContent=[],this._hostComponent=null,this.$stateValues=new t.sys.StateValues}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"elementsContent",void 0,function(t){this.$elementsContent=t}),n(r,"hostComponent",function(){return this._hostComponent},function(e){if(this._hostComponent!=e){this._hostComponent&&this._hostComponent.removeEventListener(egret.Event.ADDED_TO_STAGE,this.onAddedToStage,this),this._hostComponent=e;var i=this.$stateValues;i.parent=e,e&&(this.commitCurrentState(),this.$stateValues.intialized||(e.$stage?this.initializeStates(e.$stage):e.once(egret.Event.ADDED_TO_STAGE,this.onAddedToStage,this))),t.PropertyEvent.dispatchPropertyEvent(this,t.PropertyEvent.PROPERTY_CHANGE,"hostComponent")}}),r.onAddedToStage=function(t){this.initializeStates(this._hostComponent.$stage)},i}(egret.EventDispatcher);t.Skin=e,egret.registerClass(e,"eui.Skin"),t.sys.mixin(e,t.sys.StateClient),t.registerProperty(e,"elementsContent","Array",!0),t.registerProperty(e,"states","State[]"),t.registerBindable(e.prototype,"hostComponent")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this.indexBeingUpdated=!1,this.requireSelection=!0,this.useVirtualLayout=!1}__extends(i,e);var n=(__define,i),s=n.prototype;return s.createChildren=function(){if(!this.$layout){var i=new t.HorizontalLayout;i.gap=0,i.horizontalAlign=t.JustifyAlign.JUSTIFY,i.verticalAlign=t.JustifyAlign.CONTENT_JUSTIFY,this.$setLayout(i)}e.prototype.createChildren.call(this)},s.$setDataProvider=function(i){var n=this.$dataProvider;return n&&n instanceof t.ViewStack&&(n.removeEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.onViewStackIndexChange,this),this.removeEventListener(egret.Event.CHANGE,this.onIndexChanged,this)),i&&i instanceof t.ViewStack&&(i.addEventListener(t.PropertyEvent.PROPERTY_CHANGE,this.onViewStackIndexChange,this),this.addEventListener(egret.Event.CHANGE,this.onIndexChanged,this)),e.prototype.$setDataProvider.call(this,i)},s.onIndexChanged=function(t){this.indexBeingUpdated=!0,this.$dataProvider.selectedIndex=this.selectedIndex,this.indexBeingUpdated=!1},s.onViewStackIndexChange=function(t){"selectedIndex"!=t.property||this.indexBeingUpdated||this.setSelectedIndex(this.$dataProvider.selectedIndex,!1)},i}(t.ListBase);t.TabBar=e,egret.registerClass(e,"eui.TabBar")}(eui||(eui={}));var eui;!function(t){var e=egret.FocusEvent,i=function(i){function n(){i.call(this),this.isFocus=!1,this.$TextInput={0:null,1:null,2:null,3:null,4:null,5:null,6:"",7:null,8:egret.TextFieldInputType.TEXT}}__extends(n,i);var s=__define,r=n,a=r.prototype;return s(a,"prompt",function(){return this.promptDisplay?this.promptDisplay.text:this.$TextInput[0]},function(t){this.$TextInput[0]=t,this.promptDisplay&&(this.promptDisplay.text=t),this.invalidateProperties(),this.invalidateState()}),s(a,"displayAsPassword",function(){if(this.textDisplay)return this.textDisplay.displayAsPassword;var t=this.$TextInput[1];return t?t:!1},function(t){this.$TextInput[1]=t,this.textDisplay&&(this.textDisplay.displayAsPassword=t),this.invalidateProperties()}),s(a,"inputType",function(){return console.log("get inputType"),this.textDisplay?this.textDisplay.inputType:this.$TextInput[8]},function(t){console.log("set inputType"),this.$TextInput[8]=t,this.textDisplay&&(this.textDisplay.inputType=t),this.invalidateProperties()}),s(a,"textColor",function(){return this.textDisplay?this.textDisplay.textColor:this.$TextInput[2]},function(t){this.$TextInput[2]=t,this.textDisplay&&(this.textDisplay.textColor=t),this.invalidateProperties()}),s(a,"maxChars",function(){if(this.textDisplay)return this.textDisplay.maxChars;var t=this.$TextInput[3];return t?t:0},function(t){this.$TextInput[3]=t,this.textDisplay&&(this.textDisplay.maxChars=t),this.invalidateProperties()}),s(a,"maxWidth",function(){if(this.textDisplay)return this.textDisplay.maxWidth;var t=this.$TextInput[4];return t?t:1e5},function(t){this.$TextInput[4]=t,this.textDisplay&&(this.textDisplay.maxWidth=t),this.invalidateProperties()}),s(a,"maxHeight",function(){this.textDisplay;var t=this.$TextInput[5];return t?t:1e5},function(t){this.$TextInput[5]=t,this.textDisplay&&(this.textDisplay.maxHeight=t),this.invalidateProperties()}),s(a,"text",function(){return this.textDisplay?this.textDisplay.text:this.$TextInput[6]},function(t){this.$TextInput[6]=t,this.textDisplay&&(this.textDisplay.text=t),this.invalidateProperties(),this.invalidateState()}),s(a,"restrict",function(){return this.textDisplay?this.textDisplay.restrict:this.$TextInput[7]},function(t){this.$TextInput[7]=t,this.textDisplay&&(this.textDisplay.restrict=t),this.invalidateProperties()}),a.focusInHandler=function(t){this.isFocus=!0,this.invalidateState()},a.focusOutHandler=function(t){this.isFocus=!1,this.invalidateState()},a.getCurrentState=function(){var t=this.skin;return!this.prompt||this.isFocus||this.text?this.enabled?"normal":"disabled":this.enabled&&t.hasState("normalWithPrompt")?"normalWithPrompt":!this.enabled&&t.hasState("disabledWithPrompt")?"disabledWithPrompt":void 0},a.partAdded=function(n,s){i.prototype.partAdded.call(this,n,s);var r=this.$TextInput;s==this.textDisplay?(this.textDisplayAdded(),this.textDisplay instanceof t.EditableText&&(this.textDisplay.addEventListener(e.FOCUS_IN,this.focusInHandler,this),this.textDisplay.addEventListener(e.FOCUS_OUT,this.focusOutHandler,this))):s==this.promptDisplay&&r[0]&&(this.promptDisplay.text=r[0])},a.partRemoved=function(n,s){i.prototype.partRemoved.call(this,n,s),s==this.textDisplay?(this.textDisplayRemoved(),this.textDisplay instanceof t.EditableText&&(this.textDisplay.removeEventListener(e.FOCUS_IN,this.focusInHandler,this),this.textDisplay.removeEventListener(e.FOCUS_OUT,this.focusOutHandler,this))):s==this.promptDisplay&&(this.$TextInput[0]=this.promptDisplay.text)},a.textDisplayAdded=function(){var t=this.$TextInput;t[1]&&(this.textDisplay.displayAsPassword=t[1]),t[2]&&(this.textDisplay.textColor=t[2]),t[3]&&(this.textDisplay.maxChars=t[3]),t[4]&&(this.textDisplay.maxWidth=t[4]),t[5]&&(this.textDisplay.maxHeight=t[5]),t[6]&&(this.textDisplay.text=t[6]),t[7]&&(this.textDisplay.restrict=t[7]),t[8]&&(this.textDisplay.inputType=t[8])},a.textDisplayRemoved=function(){var t=this.$TextInput;t[1]=this.textDisplay.displayAsPassword,t[2]=this.textDisplay.textColor,t[3]=this.textDisplay.maxChars,t[4]=this.textDisplay.maxWidth,t[5]=this.textDisplay.maxHeight,t[6]=this.textDisplay.text,t[7]=this.textDisplay.restrict,t[8]=this.textDisplay.inputType},n}(t.Component);t.TextInput=i,egret.registerClass(i,"eui.TextInput")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this)}__extends(e,t);var i=(__define,e);i.prototype;return e}(t.ToggleButton);t.ToggleSwitch=e,egret.registerClass(e,"eui.ToggleSwitch")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this),this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this),this.addEventListener(egret.Event.REMOVED_FROM_STAGE,this.onRemoveFromStage,this)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.onAddToStage=function(t){this.$stage.addEventListener(egret.Event.RESIZE,this.onResize,this),this.onResize()},n.onRemoveFromStage=function(t){this.$stage.removeEventListener(egret.Event.RESIZE,this.onResize,this)},n.onResize=function(t){var e=this.$stage;this.$setWidth(e.$stageWidth),this.$setHeight(e.$stageHeight)},e}(t.Group);t.UILayer=e,egret.registerClass(e,"eui.UILayer")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.apply(this,arguments)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.updateDisplayList=function(e,i){t.prototype.updateDisplayList.call(this,e,i);var n=this.thumb,s=this.$viewport;if(n&&s){var r=egret.$TempRectangle;n.getPreferredBounds(r);var a=r.height,o=r.x,h=s.scrollV,l=s.contentHeight,u=s.height;if(0>=h){var d=a*(1- -h/(.5*u));d=Math.max(5,Math.round(d)),n.setLayoutBoundsSize(0/0,d),n.setLayoutBoundsPosition(o,0)}else if(h>=l-u)d=a*(1-(h-l+u)/(.5*u)),d=Math.max(5,Math.round(d)),n.setLayoutBoundsSize(0/0,d),n.setLayoutBoundsPosition(o,i-d);else{var c=(i-a)*h/(l-u);n.setLayoutBoundsSize(0/0,0/0),n.setLayoutBoundsPosition(o,c)}}},n.onPropertyChanged=function(t){switch(t.property){case"scrollV":case"contentHeight":this.invalidateDisplayList()}},e}(t.ScrollBarBase);t.VScrollBar=e,egret.registerClass(e,"eui.VScrollBar")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.pointToValue=function(t,e){if(!this.thumb||!this.track)return 0;var i=this.$Range,n=i[0]-i[2],s=this.getThumbRange();return i[2]+(0!=s?(s-e)/s*n:0)},n.getThumbRange=function(){var t=egret.$TempRectangle;this.track.getLayoutBounds(t);var e=t.height;return this.thumb.getLayoutBounds(t),e-t.height},n.updateSkinDisplayList=function(){if(this.thumb&&this.track){var t=this.$Range,e=this.getThumbRange(),i=t[0]-t[2],n=i>0?e-(this.pendingValue-t[2])/i*e:0,s=this.track.localToGlobal(0,n,egret.$TempPoint),r=s.x,a=s.y,o=this.thumb.$parent.globalToLocal(r,a,egret.$TempPoint).y,h=egret.$TempRectangle,l=h.height;if(this.thumb.getLayoutBounds(h),this.thumb.setLayoutBoundsPosition(h.x,Math.round(o)),this.trackHighlight){var u=this.trackHighlight.$parent.globalToLocal(r,a,egret.$TempPoint).y;this.trackHighlight.y=Math.round(u+l),this.trackHighlight.height=Math.round(e-u)}}},e}(t.SliderBase);t.VSlider=e,egret.registerClass(e,"eui.VSlider")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this),this._selectedChild=null,this.proposedSelectedIndex=t.ListBase.NO_PROPOSED_SELECTION,this._selectedIndex=-1}__extends(i,e);var n=__define,s=i,r=s.prototype;return n(r,"layout",function(){return this.$layout}),n(r,"selectedChild",function(){var t=this.selectedIndex;return t>=0&&t=0&&e0?0==n?(this.proposedSelectedIndex=0,this.invalidateProperties()):this.setSelectedIndex(0):this.setSelectedIndex(-1):s>n&&this.setSelectedIndex(s-1),t.CollectionEvent.dispatchCollectionEvent(this,t.CollectionEvent.COLLECTION_CHANGE,t.CollectionEventKind.REMOVE,n,-1,[i.name])},r.commitProperties=function(){e.prototype.commitProperties.call(this),this.proposedSelectedIndex!=t.ListBase.NO_PROPOSED_SELECTION&&(this.commitSelection(this.proposedSelectedIndex),this.proposedSelectedIndex=t.ListBase.NO_PROPOSED_SELECTION)},r.commitSelection=function(t){t>=0&&tn;n++)if(e[n].name==t)return n;return-1},i}(t.Group);t.ViewStack=e,egret.registerClass(e,"eui.ViewStack",["eui.ICollection","egret.IEventDispatcher"]),t.registerBindable(e.prototype,"selectedIndex")}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t){return-.5*(Math.cos(Math.PI*t)-1)}var i=function(){function t(t,i){this.easerFunction=e,this.isPlaying=!1,this.duration=500,this.currentValue=0,this.from=0,this.to=0,this.startTime=0,this.endFunction=null,this.updateFunction=t,this.thisObject=i}var i=(__define,t),n=i.prototype;return n.play=function(){this.stop(),this.start()},n.start=function(){this.isPlaying=!1,this.currentValue=0,this.startTime=egret.getTimer(),this.doInterval(this.startTime),egret.startTick(this.doInterval,this)},n.stop=function(){this.isPlaying=!1,this.startTime=0,egret.stopTick(this.doInterval,this)},n.doInterval=function(t){var e=t-this.startTime;this.isPlaying||(this.isPlaying=!0);var i=this.duration,n=0==i?1:Math.min(e,i)/i;this.easerFunction&&(n=this.easerFunction(n)),this.currentValue=this.from+(this.to-this.from)*n,this.updateFunction&&this.updateFunction.call(this.thisObject,this);var s=e>=i;return s&&this.stop(),s&&this.endFunction&&this.endFunction.call(this.thisObject,this),!0},t}();t.Animation=i,egret.registerClass(i,"eui.sys.Animation")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t),i=e.prototype;return i.getTheme=function(t,e,i,n){function s(t){var i=t.target;e.call(n,i.response)}function r(t){i.call(n)}var a=new egret.HttpRequest;a.addEventListener(egret.Event.COMPLETE,s,n),a.addEventListener(egret.IOErrorEvent.IO_ERROR,r,n),a.responseType=egret.HttpResponseType.TEXT,a.open(t),a.send()},t}();t.DefaultThemeAdapter=e,egret.registerClass(e,"eui.DefaultThemeAdapter",["eui.IThemeAdapter"])}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t){var e=t-1;return e*e*e+1}var i=4,n=[1,1.33,1.66,2],s=2.33,r=.02,a=.998,o=.95,h=Math.log(a),l=function(){function l(i,n,s){this.$scrollFactor=1,this.previousTime=0,this.velocity=0,this.previousVelocity=[],this.currentPosition=0,this.previousPosition=0,this.currentScrollPos=0,this.maxScrollPos=0,this.offsetPoint=0,this.$bounces=!0,this.started=!0,this.updateFunction=i,this.endFunction=n,this.target=s,this.animation=new t.Animation(this.onScrollingUpdate,this),this.animation.endFunction=this.finishScrolling,this.animation.easerFunction=e}var u=(__define,l),d=u.prototype;return d.isPlaying=function(){return this.animation.isPlaying},d.stop=function(){this.animation.stop(),egret.stopTick(this.onTick,this),this.started=!1},d.isStarted=function(){return this.started},d.start=function(t){this.started=!0,this.velocity=0,this.previousVelocity.length=0,this.previousTime=egret.getTimer(),this.previousPosition=this.currentPosition=t,this.offsetPoint=t,egret.startTick(this.onTick,this)},d.update=function(t,e,i){e=Math.max(e,0),this.currentPosition=t,this.maxScrollPos=e;var n=this.offsetPoint-t,s=n+i;this.offsetPoint=t,0>s&&(this.$bounces?s-=.5*n:s=0),s>e&&(this.$bounces?s-=.5*n:s=e),this.currentScrollPos=s,this.updateFunction.call(this.target,s)},d.finish=function(t,e){egret.stopTick(this.onTick,this),this.started=!1;for(var i=this.velocity*s,l=this.previousVelocity,u=l.length,d=s,c=0;u>c;c++){var p=n[c];i+=l[0]*p,d+=p}var v=i/d,f=Math.abs(v),g=0,m=0;if(f>r)if(m=t+(v-r)/h*2*this.$scrollFactor,0>m||m>e)for(m=t;Math.abs(v)>r;)m-=v,v*=0>m||m>e?a*o:a,g++;else g=Math.log(r/f)/h;else m=t;if(this.target.$getThrowInfo){var y=this.target.$getThrowInfo(t,m);m=y.toPos}g>0?(this.$bounces||(0>m?m=0:m>e&&(m=e)),this.throwTo(m,g)):this.finishScrolling()},d.onTick=function(t){var e=t-this.previousTime;if(e>10){var n=this.previousVelocity;n.length>=i&&n.shift(),this.velocity=(this.currentPosition-this.previousPosition)/e,n.push(this.velocity),this.previousTime=t,this.previousPosition=this.currentPosition}return!0},d.finishScrolling=function(t){var e=this.currentScrollPos,i=this.maxScrollPos,n=e;0>e&&(n=0),i&&e>i&&(n=i),this.throwTo(n,300)},d.throwTo=function(t,e){void 0===e&&(e=500);var i=this.currentScrollPos;if(i==t)return void this.endFunction.call(this.target);var n=this.animation;n.duration=e,n.from=i,n.to=t,n.play()},d.onScrollingUpdate=function(t){this.currentScrollPos=t.currentValue,this.updateFunction.call(this.target,t.currentValue)},l}();t.TouchScroll=l,egret.registerClass(l,"eui.sys.TouchScroll")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.LTR="ltr",t.RTL="rtl",t.TTB="ttb",t.BTT="btt",t}();t.Direction=e,egret.registerClass(e,"eui.Direction")}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.AUTO="auto",t.OFF="off",t.ON="on",t}();t.ScrollPolicy=e,egret.registerClass(e,"eui.ScrollPolicy")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(t,i){e.call(this),this.delayList=[],this.skinMap={},this.initialized=!t,i&&(this.$stage=i,EXML.$stage=i,i.registerImplementation("eui.Theme",this)),this.$configURL=t,this.load(t)}__extends(i,e);var n=(__define,i),s=n.prototype;return s.load=function(e){var i=this.$stage?this.$stage.getImplementation("eui.IThemeAdapter"):null;i||(i=new t.DefaultThemeAdapter),i.getTheme(e,this.onConfigLoaded,this.onConfigLoaded,this)},s.onConfigLoaded=function(t){if(t)var e,e=JSON.parse(t);if(e&&e.skins)for(var i=this.skinMap,n=e.skins,s=Object.keys(n),r=s.length,a=0;r>a;a++){var o=s[a];i[o]||this.mapSkin(o,n[o])}e.exmls&&0!=e.exmls.length?e.exmls[0].gjs?(e.exmls.forEach(function(t){return EXML.$parseURLContentAsJs(t.path,t.gjs,t.className)}),this.onLoaded()):e.exmls[0].content?(e.exmls.forEach(function(t){return EXML.$parseURLContent(t.path,t.content)}),this.onLoaded()):EXML.$loadAll(e.exmls,this.onLoaded,this,!0):this.onLoaded()},s.onLoaded=function(t,e){this.initialized=!0,this.handleDelayList(),this.dispatchEventWith(egret.Event.COMPLETE)},s.handleDelayList=function(){for(var t=this.delayList,e=t.length,i=0;e>i;i++){var n=t[i];if(!n.$Component[5]){var s=this.getSkinName(n);s&&(n.$Component[1]=s,n.$parseSkinName())}}t.length=0},s.getSkinName=function(t){if(!this.initialized)return-1==this.delayList.indexOf(t)&&this.delayList.push(t),"";var e=this.skinMap,i=e[t.hostComponentKey];return i||(i=this.findSkinName(t)),i},s.findSkinName=function(t){if(!t)return"";var e=t.__class__;if(void 0===e)return"";var i=this.skinMap[e];return i||"eui.Component"==e?i:this.findSkinName(Object.getPrototypeOf(t))},s.mapSkin=function(t,e){this.skinMap[t]=e},i}(egret.EventDispatcher);t.Theme=e,egret.registerClass(e,"eui.Theme")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(e,i,n,s,r,a,o,h){t.call(this,e,i,n),this.$initTo(s,r,a,o,h)}__extends(e,t);var i=(__define,e),n=i.prototype;return n.$initTo=function(t,e,i,n,s){this.kind=t,this.location=0|+e,this.oldLocation=0|+i,this.items=n||[],this.oldItems=s||[]},n.clean=function(){t.prototype.clean.call(this),this.items=this.oldItems=null},e.dispatchCollectionEvent=function(t,i,n,s,r,a,o){if(!t.hasEventListener(i))return!0;var h=egret.Event.create(e,i);h.$initTo(n,s,r,a,o);var l=t.dispatchEvent(h);return egret.Event.release(h),l},e.COLLECTION_CHANGE="collectionChange",e}(egret.Event);t.CollectionEvent=e,egret.registerClass(e,"eui.CollectionEvent")}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.ADD="add",t.REFRESH="refresh",t.REMOVE="remove",t.REPLACE="replace",t.RESET="reset",t.UPDATE="update",t}();t.CollectionEventKind=e,egret.registerClass(e,"eui.CollectionEventKind")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.apply(this,arguments),this.item=null,this.itemRenderer=null,this.itemIndex=-1}__extends(e,t);var i=(__define,e),n=i.prototype;return n.clean=function(){t.prototype.clean.call(this),this.item=this.itemRenderer=null},e.dispatchItemTapEvent=function(t,i,n){if(!t.hasEventListener(i))return!0;var s=egret.Event.create(e,i);s.item=n.data,s.itemIndex=n.itemIndex,s.itemRenderer=n;var r=t.dispatchEvent(s);return egret.Event.release(s),r},e.ITEM_TAP="itemTap",e}(egret.Event);t.ItemTapEvent=e,egret.registerClass(e,"eui.ItemTapEvent")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(e,i,n,s){t.call(this,e,i,n),this.property=s}__extends(e,t);var i=(__define,e);i.prototype;return e.dispatchPropertyEvent=function(t,i,n){if(!t.hasEventListener(i))return!0;var s=egret.Event.create(e,i);s.property=n;var r=t.dispatchEvent(s);return egret.Event.release(s),r},e.PROPERTY_CHANGE="propertyChange",e}(egret.Event);t.PropertyEvent=e,egret.registerClass(e,"eui.PropertyEvent")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(e,i,n,s,r){t.call(this,e,i,n),s=+s,r=+r,this.currentPos=s,this.toPos=r}__extends(e,t);var i=(__define,e);i.prototype;return e.THROW="throw",e}(egret.Event);t.ScrollerThrowEvent=e,egret.registerClass(e,"eui.ScrollerThrowEvent")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(e,i,n){t.call(this,e,i,n)}__extends(e,t);var i=(__define,e);i.prototype;return e.dispatchUIEvent=function(t,i,n,s){if(!t.hasEventListener(i))return!0;var r=egret.Event.create(e,i,n,s),a=t.dispatchEvent(r);return egret.Event.release(r),a},e.CREATION_COMPLETE="creationComplete",e.CHANGE_END="changeEnd",e.CHANGE_START="changeStart",e.CLOSING="closing",e.MOVE="move",e}(egret.Event);t.UIEvent=e,egret.registerClass(e,"eui.UIEvent")}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e="eui.State",i="eui.AddItems",n="eui.SetProperty",s="eui.SetStateProperty",r="eui.Binding.$bindProperties",a=function(){function t(){this.indent=0}var e=(__define,t),i=e.prototype;return i.toCode=function(){return""},i.getIndent=function(t){void 0===t&&(t=this.indent);for(var e="",i=0;t>i;i++)e+=" ";return e},t}();t.CodeBase=a,egret.registerClass(a,"eui.sys.CodeBase");var o=function(t){function e(){t.apply(this,arguments),this.className="",this.superClass="",this.innerClassBlock=[],this.variableBlock=[],this.functionBlock=[]}__extends(e,t);var i=(__define,e),n=i.prototype;return n.addInnerClass=function(t){-1==this.innerClassBlock.indexOf(t)&&this.innerClassBlock.push(t)},n.addVariable=function(t){-1==this.variableBlock.indexOf(t)&&this.variableBlock.push(t)},n.getVariableByName=function(t){for(var e=this.variableBlock,i=e.length,n=0;i>n;n++){var s=e[n];if(s.name==t)return s}return null},n.addFunction=function(t){-1==this.functionBlock.indexOf(t)&&this.functionBlock.push(t)},n.getFuncByName=function(t){for(var e=this.functionBlock,i=e.length,n=0;i>n;n++){var s=e[n];if(s.name==t)return s}return null},n.toCode=function(){var t=this.indent,e=this.getIndent(t),i=this.getIndent(t+1),n=this.getIndent(t+2),s=e+"(function (";s+=this.superClass?"_super) {\n"+i+"__extends("+this.className+", _super);\n":") {\n";for(var r=this.innerClassBlock,a=r.length,o=0;a>o;o++){var h=r[o];h.indent=t+1,s+=i+"var "+h.className+" = "+h.toCode()+"\n\n"}s+=i+"function "+this.className+"() {\n",this.superClass&&(s+=n+"_super.call(this);\n");var l=this.variableBlock;for(a=l.length,o=0;a>o;o++){var u=l[o];u.defaultValue&&(s+=n+u.toCode()+"\n")}if(this.constructCode){var d=this.constructCode.toCode().split("\n");for(a=d.length,o=0;a>o;o++){var c=d[o];s+=n+c+"\n"}}s+=i+"}\n",s+=i+"var _proto = "+this.className+".prototype;\n\n";var p=this.functionBlock;for(a=p.length,o=0;a>o;o++){var v=p[o];v.indent=t+1,s+=v.toCode()+"\n"}return s+=i+"return "+this.className+";\n"+e,s+=this.superClass?"})("+this.superClass+");":"})();"},e}(a);t.EXClass=o,egret.registerClass(o,"eui.sys.EXClass");var h=function(t){function e(){t.apply(this,arguments),this.lines=[]}__extends(e,t);var i=(__define,e),n=i.prototype;return n.addVar=function(t,e){var i=e?" = "+e:"";this.addCodeLine("var "+t+i+";")},n.addAssignment=function(t,e,i){var n=i?"."+i:"";this.addCodeLine(t+n+" = "+e+";")},n.addReturn=function(t){this.addCodeLine("return "+t+";")},n.addEmptyLine=function(){this.addCodeLine("")},n.startIf=function(t){this.addCodeLine("if("+t+")"),this.startBlock()},n.startElse=function(){this.addCodeLine("else"),this.startBlock()},n.startElseIf=function(t){this.addCodeLine("else if("+t+")"),this.startBlock()},n.startBlock=function(){this.addCodeLine("{"),this.indent++},n.endBlock=function(){this.indent--,this.addCodeLine("}")},n.doFunction=function(t,e){var i=e.join(",");this.addCodeLine(t+"("+i+")")},n.addCodeLine=function(t){this.lines.push(this.getIndent()+t)},n.addCodeLineAt=function(t,e){this.lines.splice(e,0,this.getIndent()+t)},n.containsCodeLine=function(t){return-1!=this.lines.indexOf(t)},n.concat=function(t){this.lines=this.lines.concat(t.lines)},n.toCode=function(){return this.lines.join("\n")},e}(a);t.EXCodeBlock=h,egret.registerClass(h,"eui.sys.EXCodeBlock");var l=function(t){function e(){t.apply(this,arguments),this.codeBlock=null,this.isGet=!1,this.name=""}__extends(e,t);var i=(__define,e),n=i.prototype;return n.toCode=function(){var t,e=this.getIndent(),i=this.getIndent(this.indent+1),n=e;if(this.isGet?(t=this.getIndent(this.indent+2),n+='Object.defineProperty(_proto, "skinParts", {\n',n+=i+"get: function () {\n"):(t=i,n+="_proto."+this.name+" = function () {\n"),this.codeBlock)for(var s=this.codeBlock.toCode().split("\n"),r=s.length,a=0;r>a;a++){var o=s[a];n+=t+o+"\n"}return n+=this.isGet?i+"},\n"+i+"enumerable: true,\n"+i+"configurable: true\n"+e+"});":e+"};"},e}(a);t.EXFunction=l,egret.registerClass(l,"eui.sys.EXFunction");var u=function(t){function e(e,i){t.call(this),this.indent=2,this.name=e,this.defaultValue=i}__extends(e,t);var i=(__define,e),n=i.prototype;return n.toCode=function(){return this.defaultValue?"this."+this.name+" = "+this.defaultValue+";":""},e}(a);t.EXVariable=u,egret.registerClass(u,"eui.sys.EXVariable");var d=function(t){function i(e,i){t.call(this),this.name="",this.stateGroups=[],this.addItems=[],this.setProperty=[],this.name=e,i&&(this.stateGroups=i)}__extends(i,t);var n=(__define,i),s=n.prototype;return s.addOverride=function(t){t instanceof c?this.addItems.push(t):this.setProperty.push(t)},s.toCode=function(){for(var t=this.getIndent(1),i="new "+e+' ("'+this.name+'",\n'+t+"[\n",n=0,s=!0,r=this.addItems.concat(this.setProperty);nl;l++){var u=o[l];o[l]=t+t+u}i+=o.join("\n"),n++}return i+="\n"+t+"])"},i}(a);t.EXState=d,egret.registerClass(d,"eui.sys.EXState");var c=function(t){function e(e,i,n,s){t.call(this),this.target=e,this.property=i,this.position=n,this.relativeTo=s}__extends(e,t);var n=(__define,e),s=n.prototype;return s.toCode=function(){var t="new "+i+'("'+this.target+'","'+this.property+'",'+this.position+',"'+this.relativeTo+'")';return t},e}(a);t.EXAddItems=c,egret.registerClass(c,"eui.sys.EXAddItems");var p=function(t){function e(e,i,n){t.call(this),this.target=e,this.name=i,this.value=n}__extends(e,t);var i=(__define,e),s=i.prototype;return s.toCode=function(){return"new "+n+'("'+this.target+'","'+this.name+'",'+this.value+")"},e}(a);t.EXSetProperty=p,egret.registerClass(p,"eui.sys.EXSetProperty");var v=function(t){function e(e,i,n,s){t.call(this),this.target=e,this.property=i,this.templates=n,this.chainIndex=s}__extends(e,t);var i=(__define,e),n=i.prototype;return n.toCode=function(){var t=this.templates.join(","),e=this.chainIndex.join(",");return"new "+s+"(this, ["+t+"],["+e+"],"+this.target+',"'+this.property+'")'},e}(a);t.EXSetStateProperty=v,egret.registerClass(v,"eui.sys.EXSetStateProperty");var f=function(t){function e(e,i,n,s){t.call(this),this.target=e,this.property=i,this.templates=n,this.chainIndex=s}__extends(e,t);var i=(__define,e),n=i.prototype;return n.toCode=function(){var t=this.templates.join(","),e=this.chainIndex.join(",");return r+"(this, ["+t+"],["+e+"],"+this.target+',"'+this.property+'")'},e}(a);t.EXBinding=f,egret.registerClass(f,"eui.sys.EXBinding")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(eui){var sys;!function(sys){function getRepeatedIds(t){var e=[];return this.repeatedIdMap={},this.getIds(t,e),e}function getIds(t,e){if(t.namespace!=sys.NS_W&&t.attributes.id){var i=t.attributes.id;this.repeatedIdMap[i]?e.push(toXMLString(t)):this.repeatedIdMap[i]=!0}var n=t.children;if(n)for(var s=n.length,r=0;s>r;r++){var a=n[r];this.isInnerClass(a)||this.getIds(a,e)}}function toXMLString(t){if(!t)return"";for(var e=" at <"+t.name,i=t.attributes,n=Object.keys(i),s=n.length,r=0;s>r;r++){var a=n[r],o=i[a];("id"!=a||"__"!=o.substring(0,2))&&(e+=" "+a+'="'+o+'"')}return e+=0==t.children.length?"/>":">"}function checkDeclarations(t,e){if(t){var i=t.children;if(i)for(var n=i.length,s=0;n>s;s++){var r=i[s];1==r.nodeType&&(r.attributes.includeIn&&e.push(toXMLString(r)),r.attributes.excludeFrom&&e.push(toXMLString(r)),checkDeclarations(r,e))}}}function getPropertyStr(t){var e=toXMLString(t.parent),i=toXMLString(t).substring(5);return e+"\n "+i}var exmlParserPool=[],parsedClasses={},innerClassCount=1,HOST_COMPONENT="hostComponent",SKIN_CLASS="eui.Skin",DECLARATIONS="Declarations",RECTANGLE="egret.Rectangle",TYPE_CLASS="Class",TYPE_ARRAY="Array",TYPE_STATE="State[]",SKIN_NAME="skinName",ELEMENTS_CONTENT="elementsContent",basicTypes=[TYPE_ARRAY,"boolean","string","number"],wingKeys=["id","locked","includeIn","excludeFrom"],htmlEntities=[["<","<"],[">",">"],["&","&"],['"',"""],["'","'"]],jsKeyWords=["null","NaN","undefined","true","false"],EXMLParser=function(){function EXMLParser(){this.delayAssignmentDic={}}var d=__define,c=EXMLParser,p=c.prototype;return p.$parseCode=function(codeText,classStr){var className=classStr?classStr:"$exmlClass"+innerClassCount++,clazz=eval(codeText),hasClass=!0;if(hasClass&&clazz){egret.registerClass(clazz,className);for(var paths=className.split("."),length=paths.length,definition=__global,i=0;length-1>i;i++){var path=paths[i];definition=definition[path]||(definition[path]={})}definition[paths[length-1]]||(definition[paths[length-1]]=clazz)}return clazz},p.parse=function(text){var xmlData,xmlData=egret.XML.parse(text),hasClass=!1,className="";xmlData.attributes["class"]?(className=xmlData.attributes["class"],delete xmlData.attributes["class"],hasClass=!!className):className="$exmlClass"+innerClassCount++; -var exClass=this.parseClass(xmlData,className),code=exClass.toCode(),clazz,clazz=eval(code);if(hasClass&&clazz){egret.registerClass(clazz,className);for(var paths=className.split("."),length=paths.length,definition=__global,i=0;length-1>i;i++){var path=paths[i];definition=definition[path]||(definition[path]={})}definition[paths[length-1]]||(definition[paths[length-1]]=clazz)}return clazz},p.parseClass=function(t,e){sys.exmlConfig||(sys.exmlConfig=new sys.EXMLConfig),this.currentXML=t,this.currentClassName=e,this.delayAssignmentDic={},this.idDic={},this.stateCode=[],this.stateNames=[],this.skinParts=[],this.bindings=[],this.declarations=null,this.currentClass=new sys.EXClass,this.stateIds=[];var i=e.lastIndexOf(".");-1!=i?this.currentClass.className=e.substring(i+1):this.currentClass.className=e,this.startCompile();var n=this.currentClass;return this.currentClass=null,n},p.startCompile=function(){var t=this.getClassNameOfNode(this.currentXML);this.isSkinClass=t==SKIN_CLASS,this.currentClass.superClass=t,this.getStateNames();var e=this.currentXML.children;if(e)for(var i=e.length,n=0;i>n;n++){var s=e[n];if(1===s.nodeType&&s.namespace==sys.NS_W&&s.localName==DECLARATIONS){this.declarations=s;break}}this.currentXML.namespace&&(this.addIds(this.currentXML.children),this.createConstructFunc())},p.addIds=function(t){if(t)for(var e=t.length,i=0;e>i;i++){var n=t[i];if(1==n.nodeType&&n.namespace&&!this.isInnerClass(n))if(this.addIds(n.children),n.namespace!=sys.NS_W&&n.localName){if(this.isProperty(n)){var s=n.localName,r=s.indexOf("."),a=n.children;if(-1==r||!a||0==a.length)continue;var o=a[0];this.stateIds.push(o.attributes.id)}else if(1===n.nodeType){var h=n.attributes.id;h?(-1==this.skinParts.indexOf(h)&&this.skinParts.push(h),this.createVarForNode(n),this.isStateNode(n)&&this.stateIds.push(h)):(this.createIdForNode(n),this.isStateNode(n)&&this.stateIds.push(n.attributes.id))}}else;}},p.isInnerClass=function(t){if(t.hasOwnProperty("isInnerClass"))return t.isInnerClass;var e="Skin"==t.localName&&t.namespace==sys.NS_S;if(!e)if(this.isProperty(t))e=!1;else{var i=t.parent;if(this.isProperty(i)){var n=i.localName,s=n.indexOf(".");if(-1!=s){n.substring(s+1);n=n.substring(0,s)}i=i.parent}else n=sys.exmlConfig.getDefaultPropById(i.localName,i.namespace);var r=sys.exmlConfig.getClassNameById(i.localName,i.namespace);e=sys.exmlConfig.getPropertyType(n,r)==TYPE_CLASS}return t.isInnerClass=e,e},p.containsState=function(t){var e=t.attributes;if(e.includeIn||e.excludeFrom)return!0;for(var i=Object.keys(e),n=i.length,s=0;n>s;s++){var r=i[s];if(-1!=r.indexOf("."))return!0}return!1},p.createIdForNode=function(t){var e=this.getNodeId(t);this.idDic[e]?this.idDic[e]++:this.idDic[e]=1,e+=this.idDic[e],t.attributes.id=e},p.getNodeId=function(t){return t.attributes.id?t.attributes.id:"_"+t.localName},p.createVarForNode=function(t){var e=this.getClassNameOfNode(t);""!=e&&(this.currentClass.getVariableByName(t.attributes.id)||this.currentClass.addVariable(new sys.EXVariable(t.attributes.id)))},p.createFuncForNode=function(t){var e=t.localName,i=this.isBasicTypeData(e);if(i)return this.createBasicTypeForNode(t);var n=this.getClassNameOfNode(t),s=new sys.EXFunction,r="_i",a=t.attributes.id;s.name=a+r,this.currentClass.addFunction(s);var o=new sys.EXCodeBlock;s.codeBlock=o;var h="t";"Object"==e?o.addVar(h,"{}"):o.addVar(h,"new "+n+"()");var l=!!this.currentClass.getVariableByName(a);l&&o.addAssignment("this."+a,h),this.addAttributesToCodeBlock(o,h,t),this.initlizeChildNode(t,o,h);var u=this.delayAssignmentDic[a];if(u)for(var d=u.length,c=0;d>c;c++){var p=u[c];o.concat(p)}return o.addReturn(h),"this."+s.name+"()"},p.isBasicTypeData=function(t){return-1!=basicTypes.indexOf(t)},p.createBasicTypeForNode=function(t){var e=t.localName,i="",n=this.currentClass.getVariableByName(t.attributes.id),s=t.children,r="";if(s&&s.length>0){var a=s[0];3==a.nodeType&&(r=a.text.trim())}switch(e){case TYPE_ARRAY:var o=[];if(s)for(var h=s.length,l=0;h>l;l++){var u=s[l];1==u.nodeType&&o.push(this.createFuncForNode(u))}i="["+o.join(",")+"]";break;case"boolean":i="false"!=r&&r?"true":"false";break;case"number":i=r,-1!=i.indexOf("%")&&(i=i.substring(0,i.length-1));break;case"string":i=this.formatString(r)}return n&&(n.defaultValue=i),i},p.addAttributesToCodeBlock=function(t,e,i){var n,s,r=i.attributes,a=Object.keys(r);a.sort();for(var o=a.length,h=0;o>h;h++)if(n=a[h],this.isNormalKey(n)&&(s=r[n],n=this.formatKey(n,s),s=this.formatValue(n,s,i))){if(this.currentClass.getVariableByName(s)){var l="this.",u=r.id,d=l+u+" = t;";this.currentClass.getVariableByName(u)||this.createVarForNode(i),t.containsCodeLine(d)||t.addCodeLineAt(d,1);var c=new sys.EXCodeBlock;"this"==e?c.addAssignment(e,l+s,n):(c.startIf(l+u),c.addAssignment(l+u,l+s,n),c.endBlock()),this.delayAssignmentDic[s]||(this.delayAssignmentDic[s]=[]),this.delayAssignmentDic[s].push(c),s=l+s}t.addAssignment(e,s,n)}},p.initlizeChildNode=function(t,e,i){var n=t.children;if(n&&0!=n.length){for(var s=sys.exmlConfig.getClassNameById(t.localName,t.namespace),r=[],a=n.length,o=[],h=0;a>h;h++){var l=n[h];if(1==l.nodeType&&l.namespace!=sys.NS_W)if(this.isInnerClass(l)){if("Skin"==l.localName){var u=this.parseInnerClass(l),d=sys.exmlConfig.getPropertyType(SKIN_NAME,s);d?e.addAssignment(i,u,SKIN_NAME):egret.$error(2005,this.currentClassName,SKIN_NAME,getPropertyStr(l))}}else{var c=l.localName;if(this.isProperty(l)){if(!this.isNormalKey(c))continue;var d=sys.exmlConfig.getPropertyType(l.localName,s);if(!d)continue;if(!l.children||0==l.children.length)continue;var p;this.addChildrenToProp(l.children,d,c,e,i,p,o,t)}else r.push(l)}}if(0!=r.length){var p,v=sys.exmlConfig.getDefaultPropById(t.localName,t.namespace),f=sys.exmlConfig.getPropertyType(v,s);v&&f&&this.addChildrenToProp(r,f,v,e,i,p,o,t)}}},p.parseInnerClass=function(t){var e=exmlParserPool.pop();e||(e=new EXMLParser);var i=this.currentClass.className+"$"+t.localName+innerClassCount++,n=e.parseClass(t,i);return this.currentClass.addInnerClass(n),exmlParserPool.push(e),i},p.addChildrenToProp=function(t,e,i,n,s,r,a,o){var h="",l=t.length;if(l>1){if(e!=TYPE_ARRAY)return;for(var u=[],d=0;l>d;d++){var c=t[d];if(1==c.nodeType){h=this.createFuncForNode(c);var p=this.getClassNameOfNode(c);this.isStateNode(c)||u.push(h)}}h="["+u.join(",")+"]"}else{var v=t[0];if(e==TYPE_ARRAY)if(v.localName==TYPE_ARRAY){if(u=[],v.children)for(var f=v.children.length,g=0;f>g;g++)c=v.children[g],1==c.nodeType&&(h=this.createFuncForNode(c),p=this.getClassNameOfNode(c),this.isStateNode(c)||u.push(h));h="["+u.join(",")+"]"}else{h=this.createFuncForNode(v);var p=this.getClassNameOfNode(v);h=this.isStateNode(v)?"[]":"["+h+"]"}else if(1==v.nodeType)if(e==TYPE_CLASS){if(l>1)return;h=this.parseInnerClass(t[0])}else{this.getClassNameOfNode(v);h=this.createFuncForNode(v)}else h=this.formatValue(i,v.text,o)}""!=h&&(-1==h.indexOf("()")&&(i=this.formatKey(i,h)),-1==a.indexOf(i)&&a.push(i),n.addAssignment(s,h,i))},p.isProperty=function(t){if(t.hasOwnProperty("isProperty"))return t.isProperty;var e,i=t.localName;if(i&&1===t.nodeType&&t.parent&&!this.isBasicTypeData(i)){var n=t.parent,s=i.indexOf(".");-1!=s&&(i=i.substr(0,s));var r=sys.exmlConfig.getClassNameById(n.localName,n.namespace);e=!!sys.exmlConfig.getPropertyType(i,r)}else e=!1;return t.isProperty=e,e},p.isNormalKey=function(t){return t&&-1==t.indexOf(".")&&-1==wingKeys.indexOf(t)?!0:!1},p.formatKey=function(t,e){return-1!=e.indexOf("%")&&("height"==t?t="percentHeight":"width"==t&&(t="percentWidth")),t},p.formatValue=function(t,e,i){e||(e="");var n=e;e=e.trim();var s=this.getClassNameOfNode(i),r=sys.exmlConfig.getPropertyType(t,s),a=this.formatBinding(t,e,i);if(a){this.checkIdForState(i);var o="this";i!==this.currentXML&&(o+="."+i.attributes.id),this.bindings.push(new sys.EXBinding(o,t,a.templates,a.chainIndex)),e=""}else if(r==RECTANGLE){e="new "+RECTANGLE+"("+e+")"}else{switch(r){case TYPE_CLASS:t==SKIN_NAME&&(e=this.formatString(n));break;case"number":0==e.indexOf("#")?e="0x"+e.substring(1):-1!=e.indexOf("%")&&(e=parseFloat(e.substr(0,e.length-1)).toString());break;case"boolean":e="false"!=e&&e?"true":"false";break;case"string":case"any":e=this.formatString(n)}}return e},p.formatString=function(t){return t=this.unescapeHTMLEntity(t),t=t.split("\n").join("\\n"),t=t.split("\r").join("\\n"),t=t.split('"').join('\\"'),t='"'+t+'"'},p.formatBinding=function(t,e,i){if(!e)return null;if(e=e.trim(),"{"!=e.charAt(0)||"}"!=e.charAt(e.length-1))return null;e=e.substring(1,e.length-1).trim();for(var n=e.split("+"),s=[],r=n.length,a=0;r>a;a++){var o=n[a].trim();if(o){var h=o.charAt(0);if(!("'"==h||'"'==h||h>="0"&&"9">=h||-1==o.indexOf(".")&&-1!=jsKeyWords.indexOf(o))){0==o.indexOf("this.")&&(o=o.substring(5));var l=o.split(".")[0];l!=HOST_COMPONENT&&-1==this.skinParts.indexOf(l)&&(o=HOST_COMPONENT+"."+o),n[a]='"'+o+'"',s.push(a)}}else n.splice(a,1),a--,r--}return{templates:n,chainIndex:s}},p.unescapeHTMLEntity=function(t){if(!t)return"";for(var e=htmlEntities.length,i=0;e>i;i++){var n=htmlEntities[i],s=n[0],r=n[1];t=t.split(r).join(s)}return t},p.createConstructFunc=function(){var t=new sys.EXCodeBlock;t.addEmptyLine();var e="this";if(this.addAttributesToCodeBlock(t,e,this.currentXML),this.declarations){var i=this.declarations.children;if(i&&i.length>0)for(var n=i.length,s=0;n>s;s++){var r=i[s];if(1==r.nodeType){var a=this.createFuncForNode(r);a&&t.addCodeLine(a+";")}}}this.initlizeChildNode(this.currentXML,t,e);var o,h=this.stateIds;if(h.length>0){n=h.length;for(var s=0;n>s;s++)o=h[s],t.addCodeLine("this."+o+"_i();");t.addEmptyLine()}var l=this.skinParts,u="[]";if(n=l.length,n>0){for(s=0;n>s;s++)l[s]='"'+l[s]+'"';u="["+l.join(",")+"]"}var d=new sys.EXFunction;d.name="skinParts",d.isGet=!0;var c=new sys.EXCodeBlock;c.addReturn(u),d.codeBlock=c,this.currentClass.addFunction(d),this.currentXML.attributes.id="",this.createStates(this.currentXML);for(var p,v=this.currentXML,f=(this.getClassNameOfNode(v),v.attributes),g=Object.keys(f),m=g.length,y=0;m>y;y++){var C=g[y],$=f[C],E=C.indexOf(".");if(-1!=E){var _=C.substring(0,E);_=this.formatKey(_,$);var T=this.formatValue(_,$,v);if(!T)continue;var I=C.substr(E+1);p=this.getStateByName(I,v);var x=p.length;if(x>0)for(s=0;x>s;s++){var S=p[s];S.addOverride(new sys.EXSetProperty("",_,T))}}}var L=this.stateCode;if(n=L.length,n>0){var P=" ";t.addCodeLine("this.states = [");var N=!0;for(s=0;n>s;s++){S=L[s],N?N=!1:t.addCodeLine(P+",");for(var A=S.toCode().split("\n"),R=0;R0)for(t.addEmptyLine(),s=0;n>s;s++){var b=D[s];t.addCodeLine(b.toCode())}this.currentClass.constructCode=t},p.isStateNode=function(t){var e=t.attributes;return e.hasOwnProperty("includeIn")||e.hasOwnProperty("excludeFrom")},p.getStateNames=function(){var t=this.currentXML,e=sys.exmlConfig.getClassNameById(t.localName,t.namespace),i=sys.exmlConfig.getPropertyType("states",e);if(i==TYPE_STATE){var n=t.attributes.states;n&&delete t.attributes.states;var s,r=this.stateNames,a=t.children;if(a)for(var o=a.length,h=0;o>h;h++){var l=a[h];if(1==l.nodeType&&"states"==l.localName){l.namespace=sys.NS_W,s=l.children;break}}if(s||n)if(n){var u=n.split(",");o=u.length;for(var h=0;o>h;h++){var d=u[h].trim();d&&(-1==r.indexOf(d)&&r.push(d),this.stateCode.push(new sys.EXState(d)))}}else for(o=s.length,h=0;o>h;h++){var c=s[h];if(1==c.nodeType){var p=[],v=c.attributes;if(v.stateGroups)for(var f=v.stateGroups.split(","),g=f.length,m=0;g>m;m++){var y=f[m].trim();y&&(-1==r.indexOf(y)&&r.push(y),p.push(y))}d=v.name,-1==r.indexOf(d)&&r.push(d),this.stateCode.push(new sys.EXState(d,p))}}}},p.createStates=function(t){var e=t.children;if(e)for(var i=e.length,n=0;i>n;n++){var s=e[n];if(1==s.nodeType&&!this.isInnerClass(s)&&(this.createStates(s),s.namespace!=sys.NS_W&&s.localName))if(this.isProperty(s)){var r=s.localName,a=r.indexOf("."),o=s.children;if(-1==a||!o||0==o.length)continue;var h=r.substring(a+1);r=r.substring(0,a);var l,u=this.getClassNameOfNode(t),d=(sys.exmlConfig.getPropertyType(r,u),o[0]);1==d.nodeType?(this.createFuncForNode(d),this.checkIdForState(d),l="this."+d.attributes.id):l=this.formatValue(r,d.text,t),g=this.getStateByName(h,s);var c=g.length;if(c>0)for(var p=0;c>p;p++)m=g[p],m.addOverride(new sys.EXSetProperty(t.attributes.id,r,l))}else if(this.containsState(s)){var v=s.attributes,f=v.id;this.getClassNameOfNode(s);this.checkIdForState(s);var h,g,m;if(this.isStateNode(s)){var y="",C=s.parent;C.localName==TYPE_ARRAY&&(C=C.parent),C&&C.parent&&this.isProperty(C)&&(C=C.parent),C&&C!=this.currentXML&&(y=C.attributes.id,this.checkIdForState(C));var $=this.findNearNodeId(s),E=[];if(v.includeIn)E=v.includeIn.split(",");else{for(var _=v.excludeFrom.split(","),T=_.length,p=0;T>p;p++){var I=_[p];this.getStateByName(I,s)}for(T=this.stateCode.length,p=0;T>p;p++)m=this.stateCode[p],-1==_.indexOf(m.name)&&E.push(m.name)}for(var x=E.length,S=0;x>S;S++)if(h=E[S],g=this.getStateByName(h,s),g.length>0)for(var c=g.length,p=0;c>p;p++)m=g[p],m.addOverride(new sys.EXAddItems(f,y,$.position,$.relativeTo))}for(var L=Object.keys(v),P=L.length,N=0;P>N;N++){I=L[N];var l=v[I],a=I.indexOf(".");if(-1!=a){var A=I.substring(0,a);A=this.formatKey(A,l);var R=this.formatBinding(A,l,s);if(!R){var l=this.formatValue(A,l,s);if(!l)continue}h=I.substr(a+1),g=this.getStateByName(h,s);var c=g.length;if(c>0)for(var p=0;c>p;p++)m=g[p],R?m.addOverride(new sys.EXSetStateProperty(f,A,R.templates,R.chainIndex)):m.addOverride(new sys.EXSetProperty(f,A,l))}}}}},p.checkIdForState=function(t){if(t&&!this.currentClass.getVariableByName(t.attributes.id)){this.createVarForNode(t);var e=t.attributes.id,i=e+"_i",n=this.currentClass.getFuncByName(i);if(n){var s="this."+e+" = t;",r=n.codeBlock;r&&(r.containsCodeLine(s)||r.addCodeLineAt(s,1))}}},p.getStateByName=function(t,e){for(var i=[],n=this.stateCode,s=n.length,r=0;s>r;r++){var a=n[r];if(a.name==t)-1==i.indexOf(a)&&i.push(a);else if(a.stateGroups.length>0){for(var o=!1,h=a.stateGroups.length,l=0;h>l;l++){var u=a.stateGroups[l];if(u==t){o=!0;break}}o&&-1==i.indexOf(a)&&i.push(a)}}return i},p.findNearNodeId=function(t){for(var e,i,n,s=t.parent,r="",a=-1,o=!1,h=s.children,l=h.length,u=0;l>u;u++){var d=h[u];this.isProperty(d)||(d==t?(o=!0,a=u):!o||n||this.isStateNode(d)||(n=d),o||this.isStateNode(d)||(i=d))}return 0==a?(e=0,{position:e,relativeTo:r}):a==l-1?(e=1,{position:e,relativeTo:r}):n&&(e=2,r=n.attributes.id)?(this.checkIdForState(n),{position:e,relativeTo:r}):{position:1,relativeTo:r}},p.getClassNameOfNode=function(t){var e=sys.exmlConfig.getClassNameById(t.localName,t.namespace);return e},EXMLParser}();sys.EXMLParser=EXMLParser,egret.registerClass(EXMLParser,"eui.sys.EXMLParser")}(sys=eui.sys||(eui.sys={}))}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){var e=egret.getDefinitionByName(t);return e?e.prototype:null}function n(t){if(!t)return null;var e,e=new t;return e}t.NS_S="http://ns.egret.com/eui",t.NS_W="http://ns.egret.com/wing";var s=["Point","Matrix","Rectangle"],r=["Array","boolean","string","number"],a="eui.",o=0,h={},l=function(){function l(){}var u=(__define,l),d=u.prototype;return d.$describe=function(t){function i(){}if(!t)return null;var s=Object.getPrototypeOf(t);if(!s)return null;var a;if(s.hasOwnProperty("__hashCode__")&&(a=h[s.__hashCode__]))return a;var l=Object.getPrototypeOf(s);if(!l)return null;var u=n(l.constructor),d=this.$describe(u);d?(i.prototype=d,a=new i):a={};for(var c=Object.keys(s).concat(Object.keys(t)),p=c.length,v=t.__meta__,f=0;p>f;f++){var g=c[f];if("constructor"!=g&&"_"!=g.charAt(0)&&"$"!=g.charAt(0)){var m;if(v&&v[g])m=v[g];else if(e(t[g]))m="Array";else{if(m=typeof t[g],"function"==m)continue;-1==r.indexOf(m)&&(m="any")}a[g]=m}}return Object.getPrototypeOf(l)&&(s.__hashCode__=o++,h[s.__hashCode__]=a),a},d.getClassNameById=function(e,n){if(n==t.NS_S){if("Object"==e)return e;if(-1!=s.indexOf(e))return"egret."+e}var o="";return-1!=r.indexOf(e)?e:(n==t.NS_W||(o=n&&n!=t.NS_S?n.substring(0,n.length-1)+e:a+e),i(o)||(o=""),o)},d.getDefaultPropById=function(t,e){var n,s=this.getClassNameById(t,e),r=i(s);return r&&(n=r.__defaultProperty__),n?n:""},d.getPropertyType=function(t,e){if("Object"==e)return"any";var s="",r=i(e);if(r){if(!r.hasOwnProperty("__hashCode__")){var a=egret.getDefinitionByName(e),o=n(a);if(!o)return s;this.$describe(o)}var l=h[r.__hashCode__];l&&(s=l[t])}return s},l}();t.EXMLConfig=l,egret.registerClass(l,"eui.sys.EXMLConfig")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var EXML;!function(t){function e(t){return h.parse(t)}function i(t,e,i,n){if(void 0===n&&(n=!1),n&&t in u)return void(e&&e.call(i,u[t],t));var s=l[t];return s?void s.push([e,i]):(l[t]=[[e,i]],void o(t,a))}function n(t,e,i,n){if(void 0===n&&(n=!1),!t||0==t.length)return void(e&&e.call(i,[],t));var r=[];t.forEach(function(a){if(n&&a in u)return r[a]="",void r.push(a);var h=function(n,a){r[n]=a,r.push(n),r.length==t.length&&s(t,r,e,i)};o(a,h)})}function s(t,e,i,n){var s=[];t.forEach(function(t,i){if(t in u&&!e[t])return void(s[i]=u[t]);var n=e[t],r=a(t,n);s[i]=r}),i&&i.call(n,s,t)}function r(t,e,i){if(e)var n=h.$parseCode(e,i);if(t){u[t]=n;var s=l[t];delete l[t];for(var r=s?s.length:0,a=0;r>a;a++){var o=s[a];o[0]&&o[1]&&o[0].call(o[1],n,t)}}return n}function a(t,i){if(i)var n=e(i);if(t){u[t]=n;var s=l[t];delete l[t];for(var r=s?s.length:0,a=0;r>a;a++){var o=s[a];o[0]&&o[1]&&o[0].call(o[1],n,t)}}return n}function o(e,i){var n=e;-1==e.indexOf("://")&&(n=d+e);var s=function(t){t||(t=""),i(e,t)},r=t.$stage?t.$stage.getImplementation("eui.IThemeAdapter"):null;r||(r=new eui.DefaultThemeAdapter),r.getTheme(n,s,s,this)}var h=new eui.sys.EXMLParser,l={},u={},d="";Object.defineProperty(t,"prefixURL",{get:function(){return d},set:function(t){d=t},enumerable:!0,configurable:!0}),t.parse=e,t.load=i,t.$loadAll=n,t.$parseURLContentAsJs=r,t.$parseURLContent=a}(EXML||(EXML={}));var eui;!function(t){egret.$locale_strings=egret.$locale_strings||{},egret.$locale_strings.en_US=egret.$locale_strings.en_US||{};var e=egret.$locale_strings.en_US;e[2001]="EXML parsing error {0}: EXML file can't be found ",e[2002]="EXML parsing error : invalid XML file:\n{0}",e[2003]="EXML parsing error {0}: the class definitions corresponding to nodes can't be found \n {1}",e[2004]="EXML parsing error {0}: nodes cannot contain id property with the same name \n {1}",e[2005]="EXML parsing error {0}: property with the name of '{1}' does not exist on the node, or the property does not have a default value: \n {2}",e[2006]="EXML parsing error {0}: undefined view state name: '{1}' \n {2}",e[2007]="EXML parsing error {0}: only UIComponent objects within the container can use the includeIn and excludeFrom properties\n {1}",e[2008]="EXML parsing error {0}: fail to assign values of '{1}' class to property: '{2}' \n {3}",e[2009]="EXML parsing error {0}: only one ID can be referenced in the node property value '{}' label; and complex expression is not allowed to use \n {1}",e[2010]="EXML parsing error {0}: ID referenced by property: '{1}': '{2}' does not exist \n {3}",e[2011]="EXML parsing error {0}: fail to assign more than one child nodes to the same property: '{1}' \n {2}",e[2012]="EXML parsing error {0}: no default property exists on the node; and you must explicitly declare the property name that the child node is assigned to \n {1}",e[2013]="EXML parsing error {0}: view state grammar is not allowed to use on property nodes of Array class \n {1} ",e[2014]="EXML parsing error {0}: assigning the skin class itself to the node property is not allowed \n {1}",e[2015]="EXML parsing error {0}: class definition referenced by node: {1} does not exist \n {2}",e[2016]="EXML parsing error {0}: format error of 'scale9Grid' property value on the node: {1}",e[2017]="EXML parsing error {0}: namespace prefix missing on the node: {1}",e[2018]="EXML parsing error {0}: format error of 'skinName' property value on the node: {1}",e[2019]="EXML parsing error {0}: the container’s child item must be visible nodes: {1}",e[2020]="EXML parsing error {0}: for child nodes in w: Declarations, the includeIn and excludeFrom properties are not allowed to use \n {1}",e[2021]="Compile errors in {0}, the attribute name: {1}, the attribute value: {2}.",e[2101]="EXML parsing warnning : fail to register the class property : {0},there is already a class with the same name in the global,please try to rename the class name for the exml. \n {1}",e[2102]="EXML parsing warnning {0}: no child node can be found on the property code \n {1}",e[2103]="EXML parsing warnning {0}: the same property '{1}' on the node is assigned multiple times \n {2}",e[2104]="EXML parsing warnning, Instantiate class {0} error,the parameters of its constructor method must be empty.",e[2201]="BasicLayout doesn't support virtualization.",e[2202]="parse skinName error,the parsing result of skinName must be a instance of eui.Skin.",e[2203]="Could not find the skin class '{0}'。",e[2301]="parse source failed,could not find asset from URL:{0} ."}(eui||(eui={}));var eui;!function(t){egret.$locale_strings=egret.$locale_strings||{},egret.$locale_strings.zh_CN=egret.$locale_strings.zh_CN||{};var e=egret.$locale_strings.zh_CN;e[2001]="EXML解析错误 {0}: 找不到EXML文件",e[2002]="EXML解析错误: 不是有效的XML文件:\n{0}",e[2003]="EXML解析错误 {0}: 无法找到节点所对应的类定义\n{1}",e[2004]="EXML解析错误 {0}: 节点不能含有同名的id属性\n{1}",e[2005]="EXML解析错误 {0}: 节点上不存在名为'{1}'的属性,或者该属性没有初始值:\n{2}",e[2006]="EXML解析错误 {0}: 未定义的视图状态名称:'{1}'\n{2}",e[2007]="EXML解析错误 {0}: 只有处于容器内的 UIComponent 对象可以使用includeIn和excludeFrom属性\n{1}",e[2008]="EXML解析错误 {0}: 无法将'{1}'类型的值赋给属性:'{2}'\n{3}",e[2009]="EXML解析错误 {0}: 在节点属性值的‘{}’标签内只能引用一个ID,不允许使用复杂表达式\n{1}",e[2010]="EXML解析错误 {0}: 属性:'{1}'所引用的ID: '{2}'不存在\n{3}",e[2011]="EXML解析错误 {0}: 无法将多个子节点赋值给同一个属性:'{1}'\n{2}",e[2012]="EXML解析错误 {0}: 节点上不存在默认属性,必须显式声明子节点要赋值到的属性名\n{1}",e[2013]="EXML解析错误 {0}: 类型为Array的属性节点上不允许使用视图状态语法\n{1}",e[2014]="EXML解析错误 {0}: 不允许将皮肤类自身赋值给节点属性\n{1}",e[2015]="EXML解析错误 {0}: 节点引用的类定义:{1}不存在\n{2}",e[2016]="EXML解析错误 {0}: 节点上'scale9Grid'属性值的格式错误:{1}",e[2017]="EXML解析错误 {0}: 节点上缺少命名空间前缀:{1}",e[2018]="EXML解析错误 {0}: 节点上'skinName'属性值的格式错误:{1}",e[2019]="EXML解析错误 {0}: 容器的子项必须是可视节点:{1}",e[2020]="EXML解析错误 {0}: 在w:Declarations内的子节点,不允许使用includeIn和excludeFrom属性\n{1}",e[2021]="{0} 中存在编译错误,属性名 : {1},属性值 : {2}",e[2101]="EXML解析警告: 在EXML根节点上声明的 class 属性: {0} 注册失败,所对应的类已经存在,请尝试重命名要注册的类名。\n{1}",e[2102]="EXML解析警告 {0}: 在属性节点上找不到任何子节点\n{1}",e[2103]="EXML解析警告 {0}: 节点上的同一个属性'{1}'被多次赋值\n{2}",e[2104]="EXML解析警告,无法直接实例化自定义组件:{0} ,在EXML中使用的自定义组件必须要能直接被实例化,否则可能导致后续EXML解析报错。",e[2201]="BasicLayout 不支持虚拟化。",e[2202]="皮肤解析出错,属性 skinName 的值必须要能够解析为一个 eui.Skin 的实例。",e[2203]="找不到指定的皮肤类 '{0}'。",e[2301]="素材解析失败,找不到URL:{0} 所对应的资源。"}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this),this.$target=null,this.$useVirtualLayout=!1,this.$typicalWidth=71,this.$typicalHeight=22}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"target",function(){return this.$target},function(t){this.$target!==t&&(this.$target=t,this.clearVirtualLayoutCache())}),i(s,"useVirtualLayout",function(){return this.$useVirtualLayout},function(t){t=!!t,this.$useVirtualLayout!=t&&(this.$useVirtualLayout=t,this.dispatchEventWith("useVirtualLayoutChanged"),this.$useVirtualLayout&&!t&&this.clearVirtualLayoutCache(),this.target&&this.target.invalidateDisplayList())}),s.setTypicalSize=function(t,e){t=+t||71,e=+e||22,(t!==this.$typicalWidth||e!==this.$typicalHeight)&&(this.$typicalWidth=t,this.$typicalHeight=e,this.$target&&this.$target.invalidateSize())},s.scrollPositionChanged=function(){},s.clearVirtualLayoutCache=function(){},s.elementAdded=function(t){},s.elementRemoved=function(t){},s.getElementIndicesInView=function(){return null},s.measure=function(){},s.updateDisplayList=function(t,e){},e}(egret.EventDispatcher);t.LayoutBase=e,egret.registerClass(e,"eui.LayoutBase")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this)}__extends(i,e);var n=(__define,i),s=n.prototype;return s.measure=function(){e.prototype.measure.call(this),t.sys.measure(this.$target)},s.updateDisplayList=function(i,n){e.prototype.updateDisplayList.call(this,i,n);var s=this.$target,r=t.sys.updateDisplayList(s,i,n);s.setContentSize(Math.ceil(r.x),Math.ceil(r.y))},i}(t.LayoutBase);t.BasicLayout=e,egret.registerClass(e,"eui.BasicLayout")}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t){if(t){for(var e=0,i=0,s=egret.$TempRectangle,r=t.numChildren,a=0;r>a;a++){var o=t.getChildAt(a);if(egret.is(o,n)&&o.$includeInLayout){var h,l,u=o.$UIComponent,d=u[4],c=u[5],p=u[0],v=u[1],f=u[2],g=u[3];o.getPreferredBounds(s),isNaN(p)||isNaN(v)?isNaN(d)?isNaN(p)&&isNaN(v)?h=s.x:(h=isNaN(p)?0:p,h+=isNaN(v)?0:v):h=2*Math.abs(d):h=p+v,isNaN(f)||isNaN(g)?isNaN(c)?isNaN(f)&&isNaN(g)?l=s.y:(l=isNaN(f)?0:f,l+=isNaN(g)?0:g):l=2*Math.abs(c):l=f+g;var m=s.width,y=s.height;e=Math.ceil(Math.max(e,h+m)),i=Math.ceil(Math.max(i,l+y))}}t.setMeasuredSize(e,i)}}function i(t,e,i){if(t){for(var s=t.numChildren,r=0,a=0,o=egret.$TempRectangle,h=0;s>h;h++){var l=t.getChildAt(h);if(egret.is(l,n)&&l.$includeInLayout){var u=l.$UIComponent,d=u[4],c=u[5],p=u[0],v=u[1],f=u[2],g=u[3],m=u[6],y=u[7],C=0/0,$=0/0;isNaN(p)||isNaN(v)?isNaN(m)||(C=Math.round(e*Math.min(.01*m,1))):C=e-v-p,isNaN(f)||isNaN(g)?isNaN(y)||($=Math.round(i*Math.min(.01*y,1))):$=i-g-f,l.setLayoutBoundsSize(C,$),l.getLayoutBounds(o);var E=o.width,_=o.height,T=0/0,I=0/0;T=isNaN(d)?isNaN(p)?isNaN(v)?o.x:e-E-v:p:Math.round((e-E)/2+d),I=isNaN(c)?isNaN(f)?isNaN(g)?o.y:i-_-g:f:Math.round((i-_)/2+c),l.setLayoutBoundsPosition(T,I),r=Math.max(r,T+E),a=Math.max(a,I+_)}}return egret.$TempPoint.setTo(r,a)}}var n="eui.UIComponent";t.measure=e,t.updateDisplayList=i}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.LEFT="left",t.JUSTIFY_USING_GAP="justifyUsingGap",t.JUSTIFY_USING_WIDTH="justifyUsingWidth",t}();t.ColumnAlign=e,egret.registerClass(e,"eui.ColumnAlign")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.apply(this,arguments),this.$horizontalAlign="left",this.$verticalAlign="top",this.$gap=6,this.$paddingLeft=0,this.$paddingRight=0,this.$paddingTop=0,this.$paddingBottom=0,this.elementSizeTable=[],this.startIndex=-1,this.endIndex=-1,this.indexInViewCalculated=!1,this.maxElementSize=0}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"horizontalAlign",function(){return this.$horizontalAlign},function(t){this.$horizontalAlign!=t&&(this.$horizontalAlign=t,this.$target&&this.$target.invalidateDisplayList())}),i(s,"verticalAlign",function(){return this.$verticalAlign},function(t){this.$verticalAlign!=t&&(this.$verticalAlign=t,this.$target&&this.$target.invalidateDisplayList())}),i(s,"gap",function(){return this.$gap},function(t){t=+t||0,this.$gap!==t&&(this.$gap=t,this.invalidateTargetLayout())}),i(s,"paddingLeft",function(){return this.$paddingLeft},function(t){t=+t||0,this.$paddingLeft!==t&&(this.$paddingLeft=t,this.invalidateTargetLayout())}),i(s,"paddingRight",function(){return this.$paddingRight},function(t){t=+t||0,this.$paddingRight!==t&&(this.$paddingRight=t,this.invalidateTargetLayout())}),i(s,"paddingTop",function(){return this.$paddingTop},function(t){t=+t||0,this.$paddingTop!==t&&(this.$paddingTop=t,this.invalidateTargetLayout())}),i(s,"paddingBottom",function(){return this.$paddingBottom},function(t){t=+t||0,this.$paddingBottom!==t&&(this.$paddingBottom=t,this.invalidateTargetLayout())}),s.invalidateTargetLayout=function(){var t=this.$target;t&&(t.invalidateSize(),t.invalidateDisplayList())},s.measure=function(){this.$target&&(this.$useVirtualLayout?this.measureVirtual():this.measureReal())},s.measureReal=function(){},s.measureVirtual=function(){},s.updateDisplayList=function(t,e){var i=this.$target;if(i)return 0==i.numElements?void i.setContentSize(Math.ceil(this.$paddingLeft+this.$paddingRight),Math.ceil(this.$paddingTop+this.$paddingBottom)):void(this.$useVirtualLayout?this.updateDisplayListVirtual(t,e):this.updateDisplayListReal(t,e))},s.getStartPosition=function(t){return 0},s.getElementSize=function(t){return 0},s.getElementTotalSize=function(){return 0},s.elementRemoved=function(e){this.$useVirtualLayout&&(t.prototype.elementRemoved.call(this,e),this.elementSizeTable.splice(e,1))},s.clearVirtualLayoutCache=function(){this.$useVirtualLayout&&(this.elementSizeTable=[],this.maxElementSize=0)},s.findIndexAt=function(t,e,i){var n=.5*(e+i)|0,s=this.getStartPosition(n),r=this.getElementSize(n);return t>=s&&tt?this.findIndexAt(t,e,Math.max(e,n-1)):this.findIndexAt(t,Math.min(n+1,i),i)},s.scrollPositionChanged=function(){if(t.prototype.scrollPositionChanged.call(this),this.$useVirtualLayout){var e=this.getIndexInView();e&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())}},s.getIndexInView=function(){return!1},s.updateDisplayListVirtual=function(t,e){},s.updateDisplayListReal=function(t,e){},s.flexChildrenProportionally=function(t,e,i,n){var s,r=n.length;do{s=!0;var a=e-t*i/100;a>0?e-=a:a=0;for(var o=e/i,h=0;r>h;h++){var l=n[h],u=l.percent*o;if(u=d?a-=d:(e-=d-a,a=0),s=!1;break}if(u>l.max){var c=l.max;l.size=c,n[h]=n[--r],n[r]=l,i-=l.percent,a>=c?a-=c:(e-=c-a,a=0),s=!1;break}l.size=u}}while(!s)},e}(t.LayoutBase);t.LinearLayoutBase=e,egret.registerClass(e,"eui.LinearLayoutBase")}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e=function(){function t(){this.layoutElement=null,this.size=0,this.percent=0/0,this.min=0/0,this.max=0/0}var e=(__define,t);e.prototype;return t}();t.ChildInfo=e,egret.registerClass(e,"eui.sys.ChildInfo")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e="eui.UIComponent",i=function(i){function n(){i.apply(this,arguments)}__extends(n,i);var s=(__define,n),r=s.prototype;return r.measureReal=function(){for(var t=this.$target,i=t.numElements,n=i,s=0,r=0,a=egret.$TempRectangle,o=0;i>o;o++){var h=t.getElementAt(o);egret.is(h,e)&&h.$includeInLayout?(h.getPreferredBounds(a),s+=a.width,r=Math.max(r,a.height)):n--}s+=(n-1)*this.$gap;var l=this.$paddingLeft+this.$paddingRight,u=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(s+l,r+u)},r.measureVirtual=function(){for(var t=this.$target,i=this.$typicalWidth,n=this.getElementTotalSize(),s=Math.max(this.maxElementSize,this.$typicalHeight),r=egret.$TempRectangle,a=this.endIndex,o=this.elementSizeTable,h=this.startIndex;a>h;h++){var l=t.getElementAt(h);egret.is(l,e)&&l.$includeInLayout&&(l.getPreferredBounds(r),n+=r.width,n-=isNaN(o[h])?i:o[h],s=Math.max(s,r.height))}var u=this.$paddingLeft+this.$paddingRight,d=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(n+u,s+d)},r.updateDisplayListReal=function(i,n){var s=this.$target,r=this.$paddingLeft,a=this.$paddingRight,o=this.$paddingTop,h=this.$paddingBottom,l=this.$gap,u=Math.max(0,i-r-a),d=Math.max(0,n-o-h),c=this.$horizontalAlign==t.JustifyAlign.JUSTIFY,p=this.$verticalAlign==t.JustifyAlign.JUSTIFY||this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;p||(this.$verticalAlign==egret.VerticalAlign.MIDDLE?v=.5:this.$verticalAlign==egret.VerticalAlign.BOTTOM&&(v=1));var f,g,m,y=s.numElements,C=y,$=r,E=o,_=0,T=0,I=[],x=u,S=this.maxElementSize,L=egret.$TempRectangle;for(f=0;y>f;f++){var g=s.getElementAt(f);if(egret.is(g,e)&&g.$includeInLayout)if(g.getPreferredBounds(L),S=Math.max(S,L.height),c)_+=L.width;else{var P=g.$UIComponent;isNaN(P[6])?x-=L.width:(T+=P[6],m=new t.sys.ChildInfo,m.layoutElement=g,m.percent=P[6],m.min=P[12],m.max=P[13],I.push(m))}else C--}x-=l*(C-1),x=x>0?x:0;var N,A=u-_-l*(C-1),R=C,B={};if(c){if(0>A){for(N=x/C,f=0;y>f;f++)g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout&&(g.getPreferredBounds(L),L.width<=N&&(x-=L.width,R--));x=x>0?x:0}}else if(T>0){this.flexChildrenProportionally(u,x,T,I);var D=0,b=I.length;for(f=0;b>f;f++){m=I[f];var M=Math.round(m.size+D);D+=m.size-M,B[m.layoutElement.$hashCode]=M,x-=M}x=x>0?x:0}this.$horizontalAlign==egret.HorizontalAlign.CENTER?$=r+.5*x:this.$horizontalAlign==egret.HorizontalAlign.RIGHT&&($=r+x); -var O=r,w=o,V=0,z=0,H=Math.ceil(d);this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY&&(H=Math.ceil(Math.max(d,S))),D=0;var U,k;for(f=0;y>f;f++){var G=0;if(g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout){if(g.getPreferredBounds(L),U=0/0,c?(k=0/0,A>0?k=x*L.width/_:0>A&&L.width>N&&(k=x/R),isNaN(k)||(U=Math.round(k+D),D+=k-U)):U=B[g.$hashCode],p)E=o,g.setLayoutBoundsSize(U,H),g.getLayoutBounds(L);else{var F=0/0,P=g.$UIComponent;if(!isNaN(g.percentHeight)){var W=Math.min(100,P[7]);F=Math.round(d*W*.01)}g.setLayoutBoundsSize(U,F),g.getLayoutBounds(L),G=(d-L.height)*v,G=G>0?G:0,E=o+G}g.setLayoutBoundsPosition(Math.round($),Math.round(E)),V=Math.ceil(L.width),z=Math.ceil(L.height),O=Math.max(O,$+V),w=Math.max(w,E+z),$+=V+l}}this.maxElementSize=S,s.setContentSize(O+a,w+h)},r.updateDisplayListVirtual=function(i,n){var s=this.$target;this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var r,a=this.$paddingRight,o=this.$paddingTop,h=this.$paddingBottom,l=this.$gap,u=s.numElements;if(-1==this.startIndex||-1==this.endIndex)return r=this.getStartPosition(u)-l+a,void s.setContentSize(r,s.contentHeight);var d=this.endIndex;s.setVirtualElementIndicesInView(this.startIndex,d);var c=this.$verticalAlign==t.JustifyAlign.JUSTIFY||this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY,p=this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;c||(this.$verticalAlign==egret.VerticalAlign.MIDDLE?v=.5:this.$verticalAlign==egret.VerticalAlign.BOTTOM&&(v=1));var f,g=egret.$TempRectangle,m=Math.max(0,n-o-h),y=Math.ceil(m),C=this.$typicalHeight,$=this.$typicalWidth,E=this.maxElementSize,_=Math.max(C,this.maxElementSize);if(p){for(var T=this.startIndex;d>=T;T++)f=s.getVirtualElementAt(T),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),E=Math.max(E,g.height));y=Math.ceil(Math.max(m,E))}for(var I,x=0,S=0,L=0,P=!1,N=this.elementSizeTable,A=this.startIndex;d>=A;A++){var R=0;f=s.getVirtualElementAt(A),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),p||(E=Math.max(E,g.height)),c?(S=o,f.setLayoutBoundsSize(0/0,y),f.getLayoutBounds(g)):(f.getLayoutBounds(g),R=(m-g.height)*v,R=R>0?R:0,S=o+R),L=Math.max(L,g.height),P||(I=isNaN(N[A])?$:N[A],I!=g.width&&(P=!0)),N[A]=g.width,x=this.getStartPosition(A),f.setLayoutBoundsPosition(Math.round(x),Math.round(S)))}L+=o+h,r=this.getStartPosition(u)-l+a,this.maxElementSize=E,s.setContentSize(r,L),(P||_a;a++){var o=r[a];isNaN(o)&&(o=i),n+=o+s}return n},r.getElementSize=function(t){if(this.$useVirtualLayout){var e=this.elementSizeTable[t];return isNaN(e)&&(e=this.$typicalWidth),e}return this.$target?this.$target.getElementAt(t).width:0},r.getElementTotalSize=function(){for(var t=this.$typicalWidth,e=this.$gap,i=0,n=this.$target.numElements,s=this.elementSizeTable,r=0;n>r;r++){var a=s[r];isNaN(a)&&(a=t),i+=a+e}return i-=e},r.elementAdded=function(t){this.useVirtualLayout&&(i.prototype.elementAdded.call(this,t),this.elementSizeTable.splice(t,0,this.$typicalWidth))},r.getIndexInView=function(){var t=this.$target;if(!t||0==t.numElements)return this.startIndex=this.endIndex=-1,!1;var e=t.$UIComponent;if(e[10]<=0||e[11]<=0)return this.startIndex=this.endIndex=-1,!1;var i=t.numElements,n=this.getStartPosition(i-1)+this.elementSizeTable[i-1]+this.$paddingRight,s=t.scrollH;if(s>n-this.$paddingRight)return this.startIndex=-1,this.endIndex=-1,!1;var r=t.scrollH+e[10];if(r0?this._requestedColumnCount:this._columnCount,l=this._requestedRowCount>0?this._requestedRowCount:this._rowCount,u=isNaN(this._horizontalGap)?0:this._horizontalGap,d=isNaN(this._verticalGap)?0:this._verticalGap;h>0&&(r=h*(this._columnWidth+u)-u),l>0&&(a=l*(this._rowHeight+d)-d);var c=this._paddingLeft+this._paddingRight,p=this._paddingTop+this._paddingBottom;t.setMeasuredSize(r+c,a+p),this._columnCount=e,this._rowCount=i,this._columnWidth=n,this._rowHeight=s}},a.calculateRowAndColumn=function(i,n){var s=this.$target,r=isNaN(this._horizontalGap)?0:this._horizontalGap,a=isNaN(this._verticalGap)?0:this._verticalGap;this._rowCount=this._columnCount=-1;for(var o=s.numElements,h=o,l=0;h>l;l++){var u=s.getElementAt(l);!u||egret.is(u,e)&&u.$includeInLayout||o--}if(0==o)return void(this._rowCount=this._columnCount=0);(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;var d=this._columnWidth+r;0>=d&&(d=1);var c=this._rowHeight+a;0>=c&&(c=1);var p=this._orientation==t.TileOrientation.COLUMNS,v=!isNaN(i),f=!isNaN(n),g=this._paddingLeft,m=this._paddingRight,y=this._paddingTop,C=this._paddingBottom;if(this._requestedColumnCount>0||this._requestedRowCount>0)this._requestedRowCount>0&&(this._rowCount=Math.min(this._requestedRowCount,o)),this._requestedColumnCount>0&&(this._columnCount=Math.min(this._requestedColumnCount,o));else if(v||f)if(!v||f&&p){var $=Math.max(0,n-y-C);this._rowCount=Math.floor(($+a)/c),this._rowCount=Math.max(1,Math.min(this._rowCount,o))}else{var E=Math.max(0,i-g-m);this._columnCount=Math.floor((E+r)/d),this._columnCount=Math.max(1,Math.min(this._columnCount,o))}else{var _=Math.sqrt(o*d*c);p?this._rowCount=Math.max(1,Math.round(_/c)):this._columnCount=Math.max(1,Math.round(_/d))}-1==this._rowCount&&(this._rowCount=Math.max(1,Math.ceil(o/this._columnCount))),-1==this._columnCount&&(this._columnCount=Math.max(1,Math.ceil(o/this._rowCount))),this._requestedColumnCount>0&&this._requestedRowCount>0&&(this._orientation==t.TileOrientation.ROWS?this._rowCount=Math.max(1,Math.ceil(o/this._requestedColumnCount)):this._columnCount=Math.max(1,Math.ceil(o/this._requestedRowCount)))},a.updateMaxElementSize=function(){this.$target&&(this.$useVirtualLayout?(this.maxElementWidth=Math.max(this.maxElementWidth,this.$typicalWidth),this.maxElementHeight=Math.max(this.maxElementHeight,this.$typicalHeight),this.doUpdateMaxElementSize(this.startIndex,this.endIndex)):this.doUpdateMaxElementSize(0,this.$target.numElements-1))},a.doUpdateMaxElementSize=function(t,i){var n=this.maxElementWidth,s=this.maxElementHeight,r=egret.$TempRectangle,a=this.$target;if(-1!=t&&-1!=i)for(var o=t;i>=o;o++){var h=a.getVirtualElementAt(o);egret.is(h,e)&&h.$includeInLayout&&(h.getPreferredBounds(r),n=Math.max(n,r.width),s=Math.max(s,r.height))}this.maxElementWidth=n,this.maxElementHeight=s},a.clearVirtualLayoutCache=function(){i.prototype.clearVirtualLayoutCache.call(this),this.maxElementWidth=0,this.maxElementHeight=0},a.scrollPositionChanged=function(){if(this.$useVirtualLayout){var t=this.getIndexInView();t&&(this.indexInViewCalculated=!0,this.$target.invalidateDisplayList())}},a.getIndexInView=function(){if(!this.$target||0==this.$target.numElements)return this.startIndex=this.endIndex=-1,!1;var e=this.$target,i=e.numElements;if(!this.$useVirtualLayout)return this.startIndex=0,this.endIndex=i-1,!1;var n=e.$UIComponent;if(0==n[10]||0==n[11])return this.startIndex=this.endIndex=-1,!1;var s=this.startIndex,r=this.endIndex,a=this._paddingLeft,o=this._paddingTop,h=isNaN(this._horizontalGap)?0:this._horizontalGap,l=isNaN(this._verticalGap)?0:this._verticalGap;if(this._orientation==t.TileOrientation.COLUMNS){var u=this._columnWidth+h;if(0>=u)return this.startIndex=0,this.endIndex=i-1,!1;var d=e.scrollH,c=d+n[10],p=Math.floor((d-a)/u);0>p&&(p=0);var v=Math.ceil((c-a)/u);0>v&&(v=0),this.startIndex=Math.min(i-1,Math.max(0,p*this._rowCount)),this.endIndex=Math.min(i-1,Math.max(0,v*this._rowCount-1))}else{var f=this._rowHeight+l;if(0>=f)return this.startIndex=0,this.endIndex=i-1,!1;var g=e.scrollV,m=g+n[11],y=Math.floor((g-o)/f);0>y&&(y=0);var C=Math.ceil((m-o)/f);0>C&&(C=0),this.startIndex=Math.min(i-1,Math.max(0,y*this._columnCount)),this.endIndex=Math.min(i-1,Math.max(0,C*this._columnCount-1))}return this.startIndex!=s||this.endIndex!=r},a.updateDisplayList=function(n,s){if(i.prototype.updateDisplayList.call(this,n,s),this.$target){var r=this.$target,a=this._paddingLeft,o=this._paddingRight,h=this._paddingTop,l=this._paddingBottom;if(this.indexInViewCalculated)this.indexInViewCalculated=!1;else{if(this.calculateRowAndColumn(n,s),0==this._rowCount||0==this._columnCount)return void r.setContentSize(a+o,h+l);this.adjustForJustify(n,s),this.getIndexInView()}if(this.$useVirtualLayout&&(this.calculateRowAndColumn(n,s),this.adjustForJustify(n,s)),-1==this.startIndex||-1==this.endIndex)return void r.setContentSize(0,0);var u=this.endIndex;r.setVirtualElementIndicesInView(this.startIndex,u);for(var d,c,p,v,f,g=this._orientation==t.TileOrientation.COLUMNS,m=this.startIndex,y=isNaN(this._horizontalGap)?0:this._horizontalGap,C=isNaN(this._verticalGap)?0:this._verticalGap,$=this._rowCount,E=this._columnCount,_=this._columnWidth,T=this._rowHeight,I=this.startIndex;u>=I;I++)d=this.$useVirtualLayout?this.target.getVirtualElementAt(I):this.target.getElementAt(I),egret.is(d,e)&&d.$includeInLayout&&(g?(v=Math.ceil((m+1)/$)-1,f=Math.ceil((m+1)%$)-1,-1==f&&(f=$-1)):(v=Math.ceil((m+1)%E)-1,-1==v&&(v=E-1),f=Math.ceil((m+1)/E)-1),c=v*(_+y)+a,p=f*(T+C)+h,this.sizeAndPositionElement(d,c,p,_,T),m++);var x=a+o,S=h+l,L=(_+y)*E-y,P=(T+C)*$-C;r.setContentSize(L+x,P+S)}},a.sizeAndPositionElement=function(e,i,n,s,r){var a=0/0,o=0/0,h=e.$UIComponent;this._horizontalAlign==t.JustifyAlign.JUSTIFY?a=s:isNaN(h[6])||(a=s*h[6]*.01),this._verticalAlign==t.JustifyAlign.JUSTIFY?o=r:isNaN(h[7])||(o=r*h[7]*.01),e.setLayoutBoundsSize(Math.round(a),Math.round(o));var l=i,u=egret.$TempRectangle;switch(e.getLayoutBounds(u),this._horizontalAlign){case egret.HorizontalAlign.RIGHT:l+=s-u.width;break;case egret.HorizontalAlign.CENTER:l=i+(s-u.width)/2}var d=n;switch(this._verticalAlign){case egret.VerticalAlign.BOTTOM:d+=r-u.height;break;case egret.VerticalAlign.MIDDLE:d+=(r-u.height)/2}e.setLayoutBoundsPosition(Math.round(l),Math.round(d))},a.adjustForJustify=function(e,i){var n=this._paddingLeft,s=this._paddingRight,r=this._paddingTop,a=this._paddingBottom,o=Math.max(0,e-n-s),h=Math.max(0,i-r-a);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;var l,u=h-this._rowHeight*this._rowCount,d=o-this._columnWidth*this._columnCount;u>0&&(this._rowAlign==t.RowAlign.JUSTIFY_USING_GAP?(l=Math.max(1,this._rowCount-1),this._verticalGap=u/l):this._rowAlign==t.RowAlign.JUSTIFY_USING_HEIGHT&&this._rowCount>0&&(this._rowHeight+=(u-(this._rowCount-1)*this._verticalGap)/this._rowCount)),d>0&&(this._columnAlign==t.ColumnAlign.JUSTIFY_USING_GAP?(l=Math.max(1,this._columnCount-1),this._horizontalGap=d/l):this._columnAlign==t.ColumnAlign.JUSTIFY_USING_WIDTH&&this._columnCount>0&&(this._columnWidth+=(d-(this._columnCount-1)*this._horizontalGap)/this._columnCount))},n}(t.LayoutBase);t.TileLayout=i,egret.registerClass(i,"eui.TileLayout")}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.ROWS="rows",t.COLUMNS="columns",t}();t.TileOrientation=e,egret.registerClass(e,"eui.TileOrientation")}(eui||(eui={}));var eui;!function(t){var e="eui.UIComponent",i=function(i){function n(){i.apply(this,arguments)}__extends(n,i);var s=(__define,n),r=s.prototype;return r.measureReal=function(){for(var t=this.$target,i=t.numElements,n=i,s=0,r=0,a=egret.$TempRectangle,o=0;i>o;o++){var h=t.getElementAt(o);egret.is(h,e)&&h.$includeInLayout?(h.getPreferredBounds(a),r+=a.height,s=Math.max(s,a.width)):n--}r+=(n-1)*this.$gap;var l=this.$paddingLeft+this.$paddingRight,u=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(s+l,r+u)},r.measureVirtual=function(){for(var t=this.$target,i=this.$typicalHeight,n=this.getElementTotalSize(),s=Math.max(this.maxElementSize,this.$typicalWidth),r=egret.$TempRectangle,a=this.endIndex,o=this.elementSizeTable,h=this.startIndex;a>h;h++){var l=t.getElementAt(h);egret.is(l,e)&&l.$includeInLayout&&(l.getPreferredBounds(r),n+=r.height,n-=isNaN(o[h])?i:o[h],s=Math.max(s,r.width))}var u=this.$paddingLeft+this.$paddingRight,d=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(s+u,n+d)},r.updateDisplayListReal=function(i,n){var s=this.$target,r=this.$paddingLeft,a=this.$paddingRight,o=this.$paddingTop,h=this.$paddingBottom,l=this.$gap,u=Math.max(0,i-r-a),d=Math.max(0,n-o-h),c=this.$verticalAlign==t.JustifyAlign.JUSTIFY,p=this.$horizontalAlign==t.JustifyAlign.JUSTIFY||this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;p||(this.$horizontalAlign==egret.HorizontalAlign.CENTER?v=.5:this.$horizontalAlign==egret.HorizontalAlign.RIGHT&&(v=1));var f,g,m,y=s.numElements,C=y,$=r,E=o,_=0,T=0,I=[],x=d,S=this.maxElementSize,L=egret.$TempRectangle;for(f=0;y>f;f++){var g=s.getElementAt(f);if(egret.is(g,e)&&g.$includeInLayout)if(g.getPreferredBounds(L),S=Math.max(S,L.width),c)_+=L.height;else{var P=g.$UIComponent;isNaN(P[7])?x-=L.height:(T+=P[7],m=new t.sys.ChildInfo,m.layoutElement=g,m.percent=P[7],m.min=P[14],m.max=P[15],I.push(m))}else C--}x-=l*(C-1),x=x>0?x:0;var N,A=d-_-l*(C-1),R=C,B={};if(c){if(0>A){for(N=x/C,f=0;y>f;f++)g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout&&(g.getPreferredBounds(L),L.height<=N&&(x-=L.height,R--));x=x>0?x:0}}else if(T>0){this.flexChildrenProportionally(d,x,T,I);var D=0,b=I.length;for(f=0;b>f;f++){m=I[f];var M=Math.round(m.size+D);D+=m.size-M,B[m.layoutElement.$hashCode]=M,x-=M}x=x>0?x:0}this.$verticalAlign==egret.VerticalAlign.MIDDLE?E=o+.5*x:this.$verticalAlign==egret.VerticalAlign.BOTTOM&&(E=o+x);var O=r,w=o,V=0,z=0,H=Math.ceil(u);this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY&&(H=Math.ceil(Math.max(u,S))),D=0;var U,k;for(f=0;y>f;f++){var G=0;if(g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout){if(g.getPreferredBounds(L),U=0/0,c?(k=0/0,A>0?k=x*L.height/_:0>A&&L.height>N&&(k=x/R),isNaN(k)||(U=Math.round(k+D),D+=k-U)):U=B[g.$hashCode],p)$=r,g.setLayoutBoundsSize(H,U),g.getLayoutBounds(L);else{var F=0/0,P=g.$UIComponent;if(!isNaN(P[6])){var W=Math.min(100,P[6]);F=Math.round(u*W*.01)}g.setLayoutBoundsSize(F,U),g.getLayoutBounds(L),G=(u-L.width)*v,G=G>0?G:0,$=r+G}g.setLayoutBoundsPosition(Math.round($),Math.round(E)),V=Math.ceil(L.width),z=Math.ceil(L.height),O=Math.max(O,$+V),w=Math.max(w,E+z),E+=z+l}}this.maxElementSize=S,s.setContentSize(O+a,w+h)},r.updateDisplayListVirtual=function(i,n){var s=this.$target;this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var r,a=this.$paddingBottom,o=this.$paddingLeft,h=this.$paddingRight,l=this.$gap,u=s.numElements;if(-1==this.startIndex||-1==this.endIndex)return r=this.getStartPosition(u)-l+a,void s.setContentSize(s.contentWidth,r);var d=this.endIndex;s.setVirtualElementIndicesInView(this.startIndex,d);var c=this.$horizontalAlign==t.JustifyAlign.JUSTIFY||this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY,p=this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;c||(this.$horizontalAlign==egret.HorizontalAlign.CENTER?v=.5:this.$horizontalAlign==egret.HorizontalAlign.RIGHT&&(v=1));var f,g=egret.$TempRectangle,m=Math.max(0,i-o-h),y=Math.ceil(m),C=this.$typicalHeight,$=this.$typicalWidth,E=this.maxElementSize,_=Math.max($,this.maxElementSize);if(p){for(var T=this.startIndex;d>=T;T++)f=s.getVirtualElementAt(T),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),E=Math.max(E,g.width));y=Math.ceil(Math.max(m,E))}for(var I,x=0,S=0,L=0,P=!1,N=this.elementSizeTable,A=this.startIndex;d>=A;A++){var R=0;f=s.getVirtualElementAt(A),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),p||(E=Math.max(E,g.width)),c?(x=o,f.setLayoutBoundsSize(y,0/0),f.getLayoutBounds(g)):(f.getLayoutBounds(g),R=(m-g.width)*v,R=R>0?R:0,x=o+R),L=Math.max(L,g.width),P||(I=isNaN(N[A])?C:N[A],I!=g.height&&(P=!0)),N[A]=g.height,S=this.getStartPosition(A),f.setLayoutBoundsPosition(Math.round(x),Math.round(S)))}L+=o+h,r=this.getStartPosition(u)-l+a,this.maxElementSize=E,s.setContentSize(L,r),(P||_a;a++){var o=r[a];isNaN(o)&&(o=i),n+=o+s}return n},r.getElementSize=function(t){if(this.$useVirtualLayout){var e=this.elementSizeTable[t];return isNaN(e)&&(e=this.$typicalHeight),e}return this.$target?this.$target.getElementAt(t).height:0},r.getElementTotalSize=function(){for(var t=this.$typicalHeight,e=this.$gap,i=0,n=this.$target.numElements,s=this.elementSizeTable,r=0;n>r;r++){var a=s[r];isNaN(a)&&(a=t),i+=a+e}return i-=e},r.elementAdded=function(t){this.$useVirtualLayout&&(i.prototype.elementAdded.call(this,t),this.elementSizeTable.splice(t,0,this.$typicalHeight))},r.getIndexInView=function(){var t=this.$target;if(!t||0==t.numElements)return this.startIndex=this.endIndex=-1,!1;var e=t.$UIComponent;if(0==e[10]||0==e[11])return this.startIndex=this.endIndex=-1,!1;var i=t.numElements,n=this.getStartPosition(i-1)+this.elementSizeTable[i-1]+this.$paddingBottom,s=t.scrollV;if(s>n-this.$paddingBottom)return this.startIndex=-1,this.endIndex=-1,!1;var r=t.scrollV+e[11];if(r-1&&s.splice(r,1)}},t}();t.AddItems=e,egret.registerClass(e,"eui.AddItems",["eui.IOverride"])}(eui||(eui={}));var eui;!function(t){var e=function(){function t(t,e,i){this.target=t,this.name=e,this.value=i}var e=(__define,t),i=e.prototype;return i.apply=function(t,e){var i=this.target?t[this.target]:t;i&&(this.oldValue=i[this.name],this.setPropertyValue(i,this.name,this.value,this.oldValue))},i.remove=function(t,e){var i=this.target?t[this.target]:t;i&&(this.setPropertyValue(i,this.name,this.oldValue,this.oldValue),this.oldValue=null)},i.setPropertyValue=function(t,e,i,n){void 0===i||null===i?t[e]=i:"number"==typeof n?t[e]=+i:"boolean"==typeof n?t[e]=this.toBoolean(i):t[e]=i},i.toBoolean=function(t){return"string"==typeof t?"true"==t.toLowerCase():0!=t},t}();t.SetProperty=e,egret.registerClass(e,"eui.SetProperty",["eui.IOverride"])}(eui||(eui={}));var eui;!function(t){var e=function(){function e(t,e,i,n,s){this.host=t,this.templates=e,this.chainIndex=i,this.target=n,this.prop=s}var i=(__define,e),n=i.prototype;return n.apply=function(e,i){if(this.target){var n=this.target[this.prop];this.oldValue&&this.setPropertyValue(this.target,this.prop,this.oldValue,this.oldValue),n&&(this.oldValue=n),t.Binding.$bindProperties(this.host,this.templates.concat(),this.chainIndex.concat(),this.target,this.prop)}},n.remove=function(t,e){if(this.target){var i=this.oldValue;this.target[this.prop]&&(this.oldValue=this.target[this.prop]),i&&this.setPropertyValue(this.target,this.prop,i,i)}},n.setPropertyValue=function(t,e,i,n){void 0===i||null===i?t[e]=i:"number"==typeof n?t[e]=+i:"boolean"==typeof n?t[e]=this.toBoolean(i):t[e]=i},n.toBoolean=function(t){return"string"==typeof t?"true"==t.toLowerCase():0!=t},e}();t.SetStateProperty=e,egret.registerClass(e,"eui.SetStateProperty",["eui.IOverride"])}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t,e,i,n,r,a,o,h,l,u){var d;if(!isNaN(i)&&isNaN(n)){if(d=s(t,e,i,a,i,h,i,u))return d}else if(isNaN(i)&&!isNaN(n)&&(d=s(t,e,r,n,o,n,l,n)))return d;return d=s(t,e,r,a,o,h,l,u)}function i(t,e,i,s,r,a,o,h,l,u){var d;if(!isNaN(i)&&isNaN(s)){if(d=n(t,e,i,a,i,h,i,u))return d}else if(isNaN(i)&&!isNaN(s)&&(d=n(t,e,r,s,o,s,l,s)))return d;return d=n(t,e,r,a,o,h,l,u)}function n(t,e,i,n,s,a,h,l){var u=e.b,d=e.d;if(u>-1e-9&&1e-9>u&&(u=0),d>-1e-9&&1e-9>d&&(d=0),0==u&&0==d)return null;if(0==u&&0==d)return null;if(0==u)return egret.Point.create(i,t/Math.abs(d));if(0==d)return egret.Point.create(t/Math.abs(u),n);var c,p,v,f=u*d>=0?d:-d;if(0!=f&&i>0){var g=1/f;i=Math.max(s,Math.min(h,i)),p=i,v=(t-u*p)*g,v>=a&&l>=v&&u*p+f*v>=0&&(c=egret.Point.create(p,v)),v=(-t-u*p)*g,v>=a&&l>=v&&0>u*p+f*v&&(!c||o(c.x,c.y,e).width>o(p,v,e).width)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(0!=u&&n>0){var m=1/u;n=Math.max(a,Math.min(l,n)),v=n,p=(t-f*v)*m,p>=s&&h>=p&&u*p+f*v>=0&&(!c||o(c.x,c.y,e).width>o(p,v,e).width)&&(c=egret.Point.create(p,v)),p=(-t-f*v)*m,p>=s&&h>=p&&0>u*p+f*v&&(!c||o(c.x,c.y,e).width>o(p,v,e).width)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(c)return c;var y=e.a,C=e.c,$=y*C>=0?C:-C;return r(u,f,t,s,a,h,l,y,$)}function s(t,e,i,n,s,a,h,l){var u=e.a,d=e.c;if(u>-1e-9&&1e-9>u&&(u=0),d>-1e-9&&1e-9>d&&(d=0),0==u&&0==d)return null;if(0==u)return egret.Point.create(i,t/Math.abs(d));if(0==d)return egret.Point.create(t/Math.abs(u),n);var c,p,v,f=u*d>=0?d:-d;if(0!=f&&i>0){var g=1/f;i=Math.max(s,Math.min(h,i)),p=i,v=(t-u*p)*g,v>=a&&l>=v&&u*p+f*v>=0&&(c=egret.Point.create(p,v)),v=(-t-u*p)*g,v>=a&&l>=v&&0>u*p+f*v&&(!c||o(c.x,c.y,e).height>o(p,v,e).height)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(0!=u&&n>0){var m=1/u;n=Math.max(a,Math.min(l,n)),v=n,p=(t-f*v)*m,p>=s&&h>=p&&u*p+f*v>=0&&(!c||o(c.x,c.y,e).height>o(p,v,e).height)&&(egret.Point.release(c),c=egret.Point.create(p,v)),p=(-t-f*v)*m,p>=s&&h>=p&&0>u*p+f*v&&(!c||o(c.x,c.y,e).height>o(p,v,e).height)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(c)return c;var y=e.b,C=e.d,$=y*C>=0?C:-C;return r(u,f,t,s,a,h,l,y,$)}function r(t,e,i,n,s,r,a,o,h){if(0==t||0==e)return null;var l,u,d=(i-n*t)/e,c=(i-r*t)/e,p=Math.max(s,Math.min(d,c)),v=Math.min(a,Math.max(d,c)),f=o*e-t*h;return v>=p?(u=Math.abs(f)<1e-9?i/(t+e):o*i/f,u=Math.max(p,Math.min(u,v)),l=(i-e*u)/t,egret.Point.create(l,u)):(d=-(n*t+i)/e,c=-(r*t+i)/e,p=Math.max(s,Math.min(d,c)),v=Math.min(a,Math.max(d,c)),v>=p?(u=Math.abs(f)<1e-9?-i/(t+e):-o*i/f,u=Math.max(p,Math.min(u,v)),l=(-i-e*u)/t,egret.Point.create(l,u)):null)}function a(t,e,i,n,s,a,o){var l=i.a,u=i.b,d=i.c,c=i.d;if(l>-1e-9&&1e-9>l&&(l=0),u>-1e-9&&1e-9>u&&(u=0),d>-1e-9&&1e-9>d&&(d=0),c>-1e-9&&1e-9>c&&(c=0),0==u&&0==d)return 0==l||0==c?null:egret.Point.create(t/Math.abs(l),e/Math.abs(c));if(0==l&&0==c)return 0==u||0==d?null:egret.Point.create(e/Math.abs(u),t/Math.abs(d));var p=l*d>=0?d:-d,v=u*c>=0?c:-c,f=l*v-u*p;if(Math.abs(f)<1e-9)return 0==p||0==l||l==-p?null:Math.abs(l*e-u*t)>1e-9?null:r(l,p,t,n,n,a,o,u,v);var g=1/f;t*=g,e*=g;var m;return m=h(l,p,u,v,t,e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x>=0&&u*m.x+v*m.y>=0?m:(m=h(l,p,u,v,t,-e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x>=0&&u*m.x+v*m.y<0?m:(m=h(l,p,u,v,-t,e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x<0&&u*m.x+v*m.y>=0?m:(m=h(l,p,u,v,-t,-e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x<0&&u*m.x+v*m.y<0?m:(egret.Point.release(m),null))))}function o(t,e,i){var n=egret.$TempRectangle.setTo(0,0,t,e);return i.$transformBounds(n),n}function h(t,e,i,n,s,r){return egret.Point.create(n*s-e*r,t*r-i*s)}var l=.1,u=.1,d=function(){function t(){}var n=(__define,t);n.prototype;return t.fitBounds=function(t,n,s,r,h,d,c,p,v,f,g){if(isNaN(t)&&isNaN(n))return egret.Point.create(d,c);var m,y=u>p?0:p-u,C=u>v?0:v-u,$=f+u,E=g+u;if(isNaN(t)||isNaN(n))return isNaN(t)?i(n,s,r,h,d,c,y,C,$,E):e(t,s,r,h,d,c,y,C,$,E);if(m=a(t,n,s,y,C,$,E),!m){var _;if(_=e(t,s,r,h,d,c,y,C,$,E)){var T=o(_.x,_.y,s).height;T-l>n&&(egret.Point.release(_),_=null)}var I;if(I=i(n,s,r,h,d,c,y,C,$,E)){var x=o(I.x,I.y,s).width;x-l>t&&(egret.Point.release(I),I=null)}m=_&&I?_.x*_.y>I.x*I.y?_:I:_?_:I,egret.Point.release(_),egret.Point.release(I)}return m},t}();t.MatrixUtil=d,egret.registerClass(d,"eui.sys.MatrixUtil")}(e=t.sys||(t.sys={}))}(eui||(eui={})); \ No newline at end of file +var exClass=this.parseClass(xmlData,className),code=exClass.toCode(),clazz,clazz=eval(code);if(hasClass&&clazz){egret.registerClass(clazz,className);for(var paths=className.split("."),length=paths.length,definition=__global,i=0;length-1>i;i++){var path=paths[i];definition=definition[path]||(definition[path]={})}definition[paths[length-1]]||(definition[paths[length-1]]=clazz)}return clazz},p.parseClass=function(t,e){sys.exmlConfig||(sys.exmlConfig=new sys.EXMLConfig),this.currentXML=t,this.currentClassName=e,this.delayAssignmentDic={},this.idDic={},this.stateCode=[],this.stateNames=[],this.skinParts=[],this.bindings=[],this.declarations=null,this.currentClass=new sys.EXClass,this.stateIds=[];var i=e.lastIndexOf(".");-1!=i?this.currentClass.className=e.substring(i+1):this.currentClass.className=e,this.startCompile();var n=this.currentClass;return this.currentClass=null,n},p.startCompile=function(){var t=this.getClassNameOfNode(this.currentXML);this.isSkinClass=t==SKIN_CLASS,this.currentClass.superClass=t,this.getStateNames();var e=this.currentXML.children;if(e)for(var i=e.length,n=0;i>n;n++){var s=e[n];if(1===s.nodeType&&s.namespace==sys.NS_W&&s.localName==DECLARATIONS){this.declarations=s;break}}this.currentXML.namespace&&(this.addIds(this.currentXML.children),this.createConstructFunc())},p.addIds=function(t){if(t)for(var e=t.length,i=0;e>i;i++){var n=t[i];if(1==n.nodeType&&n.namespace&&!this.isInnerClass(n))if(this.addIds(n.children),n.namespace!=sys.NS_W&&n.localName){if(this.isProperty(n)){var s=n.localName,r=s.indexOf("."),a=n.children;if(-1==r||!a||0==a.length)continue;var o=a[0];this.stateIds.push(o.attributes.id)}else if(1===n.nodeType){var h=n.attributes.id;h?(-1==this.skinParts.indexOf(h)&&this.skinParts.push(h),this.createVarForNode(n),this.isStateNode(n)&&this.stateIds.push(h)):(this.createIdForNode(n),this.isStateNode(n)&&this.stateIds.push(n.attributes.id))}}else;}},p.isInnerClass=function(t){if(t.hasOwnProperty("isInnerClass"))return t.isInnerClass;var e="Skin"==t.localName&&t.namespace==sys.NS_S;if(!e)if(this.isProperty(t))e=!1;else{var i=t.parent;if(this.isProperty(i)){var n=i.localName,s=n.indexOf(".");if(-1!=s){n.substring(s+1);n=n.substring(0,s)}i=i.parent}else n=sys.exmlConfig.getDefaultPropById(i.localName,i.namespace);var r=sys.exmlConfig.getClassNameById(i.localName,i.namespace);e=sys.exmlConfig.getPropertyType(n,r)==TYPE_CLASS}return t.isInnerClass=e,e},p.containsState=function(t){var e=t.attributes;if(e.includeIn||e.excludeFrom)return!0;for(var i=Object.keys(e),n=i.length,s=0;n>s;s++){var r=i[s];if(-1!=r.indexOf("."))return!0}return!1},p.createIdForNode=function(t){var e=this.getNodeId(t);this.idDic[e]?this.idDic[e]++:this.idDic[e]=1,e+=this.idDic[e],t.attributes.id=e},p.getNodeId=function(t){return t.attributes.id?t.attributes.id:"_"+t.localName},p.createVarForNode=function(t){var e=this.getClassNameOfNode(t);""!=e&&(this.currentClass.getVariableByName(t.attributes.id)||this.currentClass.addVariable(new sys.EXVariable(t.attributes.id)))},p.createFuncForNode=function(t){var e=t.localName,i=this.isBasicTypeData(e);if(i)return this.createBasicTypeForNode(t);var n=this.getClassNameOfNode(t),s=new sys.EXFunction,r="_i",a=t.attributes.id;s.name=a+r,this.currentClass.addFunction(s);var o=new sys.EXCodeBlock;s.codeBlock=o;var h="t";"Object"==e?o.addVar(h,"{}"):o.addVar(h,"new "+n+"()");var l=!!this.currentClass.getVariableByName(a);l&&o.addAssignment("this."+a,h),this.addAttributesToCodeBlock(o,h,t),this.initlizeChildNode(t,o,h);var u=this.delayAssignmentDic[a];if(u)for(var d=u.length,c=0;d>c;c++){var p=u[c];o.concat(p)}return o.addReturn(h),"this."+s.name+"()"},p.isBasicTypeData=function(t){return-1!=basicTypes.indexOf(t)},p.createBasicTypeForNode=function(t){var e=t.localName,i="",n=this.currentClass.getVariableByName(t.attributes.id),s=t.children,r="";if(s&&s.length>0){var a=s[0];3==a.nodeType&&(r=a.text.trim())}switch(e){case TYPE_ARRAY:var o=[];if(s)for(var h=s.length,l=0;h>l;l++){var u=s[l];1==u.nodeType&&o.push(this.createFuncForNode(u))}i="["+o.join(",")+"]";break;case"boolean":i="false"!=r&&r?"true":"false";break;case"number":i=r,-1!=i.indexOf("%")&&(i=i.substring(0,i.length-1));break;case"string":i=this.formatString(r)}return n&&(n.defaultValue=i),i},p.addAttributesToCodeBlock=function(t,e,i){var n,s,r=i.attributes,a=Object.keys(r);a.sort();for(var o=a.length,h=0;o>h;h++)if(n=a[h],this.isNormalKey(n)&&(s=r[n],n=this.formatKey(n,s),s=this.formatValue(n,s,i))){if(this.currentClass.getVariableByName(s)){var l="this.",u=r.id,d=l+u+" = t;";this.currentClass.getVariableByName(u)||this.createVarForNode(i),t.containsCodeLine(d)||t.addCodeLineAt(d,1);var c=new sys.EXCodeBlock;"this"==e?c.addAssignment(e,l+s,n):(c.startIf(l+u),c.addAssignment(l+u,l+s,n),c.endBlock()),this.delayAssignmentDic[s]||(this.delayAssignmentDic[s]=[]),this.delayAssignmentDic[s].push(c),s=l+s}t.addAssignment(e,s,n)}},p.initlizeChildNode=function(t,e,i){var n=t.children;if(n&&0!=n.length){for(var s=sys.exmlConfig.getClassNameById(t.localName,t.namespace),r=[],a=n.length,o=[],h=0;a>h;h++){var l=n[h];if(1==l.nodeType&&l.namespace!=sys.NS_W)if(this.isInnerClass(l)){if("Skin"==l.localName){var u=this.parseInnerClass(l),d=sys.exmlConfig.getPropertyType(SKIN_NAME,s);d?e.addAssignment(i,u,SKIN_NAME):egret.$error(2005,this.currentClassName,SKIN_NAME,getPropertyStr(l))}}else{var c=l.localName;if(this.isProperty(l)){if(!this.isNormalKey(c))continue;var d=sys.exmlConfig.getPropertyType(l.localName,s);if(!d)continue;if(!l.children||0==l.children.length)continue;var p;this.addChildrenToProp(l.children,d,c,e,i,p,o,t)}else r.push(l)}}if(0!=r.length){var p,v=sys.exmlConfig.getDefaultPropById(t.localName,t.namespace),f=sys.exmlConfig.getPropertyType(v,s);v&&f&&this.addChildrenToProp(r,f,v,e,i,p,o,t)}}},p.parseInnerClass=function(t){var e=exmlParserPool.pop();e||(e=new EXMLParser);var i=this.currentClass.className+"$"+t.localName+innerClassCount++,n=e.parseClass(t,i);return this.currentClass.addInnerClass(n),exmlParserPool.push(e),i},p.addChildrenToProp=function(t,e,i,n,s,r,a,o){var h="",l=t.length;if(l>1){if(e!=TYPE_ARRAY)return;for(var u=[],d=0;l>d;d++){var c=t[d];if(1==c.nodeType){h=this.createFuncForNode(c);var p=this.getClassNameOfNode(c);this.isStateNode(c)||u.push(h)}}h="["+u.join(",")+"]"}else{var v=t[0];if(e==TYPE_ARRAY)if(v.localName==TYPE_ARRAY){if(u=[],v.children)for(var f=v.children.length,g=0;f>g;g++)c=v.children[g],1==c.nodeType&&(h=this.createFuncForNode(c),p=this.getClassNameOfNode(c),this.isStateNode(c)||u.push(h));h="["+u.join(",")+"]"}else{h=this.createFuncForNode(v);var p=this.getClassNameOfNode(v);h=this.isStateNode(v)?"[]":"["+h+"]"}else if(1==v.nodeType)if(e==TYPE_CLASS){if(l>1)return;h=this.parseInnerClass(t[0])}else{this.getClassNameOfNode(v);h=this.createFuncForNode(v)}else h=this.formatValue(i,v.text,o)}""!=h&&(-1==h.indexOf("()")&&(i=this.formatKey(i,h)),-1==a.indexOf(i)&&a.push(i),n.addAssignment(s,h,i))},p.isProperty=function(t){if(t.hasOwnProperty("isProperty"))return t.isProperty;var e,i=t.localName;if(i&&1===t.nodeType&&t.parent&&!this.isBasicTypeData(i)){var n=t.parent,s=i.indexOf(".");-1!=s&&(i=i.substr(0,s));var r=sys.exmlConfig.getClassNameById(n.localName,n.namespace);e=!!sys.exmlConfig.getPropertyType(i,r)}else e=!1;return t.isProperty=e,e},p.isNormalKey=function(t){return t&&-1==t.indexOf(".")&&-1==wingKeys.indexOf(t)?!0:!1},p.formatKey=function(t,e){return-1!=e.indexOf("%")&&("height"==t?t="percentHeight":"width"==t&&(t="percentWidth")),t},p.formatValue=function(t,e,i){e||(e="");var n=e;e=e.trim();var s=this.getClassNameOfNode(i),r=sys.exmlConfig.getPropertyType(t,s),a=this.formatBinding(t,e,i);if(a){this.checkIdForState(i);var o="this";i!==this.currentXML&&(o+="."+i.attributes.id),this.bindings.push(new sys.EXBinding(o,t,a.templates,a.chainIndex)),e=""}else if(r==RECTANGLE){e="new "+RECTANGLE+"("+e+")"}else{switch(r){case TYPE_CLASS:t==SKIN_NAME&&(e=this.formatString(n));break;case"number":0==e.indexOf("#")?e="0x"+e.substring(1):-1!=e.indexOf("%")&&(e=parseFloat(e.substr(0,e.length-1)).toString());break;case"boolean":e="false"!=e&&e?"true":"false";break;case"string":case"any":e=this.formatString(n)}}return e},p.formatString=function(t){return t=this.unescapeHTMLEntity(t),t=t.split("\n").join("\\n"),t=t.split("\r").join("\\n"),t=t.split('"').join('\\"'),t='"'+t+'"'},p.formatBinding=function(t,e,i){if(!e)return null;if(e=e.trim(),"{"!=e.charAt(0)||"}"!=e.charAt(e.length-1))return null;e=e.substring(1,e.length-1).trim();for(var n=e.split("+"),s=[],r=n.length,a=0;r>a;a++){var o=n[a].trim();if(o){var h=o.charAt(0);if(!("'"==h||'"'==h||h>="0"&&"9">=h||-1==o.indexOf(".")&&-1!=jsKeyWords.indexOf(o))){0==o.indexOf("this.")&&(o=o.substring(5));var l=o.split(".")[0];l!=HOST_COMPONENT&&-1==this.skinParts.indexOf(l)&&(o=HOST_COMPONENT+"."+o),n[a]='"'+o+'"',s.push(a)}}else n.splice(a,1),a--,r--}return{templates:n,chainIndex:s}},p.unescapeHTMLEntity=function(t){if(!t)return"";for(var e=htmlEntities.length,i=0;e>i;i++){var n=htmlEntities[i],s=n[0],r=n[1];t=t.split(r).join(s)}return t},p.createConstructFunc=function(){var t=new sys.EXCodeBlock;t.addEmptyLine();var e="this";if(this.addAttributesToCodeBlock(t,e,this.currentXML),this.declarations){var i=this.declarations.children;if(i&&i.length>0)for(var n=i.length,s=0;n>s;s++){var r=i[s];if(1==r.nodeType){var a=this.createFuncForNode(r);a&&t.addCodeLine(a+";")}}}this.initlizeChildNode(this.currentXML,t,e);var o,h=this.stateIds;if(h.length>0){n=h.length;for(var s=0;n>s;s++)o=h[s],t.addCodeLine("this."+o+"_i();");t.addEmptyLine()}var l=this.skinParts,u="[]";if(n=l.length,n>0){for(s=0;n>s;s++)l[s]='"'+l[s]+'"';u="["+l.join(",")+"]"}var d=new sys.EXFunction;d.name="skinParts",d.isGet=!0;var c=new sys.EXCodeBlock;c.addReturn(u),d.codeBlock=c,this.currentClass.addFunction(d),this.currentXML.attributes.id="",this.createStates(this.currentXML);for(var p,v=this.currentXML,f=(this.getClassNameOfNode(v),v.attributes),g=Object.keys(f),m=g.length,y=0;m>y;y++){var C=g[y],$=f[C],E=C.indexOf(".");if(-1!=E){var _=C.substring(0,E);_=this.formatKey(_,$);var T=this.formatValue(_,$,v);if(!T)continue;var I=C.substr(E+1);p=this.getStateByName(I,v);var x=p.length;if(x>0)for(s=0;x>s;s++){var S=p[s];S.addOverride(new sys.EXSetProperty("",_,T))}}}var L=this.stateCode;if(n=L.length,n>0){var P=" ";t.addCodeLine("this.states = [");var N=!0;for(s=0;n>s;s++){S=L[s],N?N=!1:t.addCodeLine(P+",");for(var A=S.toCode().split("\n"),b=0;b0)for(t.addEmptyLine(),s=0;n>s;s++){var D=B[s];t.addCodeLine(D.toCode())}this.currentClass.constructCode=t},p.isStateNode=function(t){var e=t.attributes;return e.hasOwnProperty("includeIn")||e.hasOwnProperty("excludeFrom")},p.getStateNames=function(){var t=this.currentXML,e=sys.exmlConfig.getClassNameById(t.localName,t.namespace),i=sys.exmlConfig.getPropertyType("states",e);if(i==TYPE_STATE){var n=t.attributes.states;n&&delete t.attributes.states;var s,r=this.stateNames,a=t.children;if(a)for(var o=a.length,h=0;o>h;h++){var l=a[h];if(1==l.nodeType&&"states"==l.localName){l.namespace=sys.NS_W,s=l.children;break}}if(s||n)if(n){var u=n.split(",");o=u.length;for(var h=0;o>h;h++){var d=u[h].trim();d&&(-1==r.indexOf(d)&&r.push(d),this.stateCode.push(new sys.EXState(d)))}}else for(o=s.length,h=0;o>h;h++){var c=s[h];if(1==c.nodeType){var p=[],v=c.attributes;if(v.stateGroups)for(var f=v.stateGroups.split(","),g=f.length,m=0;g>m;m++){var y=f[m].trim();y&&(-1==r.indexOf(y)&&r.push(y),p.push(y))}d=v.name,-1==r.indexOf(d)&&r.push(d),this.stateCode.push(new sys.EXState(d,p))}}}},p.createStates=function(t){var e=t.children;if(e)for(var i=e.length,n=0;i>n;n++){var s=e[n];if(1==s.nodeType&&!this.isInnerClass(s)&&(this.createStates(s),s.namespace!=sys.NS_W&&s.localName))if(this.isProperty(s)){var r=s.localName,a=r.indexOf("."),o=s.children;if(-1==a||!o||0==o.length)continue;var h=r.substring(a+1);r=r.substring(0,a);var l,u=this.getClassNameOfNode(t),d=(sys.exmlConfig.getPropertyType(r,u),o[0]);1==d.nodeType?(this.createFuncForNode(d),this.checkIdForState(d),l="this."+d.attributes.id):l=this.formatValue(r,d.text,t),g=this.getStateByName(h,s);var c=g.length;if(c>0)for(var p=0;c>p;p++)m=g[p],m.addOverride(new sys.EXSetProperty(t.attributes.id,r,l))}else if(this.containsState(s)){var v=s.attributes,f=v.id;this.getClassNameOfNode(s);this.checkIdForState(s);var h,g,m;if(this.isStateNode(s)){var y="",C=s.parent;C.localName==TYPE_ARRAY&&(C=C.parent),C&&C.parent&&this.isProperty(C)&&(C=C.parent),C&&C!=this.currentXML&&(y=C.attributes.id,this.checkIdForState(C));var $=this.findNearNodeId(s),E=[];if(v.includeIn)E=v.includeIn.split(",");else{for(var _=v.excludeFrom.split(","),T=_.length,p=0;T>p;p++){var I=_[p];this.getStateByName(I,s)}for(T=this.stateCode.length,p=0;T>p;p++)m=this.stateCode[p],-1==_.indexOf(m.name)&&E.push(m.name)}for(var x=E.length,S=0;x>S;S++)if(h=E[S],g=this.getStateByName(h,s),g.length>0)for(var c=g.length,p=0;c>p;p++)m=g[p],m.addOverride(new sys.EXAddItems(f,y,$.position,$.relativeTo))}for(var L=Object.keys(v),P=L.length,N=0;P>N;N++){I=L[N];var l=v[I],a=I.indexOf(".");if(-1!=a){var A=I.substring(0,a);A=this.formatKey(A,l);var b=this.formatBinding(A,l,s);if(!b){var l=this.formatValue(A,l,s);if(!l)continue}h=I.substr(a+1),g=this.getStateByName(h,s);var c=g.length;if(c>0)for(var p=0;c>p;p++)m=g[p],b?m.addOverride(new sys.EXSetStateProperty(f,A,b.templates,b.chainIndex)):m.addOverride(new sys.EXSetProperty(f,A,l))}}}}},p.checkIdForState=function(t){if(t&&!this.currentClass.getVariableByName(t.attributes.id)){this.createVarForNode(t);var e=t.attributes.id,i=e+"_i",n=this.currentClass.getFuncByName(i);if(n){var s="this."+e+" = t;",r=n.codeBlock;r&&(r.containsCodeLine(s)||r.addCodeLineAt(s,1))}}},p.getStateByName=function(t,e){for(var i=[],n=this.stateCode,s=n.length,r=0;s>r;r++){var a=n[r];if(a.name==t)-1==i.indexOf(a)&&i.push(a);else if(a.stateGroups.length>0){for(var o=!1,h=a.stateGroups.length,l=0;h>l;l++){var u=a.stateGroups[l];if(u==t){o=!0;break}}o&&-1==i.indexOf(a)&&i.push(a)}}return i},p.findNearNodeId=function(t){for(var e,i,n,s=t.parent,r="",a=-1,o=!1,h=s.children,l=h.length,u=0;l>u;u++){var d=h[u];this.isProperty(d)||(d==t?(o=!0,a=u):!o||n||this.isStateNode(d)||(n=d),o||this.isStateNode(d)||(i=d))}return 0==a?(e=0,{position:e,relativeTo:r}):a==l-1?(e=1,{position:e,relativeTo:r}):n&&(e=2,r=n.attributes.id)?(this.checkIdForState(n),{position:e,relativeTo:r}):{position:1,relativeTo:r}},p.getClassNameOfNode=function(t){var e=sys.exmlConfig.getClassNameById(t.localName,t.namespace);return e},EXMLParser}();sys.EXMLParser=EXMLParser,egret.registerClass(EXMLParser,"eui.sys.EXMLParser")}(sys=eui.sys||(eui.sys={}))}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){var e=egret.getDefinitionByName(t);return e?e.prototype:null}function n(t){if(!t)return null;var e,e=new t;return e}t.NS_S="http://ns.egret.com/eui",t.NS_W="http://ns.egret.com/wing";var s=["Point","Matrix","Rectangle"],r=["Array","boolean","string","number"],a="eui.",o=0,h={},l=function(){function l(){}var u=(__define,l),d=u.prototype;return d.$describe=function(t){function i(){}if(!t)return null;var s=Object.getPrototypeOf(t);if(!s)return null;var a;if(s.hasOwnProperty("__hashCode__")&&(a=h[s.__hashCode__]))return a;var l=Object.getPrototypeOf(s);if(!l)return null;var u=n(l.constructor),d=this.$describe(u);d?(i.prototype=d,a=new i):a={};for(var c=Object.keys(s).concat(Object.keys(t)),p=c.length,v=t.__meta__,f=0;p>f;f++){var g=c[f];if("constructor"!=g&&"_"!=g.charAt(0)&&"$"!=g.charAt(0)){var m;if(v&&v[g])m=v[g];else if(e(t[g]))m="Array";else{if(m=typeof t[g],"function"==m)continue;-1==r.indexOf(m)&&(m="any")}a[g]=m}}return Object.getPrototypeOf(l)&&(s.__hashCode__=o++,h[s.__hashCode__]=a),a},d.getClassNameById=function(e,n){if(n==t.NS_S){if("Object"==e)return e;if(-1!=s.indexOf(e))return"egret."+e}var o="";return-1!=r.indexOf(e)?e:(n==t.NS_W||(o=n&&n!=t.NS_S?n.substring(0,n.length-1)+e:a+e),i(o)||(o=""),o)},d.getDefaultPropById=function(t,e){var n,s=this.getClassNameById(t,e),r=i(s);return r&&(n=r.__defaultProperty__),n?n:""},d.getPropertyType=function(t,e){if("Object"==e)return"any";var s="",r=i(e);if(r){if(!r.hasOwnProperty("__hashCode__")){var a=egret.getDefinitionByName(e),o=n(a);if(!o)return s;this.$describe(o)}var l=h[r.__hashCode__];l&&(s=l[t])}return s},l}();t.EXMLConfig=l,egret.registerClass(l,"eui.sys.EXMLConfig")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var EXML;!function(t){function e(t){return h.parse(t)}function i(t,e,i,n){if(void 0===n&&(n=!1),n&&t in u)return void(e&&e.call(i,u[t],t));var s=l[t];return s?void s.push([e,i]):(l[t]=[[e,i]],void o(t,a))}function n(t,e,i,n){if(void 0===n&&(n=!1),!t||0==t.length)return void(e&&e.call(i,[],t));var r=[];t.forEach(function(a){if(n&&a in u)return r[a]="",void r.push(a);var h=function(n,a){r[n]=a,r.push(n),r.length==t.length&&s(t,r,e,i)};o(a,h)})}function s(t,e,i,n){var s=[];t.forEach(function(t,i){if(t in u&&!e[t])return void(s[i]=u[t]);var n=e[t],r=a(t,n);s[i]=r}),i&&i.call(n,s,t)}function r(t,e,i){if(e)var n=h.$parseCode(e,i);if(t){u[t]=n;var s=l[t];delete l[t];for(var r=s?s.length:0,a=0;r>a;a++){var o=s[a];o[0]&&o[1]&&o[0].call(o[1],n,t)}}return n}function a(t,i){if(i)var n=e(i);if(t){u[t]=n;var s=l[t];delete l[t];for(var r=s?s.length:0,a=0;r>a;a++){var o=s[a];o[0]&&o[1]&&o[0].call(o[1],n,t)}}return n}function o(e,i){var n=e;-1==e.indexOf("://")&&(n=d+e);var s=function(t){t||(t=""),i(e,t)},r=t.$stage?t.$stage.getImplementation("eui.IThemeAdapter"):null;r||(r=new eui.DefaultThemeAdapter),r.getTheme(n,s,s,this)}var h=new eui.sys.EXMLParser,l={},u={},d="";Object.defineProperty(t,"prefixURL",{get:function(){return d},set:function(t){d=t},enumerable:!0,configurable:!0}),t.parse=e,t.load=i,t.$loadAll=n,t.$parseURLContentAsJs=r,t.$parseURLContent=a}(EXML||(EXML={}));var eui;!function(t){egret.$locale_strings=egret.$locale_strings||{},egret.$locale_strings.en_US=egret.$locale_strings.en_US||{};var e=egret.$locale_strings.en_US;e[2001]="EXML parsing error {0}: EXML file can't be found ",e[2002]="EXML parsing error : invalid XML file:\n{0}",e[2003]="EXML parsing error {0}: the class definitions corresponding to nodes can't be found \n {1}",e[2004]="EXML parsing error {0}: nodes cannot contain id property with the same name \n {1}",e[2005]="EXML parsing error {0}: property with the name of '{1}' does not exist on the node, or the property does not have a default value: \n {2}",e[2006]="EXML parsing error {0}: undefined view state name: '{1}' \n {2}",e[2007]="EXML parsing error {0}: only UIComponent objects within the container can use the includeIn and excludeFrom properties\n {1}",e[2008]="EXML parsing error {0}: fail to assign values of '{1}' class to property: '{2}' \n {3}",e[2009]="EXML parsing error {0}: only one ID can be referenced in the node property value '{}' label; and complex expression is not allowed to use \n {1}",e[2010]="EXML parsing error {0}: ID referenced by property: '{1}': '{2}' does not exist \n {3}",e[2011]="EXML parsing error {0}: fail to assign more than one child nodes to the same property: '{1}' \n {2}",e[2012]="EXML parsing error {0}: no default property exists on the node; and you must explicitly declare the property name that the child node is assigned to \n {1}",e[2013]="EXML parsing error {0}: view state grammar is not allowed to use on property nodes of Array class \n {1} ",e[2014]="EXML parsing error {0}: assigning the skin class itself to the node property is not allowed \n {1}",e[2015]="EXML parsing error {0}: class definition referenced by node: {1} does not exist \n {2}",e[2016]="EXML parsing error {0}: format error of 'scale9Grid' property value on the node: {1}",e[2017]="EXML parsing error {0}: namespace prefix missing on the node: {1}",e[2018]="EXML parsing error {0}: format error of 'skinName' property value on the node: {1}",e[2019]="EXML parsing error {0}: the container’s child item must be visible nodes: {1}",e[2020]="EXML parsing error {0}: for child nodes in w: Declarations, the includeIn and excludeFrom properties are not allowed to use \n {1}",e[2021]="Compile errors in {0}, the attribute name: {1}, the attribute value: {2}.",e[2101]="EXML parsing warnning : fail to register the class property : {0},there is already a class with the same name in the global,please try to rename the class name for the exml. \n {1}",e[2102]="EXML parsing warnning {0}: no child node can be found on the property code \n {1}",e[2103]="EXML parsing warnning {0}: the same property '{1}' on the node is assigned multiple times \n {2}",e[2104]="EXML parsing warnning, Instantiate class {0} error,the parameters of its constructor method must be empty.",e[2201]="BasicLayout doesn't support virtualization.",e[2202]="parse skinName error,the parsing result of skinName must be a instance of eui.Skin.",e[2203]="Could not find the skin class '{0}'。",e[2301]="parse source failed,could not find asset from URL:{0} ."}(eui||(eui={}));var eui;!function(t){egret.$locale_strings=egret.$locale_strings||{},egret.$locale_strings.zh_CN=egret.$locale_strings.zh_CN||{};var e=egret.$locale_strings.zh_CN;e[2001]="EXML解析错误 {0}: 找不到EXML文件",e[2002]="EXML解析错误: 不是有效的XML文件:\n{0}",e[2003]="EXML解析错误 {0}: 无法找到节点所对应的类定义\n{1}",e[2004]="EXML解析错误 {0}: 节点不能含有同名的id属性\n{1}",e[2005]="EXML解析错误 {0}: 节点上不存在名为'{1}'的属性,或者该属性没有初始值:\n{2}",e[2006]="EXML解析错误 {0}: 未定义的视图状态名称:'{1}'\n{2}",e[2007]="EXML解析错误 {0}: 只有处于容器内的 UIComponent 对象可以使用includeIn和excludeFrom属性\n{1}",e[2008]="EXML解析错误 {0}: 无法将'{1}'类型的值赋给属性:'{2}'\n{3}",e[2009]="EXML解析错误 {0}: 在节点属性值的‘{}’标签内只能引用一个ID,不允许使用复杂表达式\n{1}",e[2010]="EXML解析错误 {0}: 属性:'{1}'所引用的ID: '{2}'不存在\n{3}",e[2011]="EXML解析错误 {0}: 无法将多个子节点赋值给同一个属性:'{1}'\n{2}",e[2012]="EXML解析错误 {0}: 节点上不存在默认属性,必须显式声明子节点要赋值到的属性名\n{1}",e[2013]="EXML解析错误 {0}: 类型为Array的属性节点上不允许使用视图状态语法\n{1}",e[2014]="EXML解析错误 {0}: 不允许将皮肤类自身赋值给节点属性\n{1}",e[2015]="EXML解析错误 {0}: 节点引用的类定义:{1}不存在\n{2}",e[2016]="EXML解析错误 {0}: 节点上'scale9Grid'属性值的格式错误:{1}",e[2017]="EXML解析错误 {0}: 节点上缺少命名空间前缀:{1}",e[2018]="EXML解析错误 {0}: 节点上'skinName'属性值的格式错误:{1}",e[2019]="EXML解析错误 {0}: 容器的子项必须是可视节点:{1}",e[2020]="EXML解析错误 {0}: 在w:Declarations内的子节点,不允许使用includeIn和excludeFrom属性\n{1}",e[2021]="{0} 中存在编译错误,属性名 : {1},属性值 : {2}",e[2101]="EXML解析警告: 在EXML根节点上声明的 class 属性: {0} 注册失败,所对应的类已经存在,请尝试重命名要注册的类名。\n{1}",e[2102]="EXML解析警告 {0}: 在属性节点上找不到任何子节点\n{1}",e[2103]="EXML解析警告 {0}: 节点上的同一个属性'{1}'被多次赋值\n{2}",e[2104]="EXML解析警告,无法直接实例化自定义组件:{0} ,在EXML中使用的自定义组件必须要能直接被实例化,否则可能导致后续EXML解析报错。",e[2201]="BasicLayout 不支持虚拟化。",e[2202]="皮肤解析出错,属性 skinName 的值必须要能够解析为一个 eui.Skin 的实例。",e[2203]="找不到指定的皮肤类 '{0}'。",e[2301]="素材解析失败,找不到URL:{0} 所对应的资源。"}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.call(this),this.$target=null,this.$useVirtualLayout=!1,this.$typicalWidth=71,this.$typicalHeight=22}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"target",function(){return this.$target},function(t){this.$target!==t&&(this.$target=t,this.clearVirtualLayoutCache())}),i(s,"useVirtualLayout",function(){return this.$useVirtualLayout},function(t){t=!!t,this.$useVirtualLayout!=t&&(this.$useVirtualLayout=t,this.dispatchEventWith("useVirtualLayoutChanged"),this.$useVirtualLayout&&!t&&this.clearVirtualLayoutCache(),this.target&&this.target.invalidateDisplayList())}),s.setTypicalSize=function(t,e){t=+t||71,e=+e||22,(t!==this.$typicalWidth||e!==this.$typicalHeight)&&(this.$typicalWidth=t,this.$typicalHeight=e,this.$target&&this.$target.invalidateSize())},s.scrollPositionChanged=function(){},s.clearVirtualLayoutCache=function(){},s.elementAdded=function(t){},s.elementRemoved=function(t){},s.getElementIndicesInView=function(){return null},s.measure=function(){},s.updateDisplayList=function(t,e){},e}(egret.EventDispatcher);t.LayoutBase=e,egret.registerClass(e,"eui.LayoutBase")}(eui||(eui={}));var eui;!function(t){var e=function(e){function i(){e.call(this)}__extends(i,e);var n=(__define,i),s=n.prototype;return s.measure=function(){e.prototype.measure.call(this),t.sys.measure(this.$target)},s.updateDisplayList=function(i,n){e.prototype.updateDisplayList.call(this,i,n);var s=this.$target,r=t.sys.updateDisplayList(s,i,n);s.setContentSize(Math.ceil(r.x),Math.ceil(r.y))},i}(t.LayoutBase);t.BasicLayout=e,egret.registerClass(e,"eui.BasicLayout")}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t,e){if(!t||"number"==typeof t)return t;var i=t,n=i.indexOf("%");if(-1==n)return+i;var s=+i.substring(0,n);return.01*s*e}function i(t){if(t){for(var e=0,i=0,n=egret.$TempRectangle,r=t.numChildren,a=0;r>a;a++){var o=t.getChildAt(a);if(egret.is(o,s)&&o.$includeInLayout){var h,l,u=o.$UIComponent,d=+u[4],c=+u[5],p=+u[0],v=+u[1],f=+u[2],g=+u[3];o.getPreferredBounds(n),isNaN(p)||isNaN(v)?isNaN(d)?isNaN(p)&&isNaN(v)?h=n.x:(h=isNaN(p)?0:p,h+=isNaN(v)?0:v):h=2*Math.abs(d):h=p+v,isNaN(f)||isNaN(g)?isNaN(c)?isNaN(f)&&isNaN(g)?l=n.y:(l=isNaN(f)?0:f,l+=isNaN(g)?0:g):l=2*Math.abs(c):l=f+g;var m=n.width,y=n.height;e=Math.ceil(Math.max(e,h+m)),i=Math.ceil(Math.max(i,l+y))}}t.setMeasuredSize(e,i)}}function n(t,i,n){if(t){for(var r=t.numChildren,a=0,o=0,h=egret.$TempRectangle,l=0;r>l;l++){var u=t.getChildAt(l);if(egret.is(u,s)&&u.$includeInLayout){var d=u.$UIComponent,c=e(d[4],i),p=e(d[5],n),v=e(d[0],i),f=e(d[1],i),g=e(d[2],n),m=e(d[3],n),y=d[6],C=d[7],$=0/0,E=0/0;isNaN(v)||isNaN(f)?isNaN(y)||($=Math.round(i*Math.min(.01*y,1))):$=i-f-v,isNaN(g)||isNaN(m)?isNaN(C)||(E=Math.round(n*Math.min(.01*C,1))):E=n-m-g,u.setLayoutBoundsSize($,E),u.getLayoutBounds(h);var _=h.width,T=h.height,I=0/0,x=0/0;I=isNaN(c)?isNaN(v)?isNaN(f)?h.x:i-_-f:v:Math.round((i-_)/2+c),x=isNaN(p)?isNaN(g)?isNaN(m)?h.y:n-T-m:g:Math.round((n-T)/2+p),u.setLayoutBoundsPosition(I,x),a=Math.max(a,I+_),o=Math.max(o,x+T)}}return egret.$TempPoint.setTo(a,o)}}var s="eui.UIComponent";t.formatRelative=e,t.measure=i,t.updateDisplayList=n}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.LEFT="left",t.JUSTIFY_USING_GAP="justifyUsingGap",t.JUSTIFY_USING_WIDTH="justifyUsingWidth",t}();t.ColumnAlign=e,egret.registerClass(e,"eui.ColumnAlign")}(eui||(eui={}));var eui;!function(t){var e=function(t){function e(){t.apply(this,arguments),this.$horizontalAlign="left",this.$verticalAlign="top",this.$gap=6,this.$paddingLeft=0,this.$paddingRight=0,this.$paddingTop=0,this.$paddingBottom=0,this.elementSizeTable=[],this.startIndex=-1,this.endIndex=-1,this.indexInViewCalculated=!1,this.maxElementSize=0}__extends(e,t);var i=__define,n=e,s=n.prototype;return i(s,"horizontalAlign",function(){return this.$horizontalAlign},function(t){this.$horizontalAlign!=t&&(this.$horizontalAlign=t,this.$target&&this.$target.invalidateDisplayList())}),i(s,"verticalAlign",function(){return this.$verticalAlign},function(t){this.$verticalAlign!=t&&(this.$verticalAlign=t,this.$target&&this.$target.invalidateDisplayList())}),i(s,"gap",function(){return this.$gap},function(t){t=+t||0,this.$gap!==t&&(this.$gap=t,this.invalidateTargetLayout())}),i(s,"paddingLeft",function(){return this.$paddingLeft},function(t){t=+t||0,this.$paddingLeft!==t&&(this.$paddingLeft=t,this.invalidateTargetLayout())}),i(s,"paddingRight",function(){return this.$paddingRight},function(t){t=+t||0,this.$paddingRight!==t&&(this.$paddingRight=t,this.invalidateTargetLayout())}),i(s,"paddingTop",function(){return this.$paddingTop},function(t){t=+t||0,this.$paddingTop!==t&&(this.$paddingTop=t,this.invalidateTargetLayout())}),i(s,"paddingBottom",function(){return this.$paddingBottom},function(t){t=+t||0,this.$paddingBottom!==t&&(this.$paddingBottom=t,this.invalidateTargetLayout())}),s.invalidateTargetLayout=function(){var t=this.$target;t&&(t.invalidateSize(),t.invalidateDisplayList())},s.measure=function(){this.$target&&(this.$useVirtualLayout?this.measureVirtual():this.measureReal())},s.measureReal=function(){},s.measureVirtual=function(){},s.updateDisplayList=function(t,e){var i=this.$target;if(i)return 0==i.numElements?void i.setContentSize(Math.ceil(this.$paddingLeft+this.$paddingRight),Math.ceil(this.$paddingTop+this.$paddingBottom)):void(this.$useVirtualLayout?this.updateDisplayListVirtual(t,e):this.updateDisplayListReal(t,e))},s.getStartPosition=function(t){return 0},s.getElementSize=function(t){return 0},s.getElementTotalSize=function(){return 0},s.elementRemoved=function(e){this.$useVirtualLayout&&(t.prototype.elementRemoved.call(this,e),this.elementSizeTable.splice(e,1))},s.clearVirtualLayoutCache=function(){this.$useVirtualLayout&&(this.elementSizeTable=[],this.maxElementSize=0)},s.findIndexAt=function(t,e,i){var n=.5*(e+i)|0,s=this.getStartPosition(n),r=this.getElementSize(n);return t>=s&&tt?this.findIndexAt(t,e,Math.max(e,n-1)):this.findIndexAt(t,Math.min(n+1,i),i)},s.scrollPositionChanged=function(){if(t.prototype.scrollPositionChanged.call(this),this.$useVirtualLayout){var e=this.getIndexInView();e&&(this.indexInViewCalculated=!0,this.target.invalidateDisplayList())}},s.getIndexInView=function(){return!1},s.updateDisplayListVirtual=function(t,e){},s.updateDisplayListReal=function(t,e){},s.flexChildrenProportionally=function(t,e,i,n){var s,r=n.length;do{s=!0;var a=e-t*i/100;a>0?e-=a:a=0;for(var o=e/i,h=0;r>h;h++){var l=n[h],u=l.percent*o;if(u=d?a-=d:(e-=d-a,a=0),s=!1;break}if(u>l.max){var c=l.max;l.size=c,n[h]=n[--r],n[r]=l,i-=l.percent,a>=c?a-=c:(e-=c-a,a=0),s=!1;break}l.size=u}}while(!s)},e}(t.LayoutBase);t.LinearLayoutBase=e,egret.registerClass(e,"eui.LinearLayoutBase")}(eui||(eui={}));var eui;!function(t){var e;!function(t){var e=function(){function t(){this.layoutElement=null,this.size=0,this.percent=0/0,this.min=0/0,this.max=0/0}var e=(__define,t);e.prototype;return t}();t.ChildInfo=e,egret.registerClass(e,"eui.sys.ChildInfo")}(e=t.sys||(t.sys={}))}(eui||(eui={}));var eui;!function(t){var e="eui.UIComponent",i=function(i){function n(){i.apply(this,arguments)}__extends(n,i);var s=(__define,n),r=s.prototype;return r.measureReal=function(){for(var t=this.$target,i=t.numElements,n=i,s=0,r=0,a=egret.$TempRectangle,o=0;i>o;o++){var h=t.getElementAt(o);egret.is(h,e)&&h.$includeInLayout?(h.getPreferredBounds(a),s+=a.width,r=Math.max(r,a.height)):n--}s+=(n-1)*this.$gap;var l=this.$paddingLeft+this.$paddingRight,u=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(s+l,r+u)},r.measureVirtual=function(){for(var t=this.$target,i=this.$typicalWidth,n=this.getElementTotalSize(),s=Math.max(this.maxElementSize,this.$typicalHeight),r=egret.$TempRectangle,a=this.endIndex,o=this.elementSizeTable,h=this.startIndex;a>h;h++){var l=t.getElementAt(h);egret.is(l,e)&&l.$includeInLayout&&(l.getPreferredBounds(r),n+=r.width,n-=isNaN(o[h])?i:o[h],s=Math.max(s,r.height))}var u=this.$paddingLeft+this.$paddingRight,d=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(n+u,s+d)},r.updateDisplayListReal=function(i,n){var s=this.$target,r=this.$paddingLeft,a=this.$paddingRight,o=this.$paddingTop,h=this.$paddingBottom,l=this.$gap,u=Math.max(0,i-r-a),d=Math.max(0,n-o-h),c=this.$horizontalAlign==t.JustifyAlign.JUSTIFY,p=this.$verticalAlign==t.JustifyAlign.JUSTIFY||this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;p||(this.$verticalAlign==egret.VerticalAlign.MIDDLE?v=.5:this.$verticalAlign==egret.VerticalAlign.BOTTOM&&(v=1));var f,g,m,y=s.numElements,C=y,$=r,E=o,_=0,T=0,I=[],x=u,S=this.maxElementSize,L=egret.$TempRectangle;for(f=0;y>f;f++){var g=s.getElementAt(f);if(egret.is(g,e)&&g.$includeInLayout)if(g.getPreferredBounds(L),S=Math.max(S,L.height),c)_+=L.width;else{var P=g.$UIComponent;isNaN(P[6])?x-=L.width:(T+=P[6],m=new t.sys.ChildInfo,m.layoutElement=g,m.percent=P[6],m.min=P[12],m.max=P[13],I.push(m))}else C--}x-=l*(C-1),x=x>0?x:0;var N,A=u-_-l*(C-1),b=C,R={};if(c){if(0>A){for(N=x/C,f=0;y>f;f++)g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout&&(g.getPreferredBounds(L),L.width<=N&&(x-=L.width,b--));x=x>0?x:0}}else if(T>0){this.flexChildrenProportionally(u,x,T,I); +var B=0,D=I.length;for(f=0;D>f;f++){m=I[f];var M=Math.round(m.size+B);B+=m.size-M,R[m.layoutElement.$hashCode]=M,x-=M}x=x>0?x:0}this.$horizontalAlign==egret.HorizontalAlign.CENTER?$=r+.5*x:this.$horizontalAlign==egret.HorizontalAlign.RIGHT&&($=r+x);var O=r,w=o,V=0,z=0,H=Math.ceil(d);this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY&&(H=Math.ceil(Math.max(d,S))),B=0;var U,k;for(f=0;y>f;f++){var G=0;if(g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout){if(g.getPreferredBounds(L),U=0/0,c?(k=0/0,A>0?k=x*L.width/_:0>A&&L.width>N&&(k=x/b),isNaN(k)||(U=Math.round(k+B),B+=k-U)):U=R[g.$hashCode],p)E=o,g.setLayoutBoundsSize(U,H),g.getLayoutBounds(L);else{var F=0/0,P=g.$UIComponent;if(!isNaN(g.percentHeight)){var W=Math.min(100,P[7]);F=Math.round(d*W*.01)}g.setLayoutBoundsSize(U,F),g.getLayoutBounds(L),G=(d-L.height)*v,G=G>0?G:0,E=o+G}g.setLayoutBoundsPosition(Math.round($),Math.round(E)),V=Math.ceil(L.width),z=Math.ceil(L.height),O=Math.max(O,$+V),w=Math.max(w,E+z),$+=V+l}}this.maxElementSize=S,s.setContentSize(O+a,w+h)},r.updateDisplayListVirtual=function(i,n){var s=this.$target;this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var r,a=this.$paddingRight,o=this.$paddingTop,h=this.$paddingBottom,l=this.$gap,u=s.numElements;if(-1==this.startIndex||-1==this.endIndex)return r=this.getStartPosition(u)-l+a,void s.setContentSize(r,s.contentHeight);var d=this.endIndex;s.setVirtualElementIndicesInView(this.startIndex,d);var c=this.$verticalAlign==t.JustifyAlign.JUSTIFY||this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY,p=this.$verticalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;c||(this.$verticalAlign==egret.VerticalAlign.MIDDLE?v=.5:this.$verticalAlign==egret.VerticalAlign.BOTTOM&&(v=1));var f,g=egret.$TempRectangle,m=Math.max(0,n-o-h),y=Math.ceil(m),C=this.$typicalHeight,$=this.$typicalWidth,E=this.maxElementSize,_=Math.max(C,this.maxElementSize);if(p){for(var T=this.startIndex;d>=T;T++)f=s.getVirtualElementAt(T),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),E=Math.max(E,g.height));y=Math.ceil(Math.max(m,E))}for(var I,x=0,S=0,L=0,P=!1,N=this.elementSizeTable,A=this.startIndex;d>=A;A++){var b=0;f=s.getVirtualElementAt(A),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),p||(E=Math.max(E,g.height)),c?(S=o,f.setLayoutBoundsSize(0/0,y),f.getLayoutBounds(g)):(f.getLayoutBounds(g),b=(m-g.height)*v,b=b>0?b:0,S=o+b),L=Math.max(L,g.height),P||(I=isNaN(N[A])?$:N[A],I!=g.width&&(P=!0)),N[A]=g.width,x=this.getStartPosition(A),f.setLayoutBoundsPosition(Math.round(x),Math.round(S)))}L+=o+h,r=this.getStartPosition(u)-l+a,this.maxElementSize=E,s.setContentSize(r,L),(P||_a;a++){var o=r[a];isNaN(o)&&(o=i),n+=o+s}return n},r.getElementSize=function(t){if(this.$useVirtualLayout){var e=this.elementSizeTable[t];return isNaN(e)&&(e=this.$typicalWidth),e}return this.$target?this.$target.getElementAt(t).width:0},r.getElementTotalSize=function(){for(var t=this.$typicalWidth,e=this.$gap,i=0,n=this.$target.numElements,s=this.elementSizeTable,r=0;n>r;r++){var a=s[r];isNaN(a)&&(a=t),i+=a+e}return i-=e},r.elementAdded=function(t){this.useVirtualLayout&&(i.prototype.elementAdded.call(this,t),this.elementSizeTable.splice(t,0,this.$typicalWidth))},r.getIndexInView=function(){var t=this.$target;if(!t||0==t.numElements)return this.startIndex=this.endIndex=-1,!1;var e=t.$UIComponent;if(e[10]<=0||e[11]<=0)return this.startIndex=this.endIndex=-1,!1;var i=t.numElements,n=this.getStartPosition(i-1)+this.elementSizeTable[i-1]+this.$paddingRight,s=t.scrollH;if(s>n-this.$paddingRight)return this.startIndex=-1,this.endIndex=-1,!1;var r=t.scrollH+e[10];if(r0?this._requestedColumnCount:this._columnCount,l=this._requestedRowCount>0?this._requestedRowCount:this._rowCount,u=isNaN(this._horizontalGap)?0:this._horizontalGap,d=isNaN(this._verticalGap)?0:this._verticalGap;h>0&&(r=h*(this._columnWidth+u)-u),l>0&&(a=l*(this._rowHeight+d)-d);var c=this._paddingLeft+this._paddingRight,p=this._paddingTop+this._paddingBottom;t.setMeasuredSize(r+c,a+p),this._columnCount=e,this._rowCount=i,this._columnWidth=n,this._rowHeight=s}},a.calculateRowAndColumn=function(i,n){var s=this.$target,r=isNaN(this._horizontalGap)?0:this._horizontalGap,a=isNaN(this._verticalGap)?0:this._verticalGap;this._rowCount=this._columnCount=-1;for(var o=s.numElements,h=o,l=0;h>l;l++){var u=s.getElementAt(l);!u||egret.is(u,e)&&u.$includeInLayout||o--}if(0==o)return void(this._rowCount=this._columnCount=0);(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;var d=this._columnWidth+r;0>=d&&(d=1);var c=this._rowHeight+a;0>=c&&(c=1);var p=this._orientation==t.TileOrientation.COLUMNS,v=!isNaN(i),f=!isNaN(n),g=this._paddingLeft,m=this._paddingRight,y=this._paddingTop,C=this._paddingBottom;if(this._requestedColumnCount>0||this._requestedRowCount>0)this._requestedRowCount>0&&(this._rowCount=Math.min(this._requestedRowCount,o)),this._requestedColumnCount>0&&(this._columnCount=Math.min(this._requestedColumnCount,o));else if(v||f)if(!v||f&&p){var $=Math.max(0,n-y-C);this._rowCount=Math.floor(($+a)/c),this._rowCount=Math.max(1,Math.min(this._rowCount,o))}else{var E=Math.max(0,i-g-m);this._columnCount=Math.floor((E+r)/d),this._columnCount=Math.max(1,Math.min(this._columnCount,o))}else{var _=Math.sqrt(o*d*c);p?this._rowCount=Math.max(1,Math.round(_/c)):this._columnCount=Math.max(1,Math.round(_/d))}-1==this._rowCount&&(this._rowCount=Math.max(1,Math.ceil(o/this._columnCount))),-1==this._columnCount&&(this._columnCount=Math.max(1,Math.ceil(o/this._rowCount))),this._requestedColumnCount>0&&this._requestedRowCount>0&&(this._orientation==t.TileOrientation.ROWS?this._rowCount=Math.max(1,Math.ceil(o/this._requestedColumnCount)):this._columnCount=Math.max(1,Math.ceil(o/this._requestedRowCount)))},a.updateMaxElementSize=function(){this.$target&&(this.$useVirtualLayout?(this.maxElementWidth=Math.max(this.maxElementWidth,this.$typicalWidth),this.maxElementHeight=Math.max(this.maxElementHeight,this.$typicalHeight),this.doUpdateMaxElementSize(this.startIndex,this.endIndex)):this.doUpdateMaxElementSize(0,this.$target.numElements-1))},a.doUpdateMaxElementSize=function(t,i){var n=this.maxElementWidth,s=this.maxElementHeight,r=egret.$TempRectangle,a=this.$target;if(-1!=t&&-1!=i)for(var o=t;i>=o;o++){var h=a.getVirtualElementAt(o);egret.is(h,e)&&h.$includeInLayout&&(h.getPreferredBounds(r),n=Math.max(n,r.width),s=Math.max(s,r.height))}this.maxElementWidth=n,this.maxElementHeight=s},a.clearVirtualLayoutCache=function(){i.prototype.clearVirtualLayoutCache.call(this),this.maxElementWidth=0,this.maxElementHeight=0},a.scrollPositionChanged=function(){if(this.$useVirtualLayout){var t=this.getIndexInView();t&&(this.indexInViewCalculated=!0,this.$target.invalidateDisplayList())}},a.getIndexInView=function(){if(!this.$target||0==this.$target.numElements)return this.startIndex=this.endIndex=-1,!1;var e=this.$target,i=e.numElements;if(!this.$useVirtualLayout)return this.startIndex=0,this.endIndex=i-1,!1;var n=e.$UIComponent;if(0==n[10]||0==n[11])return this.startIndex=this.endIndex=-1,!1;var s=this.startIndex,r=this.endIndex,a=this._paddingLeft,o=this._paddingTop,h=isNaN(this._horizontalGap)?0:this._horizontalGap,l=isNaN(this._verticalGap)?0:this._verticalGap;if(this._orientation==t.TileOrientation.COLUMNS){var u=this._columnWidth+h;if(0>=u)return this.startIndex=0,this.endIndex=i-1,!1;var d=e.scrollH,c=d+n[10],p=Math.floor((d-a)/u);0>p&&(p=0);var v=Math.ceil((c-a)/u);0>v&&(v=0),this.startIndex=Math.min(i-1,Math.max(0,p*this._rowCount)),this.endIndex=Math.min(i-1,Math.max(0,v*this._rowCount-1))}else{var f=this._rowHeight+l;if(0>=f)return this.startIndex=0,this.endIndex=i-1,!1;var g=e.scrollV,m=g+n[11],y=Math.floor((g-o)/f);0>y&&(y=0);var C=Math.ceil((m-o)/f);0>C&&(C=0),this.startIndex=Math.min(i-1,Math.max(0,y*this._columnCount)),this.endIndex=Math.min(i-1,Math.max(0,C*this._columnCount-1))}return this.startIndex!=s||this.endIndex!=r},a.updateDisplayList=function(n,s){if(i.prototype.updateDisplayList.call(this,n,s),this.$target){var r=this.$target,a=this._paddingLeft,o=this._paddingRight,h=this._paddingTop,l=this._paddingBottom;if(this.indexInViewCalculated)this.indexInViewCalculated=!1;else{if(this.calculateRowAndColumn(n,s),0==this._rowCount||0==this._columnCount)return void r.setContentSize(a+o,h+l);this.adjustForJustify(n,s),this.getIndexInView()}if(this.$useVirtualLayout&&(this.calculateRowAndColumn(n,s),this.adjustForJustify(n,s)),-1==this.startIndex||-1==this.endIndex)return void r.setContentSize(0,0);var u=this.endIndex;r.setVirtualElementIndicesInView(this.startIndex,u);for(var d,c,p,v,f,g=this._orientation==t.TileOrientation.COLUMNS,m=this.startIndex,y=isNaN(this._horizontalGap)?0:this._horizontalGap,C=isNaN(this._verticalGap)?0:this._verticalGap,$=this._rowCount,E=this._columnCount,_=this._columnWidth,T=this._rowHeight,I=this.startIndex;u>=I;I++)d=this.$useVirtualLayout?this.target.getVirtualElementAt(I):this.target.getElementAt(I),egret.is(d,e)&&d.$includeInLayout&&(g?(v=Math.ceil((m+1)/$)-1,f=Math.ceil((m+1)%$)-1,-1==f&&(f=$-1)):(v=Math.ceil((m+1)%E)-1,-1==v&&(v=E-1),f=Math.ceil((m+1)/E)-1),c=v*(_+y)+a,p=f*(T+C)+h,this.sizeAndPositionElement(d,c,p,_,T),m++);var x=a+o,S=h+l,L=(_+y)*E-y,P=(T+C)*$-C;r.setContentSize(L+x,P+S)}},a.sizeAndPositionElement=function(e,i,n,s,r){var a=0/0,o=0/0,h=e.$UIComponent;this._horizontalAlign==t.JustifyAlign.JUSTIFY?a=s:isNaN(h[6])||(a=s*h[6]*.01),this._verticalAlign==t.JustifyAlign.JUSTIFY?o=r:isNaN(h[7])||(o=r*h[7]*.01),e.setLayoutBoundsSize(Math.round(a),Math.round(o));var l=i,u=egret.$TempRectangle;switch(e.getLayoutBounds(u),this._horizontalAlign){case egret.HorizontalAlign.RIGHT:l+=s-u.width;break;case egret.HorizontalAlign.CENTER:l=i+(s-u.width)/2}var d=n;switch(this._verticalAlign){case egret.VerticalAlign.BOTTOM:d+=r-u.height;break;case egret.VerticalAlign.MIDDLE:d+=(r-u.height)/2}e.setLayoutBoundsPosition(Math.round(l),Math.round(d))},a.adjustForJustify=function(e,i){var n=this._paddingLeft,s=this._paddingRight,r=this._paddingTop,a=this._paddingBottom,o=Math.max(0,e-n-s),h=Math.max(0,i-r-a);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;var l,u=h-this._rowHeight*this._rowCount,d=o-this._columnWidth*this._columnCount;u>0&&(this._rowAlign==t.RowAlign.JUSTIFY_USING_GAP?(l=Math.max(1,this._rowCount-1),this._verticalGap=u/l):this._rowAlign==t.RowAlign.JUSTIFY_USING_HEIGHT&&this._rowCount>0&&(this._rowHeight+=(u-(this._rowCount-1)*this._verticalGap)/this._rowCount)),d>0&&(this._columnAlign==t.ColumnAlign.JUSTIFY_USING_GAP?(l=Math.max(1,this._columnCount-1),this._horizontalGap=d/l):this._columnAlign==t.ColumnAlign.JUSTIFY_USING_WIDTH&&this._columnCount>0&&(this._columnWidth+=(d-(this._columnCount-1)*this._horizontalGap)/this._columnCount))},n}(t.LayoutBase);t.TileLayout=i,egret.registerClass(i,"eui.TileLayout")}(eui||(eui={}));var eui;!function(t){var e=function(){function t(){}var e=(__define,t);e.prototype;return t.ROWS="rows",t.COLUMNS="columns",t}();t.TileOrientation=e,egret.registerClass(e,"eui.TileOrientation")}(eui||(eui={}));var eui;!function(t){var e="eui.UIComponent",i=function(i){function n(){i.apply(this,arguments)}__extends(n,i);var s=(__define,n),r=s.prototype;return r.measureReal=function(){for(var t=this.$target,i=t.numElements,n=i,s=0,r=0,a=egret.$TempRectangle,o=0;i>o;o++){var h=t.getElementAt(o);egret.is(h,e)&&h.$includeInLayout?(h.getPreferredBounds(a),r+=a.height,s=Math.max(s,a.width)):n--}r+=(n-1)*this.$gap;var l=this.$paddingLeft+this.$paddingRight,u=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(s+l,r+u)},r.measureVirtual=function(){for(var t=this.$target,i=this.$typicalHeight,n=this.getElementTotalSize(),s=Math.max(this.maxElementSize,this.$typicalWidth),r=egret.$TempRectangle,a=this.endIndex,o=this.elementSizeTable,h=this.startIndex;a>h;h++){var l=t.getElementAt(h);egret.is(l,e)&&l.$includeInLayout&&(l.getPreferredBounds(r),n+=r.height,n-=isNaN(o[h])?i:o[h],s=Math.max(s,r.width))}var u=this.$paddingLeft+this.$paddingRight,d=this.$paddingTop+this.$paddingBottom;t.setMeasuredSize(s+u,n+d)},r.updateDisplayListReal=function(i,n){var s=this.$target,r=this.$paddingLeft,a=this.$paddingRight,o=this.$paddingTop,h=this.$paddingBottom,l=this.$gap,u=Math.max(0,i-r-a),d=Math.max(0,n-o-h),c=this.$verticalAlign==t.JustifyAlign.JUSTIFY,p=this.$horizontalAlign==t.JustifyAlign.JUSTIFY||this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;p||(this.$horizontalAlign==egret.HorizontalAlign.CENTER?v=.5:this.$horizontalAlign==egret.HorizontalAlign.RIGHT&&(v=1));var f,g,m,y=s.numElements,C=y,$=r,E=o,_=0,T=0,I=[],x=d,S=this.maxElementSize,L=egret.$TempRectangle;for(f=0;y>f;f++){var g=s.getElementAt(f);if(egret.is(g,e)&&g.$includeInLayout)if(g.getPreferredBounds(L),S=Math.max(S,L.width),c)_+=L.height;else{var P=g.$UIComponent;isNaN(P[7])?x-=L.height:(T+=P[7],m=new t.sys.ChildInfo,m.layoutElement=g,m.percent=P[7],m.min=P[14],m.max=P[15],I.push(m))}else C--}x-=l*(C-1),x=x>0?x:0;var N,A=d-_-l*(C-1),b=C,R={};if(c){if(0>A){for(N=x/C,f=0;y>f;f++)g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout&&(g.getPreferredBounds(L),L.height<=N&&(x-=L.height,b--));x=x>0?x:0}}else if(T>0){this.flexChildrenProportionally(d,x,T,I);var B=0,D=I.length;for(f=0;D>f;f++){m=I[f];var M=Math.round(m.size+B);B+=m.size-M,R[m.layoutElement.$hashCode]=M,x-=M}x=x>0?x:0}this.$verticalAlign==egret.VerticalAlign.MIDDLE?E=o+.5*x:this.$verticalAlign==egret.VerticalAlign.BOTTOM&&(E=o+x);var O=r,w=o,V=0,z=0,H=Math.ceil(u);this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY&&(H=Math.ceil(Math.max(u,S))),B=0;var U,k;for(f=0;y>f;f++){var G=0;if(g=s.getElementAt(f),egret.is(g,e)&&g.$includeInLayout){if(g.getPreferredBounds(L),U=0/0,c?(k=0/0,A>0?k=x*L.height/_:0>A&&L.height>N&&(k=x/b),isNaN(k)||(U=Math.round(k+B),B+=k-U)):U=R[g.$hashCode],p)$=r,g.setLayoutBoundsSize(H,U),g.getLayoutBounds(L);else{var F=0/0,P=g.$UIComponent;if(!isNaN(P[6])){var W=Math.min(100,P[6]);F=Math.round(u*W*.01)}g.setLayoutBoundsSize(F,U),g.getLayoutBounds(L),G=(u-L.width)*v,G=G>0?G:0,$=r+G}g.setLayoutBoundsPosition(Math.round($),Math.round(E)),V=Math.ceil(L.width),z=Math.ceil(L.height),O=Math.max(O,$+V),w=Math.max(w,E+z),E+=z+l}}this.maxElementSize=S,s.setContentSize(O+a,w+h)},r.updateDisplayListVirtual=function(i,n){var s=this.$target;this.indexInViewCalculated?this.indexInViewCalculated=!1:this.getIndexInView();var r,a=this.$paddingBottom,o=this.$paddingLeft,h=this.$paddingRight,l=this.$gap,u=s.numElements;if(-1==this.startIndex||-1==this.endIndex)return r=this.getStartPosition(u)-l+a,void s.setContentSize(s.contentWidth,r);var d=this.endIndex;s.setVirtualElementIndicesInView(this.startIndex,d);var c=this.$horizontalAlign==t.JustifyAlign.JUSTIFY||this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY,p=this.$horizontalAlign==t.JustifyAlign.CONTENT_JUSTIFY,v=0;c||(this.$horizontalAlign==egret.HorizontalAlign.CENTER?v=.5:this.$horizontalAlign==egret.HorizontalAlign.RIGHT&&(v=1));var f,g=egret.$TempRectangle,m=Math.max(0,i-o-h),y=Math.ceil(m),C=this.$typicalHeight,$=this.$typicalWidth,E=this.maxElementSize,_=Math.max($,this.maxElementSize);if(p){for(var T=this.startIndex;d>=T;T++)f=s.getVirtualElementAt(T),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),E=Math.max(E,g.width));y=Math.ceil(Math.max(m,E))}for(var I,x=0,S=0,L=0,P=!1,N=this.elementSizeTable,A=this.startIndex;d>=A;A++){var b=0;f=s.getVirtualElementAt(A),egret.is(f,e)&&f.$includeInLayout&&(f.getPreferredBounds(g),p||(E=Math.max(E,g.width)),c?(x=o,f.setLayoutBoundsSize(y,0/0),f.getLayoutBounds(g)):(f.getLayoutBounds(g),b=(m-g.width)*v,b=b>0?b:0,x=o+b),L=Math.max(L,g.width),P||(I=isNaN(N[A])?C:N[A],I!=g.height&&(P=!0)),N[A]=g.height,S=this.getStartPosition(A),f.setLayoutBoundsPosition(Math.round(x),Math.round(S)))}L+=o+h,r=this.getStartPosition(u)-l+a,this.maxElementSize=E,s.setContentSize(L,r),(P||_a;a++){var o=r[a];isNaN(o)&&(o=i),n+=o+s}return n},r.getElementSize=function(t){if(this.$useVirtualLayout){var e=this.elementSizeTable[t];return isNaN(e)&&(e=this.$typicalHeight),e}return this.$target?this.$target.getElementAt(t).height:0},r.getElementTotalSize=function(){for(var t=this.$typicalHeight,e=this.$gap,i=0,n=this.$target.numElements,s=this.elementSizeTable,r=0;n>r;r++){var a=s[r];isNaN(a)&&(a=t),i+=a+e}return i-=e},r.elementAdded=function(t){this.$useVirtualLayout&&(i.prototype.elementAdded.call(this,t),this.elementSizeTable.splice(t,0,this.$typicalHeight))},r.getIndexInView=function(){var t=this.$target;if(!t||0==t.numElements)return this.startIndex=this.endIndex=-1,!1;var e=t.$UIComponent;if(0==e[10]||0==e[11])return this.startIndex=this.endIndex=-1,!1;var i=t.numElements,n=this.getStartPosition(i-1)+this.elementSizeTable[i-1]+this.$paddingBottom,s=t.scrollV;if(s>n-this.$paddingBottom)return this.startIndex=-1,this.endIndex=-1,!1;var r=t.scrollV+e[11];if(r-1&&s.splice(r,1)}},t}();t.AddItems=e,egret.registerClass(e,"eui.AddItems",["eui.IOverride"])}(eui||(eui={}));var eui;!function(t){var e=function(){function t(t,e,i){this.target=t,this.name=e,this.value=i}var e=(__define,t),i=e.prototype;return i.apply=function(t,e){var i=this.target?t[this.target]:t;i&&(this.oldValue=i[this.name],this.setPropertyValue(i,this.name,this.value,this.oldValue))},i.remove=function(t,e){var i=this.target?t[this.target]:t;i&&(this.setPropertyValue(i,this.name,this.oldValue,this.oldValue),this.oldValue=null)},i.setPropertyValue=function(t,e,i,n){void 0===i||null===i?t[e]=i:"number"==typeof n?t[e]=+i:"boolean"==typeof n?t[e]=this.toBoolean(i):t[e]=i},i.toBoolean=function(t){return"string"==typeof t?"true"==t.toLowerCase():0!=t},t}();t.SetProperty=e,egret.registerClass(e,"eui.SetProperty",["eui.IOverride"])}(eui||(eui={}));var eui;!function(t){var e=function(){function e(t,e,i,n,s){this.host=t,this.templates=e,this.chainIndex=i,this.target=n,this.prop=s}var i=(__define,e),n=i.prototype;return n.apply=function(e,i){if(this.target){var n=this.target[this.prop];this.oldValue&&this.setPropertyValue(this.target,this.prop,this.oldValue,this.oldValue),n&&(this.oldValue=n),t.Binding.$bindProperties(this.host,this.templates.concat(),this.chainIndex.concat(),this.target,this.prop)}},n.remove=function(t,e){if(this.target){var i=this.oldValue;this.target[this.prop]&&(this.oldValue=this.target[this.prop]),i&&this.setPropertyValue(this.target,this.prop,i,i)}},n.setPropertyValue=function(t,e,i,n){void 0===i||null===i?t[e]=i:"number"==typeof n?t[e]=+i:"boolean"==typeof n?t[e]=this.toBoolean(i):t[e]=i},n.toBoolean=function(t){return"string"==typeof t?"true"==t.toLowerCase():0!=t},e}();t.SetStateProperty=e,egret.registerClass(e,"eui.SetStateProperty",["eui.IOverride"])}(eui||(eui={}));var eui;!function(t){var e;!function(t){function e(t,e,i,n,r,a,o,h,l,u){var d;if(!isNaN(i)&&isNaN(n)){if(d=s(t,e,i,a,i,h,i,u))return d}else if(isNaN(i)&&!isNaN(n)&&(d=s(t,e,r,n,o,n,l,n)))return d;return d=s(t,e,r,a,o,h,l,u)}function i(t,e,i,s,r,a,o,h,l,u){var d;if(!isNaN(i)&&isNaN(s)){if(d=n(t,e,i,a,i,h,i,u))return d}else if(isNaN(i)&&!isNaN(s)&&(d=n(t,e,r,s,o,s,l,s)))return d;return d=n(t,e,r,a,o,h,l,u)}function n(t,e,i,n,s,a,h,l){var u=e.b,d=e.d;if(u>-1e-9&&1e-9>u&&(u=0),d>-1e-9&&1e-9>d&&(d=0),0==u&&0==d)return null;if(0==u&&0==d)return null;if(0==u)return egret.Point.create(i,t/Math.abs(d));if(0==d)return egret.Point.create(t/Math.abs(u),n);var c,p,v,f=u*d>=0?d:-d;if(0!=f&&i>0){var g=1/f;i=Math.max(s,Math.min(h,i)),p=i,v=(t-u*p)*g,v>=a&&l>=v&&u*p+f*v>=0&&(c=egret.Point.create(p,v)),v=(-t-u*p)*g,v>=a&&l>=v&&0>u*p+f*v&&(!c||o(c.x,c.y,e).width>o(p,v,e).width)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(0!=u&&n>0){var m=1/u;n=Math.max(a,Math.min(l,n)),v=n,p=(t-f*v)*m,p>=s&&h>=p&&u*p+f*v>=0&&(!c||o(c.x,c.y,e).width>o(p,v,e).width)&&(c=egret.Point.create(p,v)),p=(-t-f*v)*m,p>=s&&h>=p&&0>u*p+f*v&&(!c||o(c.x,c.y,e).width>o(p,v,e).width)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(c)return c;var y=e.a,C=e.c,$=y*C>=0?C:-C;return r(u,f,t,s,a,h,l,y,$)}function s(t,e,i,n,s,a,h,l){var u=e.a,d=e.c;if(u>-1e-9&&1e-9>u&&(u=0),d>-1e-9&&1e-9>d&&(d=0),0==u&&0==d)return null;if(0==u)return egret.Point.create(i,t/Math.abs(d));if(0==d)return egret.Point.create(t/Math.abs(u),n);var c,p,v,f=u*d>=0?d:-d;if(0!=f&&i>0){var g=1/f;i=Math.max(s,Math.min(h,i)),p=i,v=(t-u*p)*g,v>=a&&l>=v&&u*p+f*v>=0&&(c=egret.Point.create(p,v)),v=(-t-u*p)*g,v>=a&&l>=v&&0>u*p+f*v&&(!c||o(c.x,c.y,e).height>o(p,v,e).height)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(0!=u&&n>0){var m=1/u;n=Math.max(a,Math.min(l,n)),v=n,p=(t-f*v)*m,p>=s&&h>=p&&u*p+f*v>=0&&(!c||o(c.x,c.y,e).height>o(p,v,e).height)&&(egret.Point.release(c),c=egret.Point.create(p,v)),p=(-t-f*v)*m,p>=s&&h>=p&&0>u*p+f*v&&(!c||o(c.x,c.y,e).height>o(p,v,e).height)&&(egret.Point.release(c),c=egret.Point.create(p,v))}if(c)return c;var y=e.b,C=e.d,$=y*C>=0?C:-C;return r(u,f,t,s,a,h,l,y,$)}function r(t,e,i,n,s,r,a,o,h){if(0==t||0==e)return null;var l,u,d=(i-n*t)/e,c=(i-r*t)/e,p=Math.max(s,Math.min(d,c)),v=Math.min(a,Math.max(d,c)),f=o*e-t*h;return v>=p?(u=Math.abs(f)<1e-9?i/(t+e):o*i/f,u=Math.max(p,Math.min(u,v)),l=(i-e*u)/t,egret.Point.create(l,u)):(d=-(n*t+i)/e,c=-(r*t+i)/e,p=Math.max(s,Math.min(d,c)),v=Math.min(a,Math.max(d,c)),v>=p?(u=Math.abs(f)<1e-9?-i/(t+e):-o*i/f,u=Math.max(p,Math.min(u,v)),l=(-i-e*u)/t,egret.Point.create(l,u)):null)}function a(t,e,i,n,s,a,o){var l=i.a,u=i.b,d=i.c,c=i.d;if(l>-1e-9&&1e-9>l&&(l=0),u>-1e-9&&1e-9>u&&(u=0),d>-1e-9&&1e-9>d&&(d=0),c>-1e-9&&1e-9>c&&(c=0),0==u&&0==d)return 0==l||0==c?null:egret.Point.create(t/Math.abs(l),e/Math.abs(c));if(0==l&&0==c)return 0==u||0==d?null:egret.Point.create(e/Math.abs(u),t/Math.abs(d));var p=l*d>=0?d:-d,v=u*c>=0?c:-c,f=l*v-u*p;if(Math.abs(f)<1e-9)return 0==p||0==l||l==-p?null:Math.abs(l*e-u*t)>1e-9?null:r(l,p,t,n,n,a,o,u,v);var g=1/f;t*=g,e*=g;var m;return m=h(l,p,u,v,t,e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x>=0&&u*m.x+v*m.y>=0?m:(m=h(l,p,u,v,t,-e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x>=0&&u*m.x+v*m.y<0?m:(m=h(l,p,u,v,-t,e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x<0&&u*m.x+v*m.y>=0?m:(m=h(l,p,u,v,-t,-e),m&&n<=m.x&&m.x<=a&&s<=m.y&&m.y<=o&&l*m.x+p*m.x<0&&u*m.x+v*m.y<0?m:(egret.Point.release(m),null))))}function o(t,e,i){var n=egret.$TempRectangle.setTo(0,0,t,e);return i.$transformBounds(n),n}function h(t,e,i,n,s,r){return egret.Point.create(n*s-e*r,t*r-i*s)}var l=.1,u=.1,d=function(){function t(){}var n=(__define,t);n.prototype;return t.fitBounds=function(t,n,s,r,h,d,c,p,v,f,g){if(isNaN(t)&&isNaN(n))return egret.Point.create(d,c);var m,y=u>p?0:p-u,C=u>v?0:v-u,$=f+u,E=g+u;if(isNaN(t)||isNaN(n))return isNaN(t)?i(n,s,r,h,d,c,y,C,$,E):e(t,s,r,h,d,c,y,C,$,E);if(m=a(t,n,s,y,C,$,E),!m){var _;if(_=e(t,s,r,h,d,c,y,C,$,E)){var T=o(_.x,_.y,s).height;T-l>n&&(egret.Point.release(_),_=null)}var I;if(I=i(n,s,r,h,d,c,y,C,$,E)){var x=o(I.x,I.y,s).width;x-l>t&&(egret.Point.release(I),I=null)}m=_&&I?_.x*_.y>I.x*I.y?_:I:_?_:I,egret.Point.release(_),egret.Point.release(I)}return m},t}();t.MatrixUtil=d,egret.registerClass(d,"eui.sys.MatrixUtil")}(e=t.sys||(t.sys={}))}(eui||(eui={})); \ No newline at end of file diff --git a/src/extension/eui/components/BitmapLabel.ts b/src/extension/eui/components/BitmapLabel.ts index 091f356323..f41baf553a 100644 --- a/src/extension/eui/components/BitmapLabel.ts +++ b/src/extension/eui/components/BitmapLabel.ts @@ -256,7 +256,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public left: number; + public left: number|string; /** * @copy eui.UIComponent#right @@ -265,7 +265,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public right: number; + public right: number|string; /** * @copy eui.UIComponent#top @@ -274,7 +274,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public top: number; + public top: number|string; /** * @copy eui.UIComponent#bottom @@ -283,7 +283,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public bottom: number; + public bottom: number|string; /** * @copy eui.UIComponent#horizontalCenter @@ -292,7 +292,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public horizontalCenter: number; + public horizontalCenter: number|string; /** * @copy eui.UIComponent#verticalCenter @@ -301,7 +301,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public verticalCenter: number; + public verticalCenter: number|string; /** * @copy eui.UIComponent#percentWidth diff --git a/src/extension/eui/components/Component.ts b/src/extension/eui/components/Component.ts index 63f281553b..6e16e74e4b 100644 --- a/src/extension/eui/components/Component.ts +++ b/src/extension/eui/components/Component.ts @@ -776,7 +776,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public left:number; + public left:number|string; /** * @inheritDoc @@ -785,7 +785,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public right:number; + public right:number|string; /** * @inheritDoc @@ -794,7 +794,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public top:number; + public top:number|string; /** * @inheritDoc @@ -803,7 +803,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public bottom:number; + public bottom:number|string; /** * @inheritDoc @@ -812,7 +812,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public horizontalCenter:number; + public horizontalCenter:number|string; /** * @inheritDoc @@ -821,7 +821,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public verticalCenter:number; + public verticalCenter:number|string; /** * @inheritDoc diff --git a/src/extension/eui/components/EditableText.ts b/src/extension/eui/components/EditableText.ts index a404983691..377e15d3c0 100644 --- a/src/extension/eui/components/EditableText.ts +++ b/src/extension/eui/components/EditableText.ts @@ -413,7 +413,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public left: number; + public left: number|string; /** * @inheritDoc @@ -422,7 +422,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public right: number; + public right: number|string; /** * @inheritDoc @@ -431,7 +431,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public top: number; + public top: number|string; /** * @inheritDoc @@ -440,7 +440,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public bottom: number; + public bottom: number|string; /** * @inheritDoc @@ -449,7 +449,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public horizontalCenter: number; + public horizontalCenter: number|string; /** * @inheritDoc @@ -458,7 +458,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public verticalCenter: number; + public verticalCenter: number|string; /** * @inheritDoc diff --git a/src/extension/eui/components/Group.ts b/src/extension/eui/components/Group.ts index 0ff8a05c26..dc335050cd 100755 --- a/src/extension/eui/components/Group.ts +++ b/src/extension/eui/components/Group.ts @@ -659,7 +659,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public left:number; + public left:number|string; /** * @inheritDoc @@ -668,7 +668,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public right:number; + public right:number|string; /** * @inheritDoc @@ -677,7 +677,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public top:number; + public top:number|string; /** * @inheritDoc @@ -686,7 +686,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public bottom:number; + public bottom:number|string; /** * @inheritDoc @@ -695,7 +695,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public horizontalCenter:number; + public horizontalCenter:number|string; /** * @inheritDoc @@ -704,7 +704,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public verticalCenter:number; + public verticalCenter:number|string; /** * @inheritDoc diff --git a/src/extension/eui/components/Image.ts b/src/extension/eui/components/Image.ts index 4db0aaaae8..874d47bf77 100644 --- a/src/extension/eui/components/Image.ts +++ b/src/extension/eui/components/Image.ts @@ -423,7 +423,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public left:number; + public left:number|string; /** * @copy eui.UIComponent#right @@ -432,7 +432,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public right:number; + public right:number|string; /** * @copy eui.UIComponent#top @@ -441,7 +441,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public top:number; + public top:number|string; /** * @copy eui.UIComponent#bottom @@ -450,7 +450,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public bottom:number; + public bottom:number|string; /** * @copy eui.UIComponent#horizontalCenter @@ -459,7 +459,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public horizontalCenter:number; + public horizontalCenter:number|string; /** * @copy eui.UIComponent#verticalCenter @@ -468,7 +468,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public verticalCenter:number; + public verticalCenter:number|string; /** * @copy eui.UIComponent#percentWidth diff --git a/src/extension/eui/components/Label.ts b/src/extension/eui/components/Label.ts index 2201bdebab..8031e94798 100644 --- a/src/extension/eui/components/Label.ts +++ b/src/extension/eui/components/Label.ts @@ -266,7 +266,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public left:number; + public left:number|string; /** * @copy eui.UIComponent#right @@ -275,7 +275,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public right:number; + public right:number|string; /** * @copy eui.UIComponent#top @@ -284,7 +284,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public top:number; + public top:number|string; /** * @copy eui.UIComponent#bottom @@ -293,7 +293,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public bottom:number; + public bottom:number|string; /** * @copy eui.UIComponent#horizontalCenter @@ -302,7 +302,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public horizontalCenter:number; + public horizontalCenter:number|string; /** * @copy eui.UIComponent#verticalCenter @@ -311,7 +311,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - public verticalCenter:number; + public verticalCenter:number|string; /** * @copy eui.UIComponent#percentWidth diff --git a/src/extension/eui/core/UIComponent.ts b/src/extension/eui/core/UIComponent.ts index 9e260a064d..ef2ebf482f 100644 --- a/src/extension/eui/core/UIComponent.ts +++ b/src/extension/eui/core/UIComponent.ts @@ -149,7 +149,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - left:number; + left:number|string; /** * @language en_US @@ -172,7 +172,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - right:number; + right:number|string; /** * @language en_US @@ -195,7 +195,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - top:number; + top:number|string; /** * @language en_US @@ -218,7 +218,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - bottom:number; + bottom:number|string; /** * @language en_US @@ -241,7 +241,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - horizontalCenter:number; + horizontalCenter:number|string; /** * @language en_US @@ -264,7 +264,7 @@ module eui { * @version eui 1.0 * @platform Web,Native */ - verticalCenter:number; + verticalCenter:number|string; /** * @language en_US @@ -997,12 +997,18 @@ module eui.sys { * @private * 距父级容器离左边距离 */ - public get left():number { + public get left():number|string { return this.$UIComponent[UIKeys.left]; } - public set left(value:number) { - value = +value; + public set left(value:number|string) { + if(!value||typeof value=="number"){ + value = +value; + } + else{ + value = value.toString().trim(); + } + var values = this.$UIComponent; if (values[UIKeys.left] === value) return; @@ -1014,12 +1020,17 @@ module eui.sys { * @private * 距父级容器右边距离 */ - public get right():number { + public get right():number|string { return this.$UIComponent[UIKeys.right]; } - public set right(value:number) { - value = +value; + public set right(value:number|string) { + if(!value||typeof value=="number"){ + value = +value; + } + else{ + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[UIKeys.right] === value) return; @@ -1031,12 +1042,17 @@ module eui.sys { * @private * 距父级容器顶部距离 */ - public get top():number { + public get top():number|string { return this.$UIComponent[UIKeys.top]; } - public set top(value:number) { - value = +value; + public set top(value:number|string) { + if(!value||typeof value=="number"){ + value = +value; + } + else{ + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[UIKeys.top] === value) return; @@ -1048,12 +1064,17 @@ module eui.sys { * @private * 距父级容器底部距离 */ - public get bottom():number { + public get bottom():number|string { return this.$UIComponent[UIKeys.bottom]; } - public set bottom(value:number) { - value = +value; + public set bottom(value:number|string) { + if(!value||typeof value=="number"){ + value = +value; + } + else{ + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[UIKeys.bottom] == value) return; @@ -1066,12 +1087,17 @@ module eui.sys { * @private * 在父级容器中距水平中心位置的距离 */ - public get horizontalCenter():number { + public get horizontalCenter():number|string { return this.$UIComponent[UIKeys.horizontalCenter]; } - public set horizontalCenter(value:number) { - value = +value; + public set horizontalCenter(value:number|string) { + if(!value||typeof value=="number"){ + value = +value; + } + else{ + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[UIKeys.horizontalCenter] === value) return; @@ -1083,12 +1109,17 @@ module eui.sys { * @private * 在父级容器中距竖直中心位置的距离 */ - public get verticalCenter():number { + public get verticalCenter():number|string { return this.$UIComponent[UIKeys.verticalCenter]; } - public set verticalCenter(value:number) { - value = +value; + public set verticalCenter(value:number|string) { + if(!value||typeof value=="number"){ + value = +value; + } + else{ + value = value.toString().trim(); + } var values = this.$UIComponent; if (values[UIKeys.verticalCenter] === value) return; diff --git a/src/extension/eui/layouts/BasicLayout.ts b/src/extension/eui/layouts/BasicLayout.ts index 81a2c597a0..00cc1215ce 100644 --- a/src/extension/eui/layouts/BasicLayout.ts +++ b/src/extension/eui/layouts/BasicLayout.ts @@ -115,7 +115,7 @@ module eui { public updateDisplayList(unscaledWidth:number, unscaledHeight:number):void { super.updateDisplayList(unscaledWidth, unscaledHeight); var target = this.$target; - var pos = sys.updateDisplayList(target,unscaledWidth,unscaledHeight); + var pos = sys.updateDisplayList(target, unscaledWidth, unscaledHeight); target.setContentSize(Math.ceil(pos.x), Math.ceil(pos.y)); } } @@ -141,12 +141,30 @@ module eui.sys { var UIComponentClass = "eui.UIComponent"; + /** + * @private + * @param value 要格式化的相对值 + * @param total 在此值方向上的总长度 + */ + function formatRelative(value:number|string, total:number):number { + if (!value || typeof value == "number") { + return value; + } + var str = value; + var index = str.indexOf("%"); + if (index == -1) { + return +str; + } + var percent = +str.substring(0, index); + return percent * 0.01 * total; + } + /** * @private * 一个工具方法,使用BasicLayout规则测量目标对象。 */ - export function measure(target:eui.Group|eui.Component):void{ - if(!target){ + export function measure(target:eui.Group|eui.Component):void { + if (!target) { return; } var width = 0; @@ -155,17 +173,17 @@ module eui.sys { var count = target.numChildren; for (var i = 0; i < count; i++) { var layoutElement = (target.getChildAt(i)); - if (!egret.is(layoutElement,UIComponentClass) || !layoutElement.$includeInLayout) { + if (!egret.is(layoutElement, UIComponentClass) || !layoutElement.$includeInLayout) { continue; } var values = layoutElement.$UIComponent; - var hCenter = values[sys.UIKeys.horizontalCenter]; - var vCenter = values[sys.UIKeys.verticalCenter]; - var left = values[sys.UIKeys.left]; - var right = values[sys.UIKeys.right]; - var top = values[sys.UIKeys.top]; - var bottom = values[sys.UIKeys.bottom]; + var hCenter = +values[sys.UIKeys.horizontalCenter]; + var vCenter = +values[sys.UIKeys.verticalCenter]; + var left = +values[sys.UIKeys.left]; + var right = +values[sys.UIKeys.right]; + var top = +values[sys.UIKeys.top]; + var bottom = +values[sys.UIKeys.bottom]; var extX:number; var extY:number; @@ -206,7 +224,7 @@ module eui.sys { height = Math.ceil(Math.max(height, extY + preferredHeight)); } - target.setMeasuredSize(width,height); + target.setMeasuredSize(width, height); } /** @@ -214,7 +232,7 @@ module eui.sys { * 一个工具方法,使用BasicLayout规则布局目标对象。 */ export function updateDisplayList(target:eui.Group|eui.Component, - unscaledWidth:number, unscaledHeight:number):egret.Point{ + unscaledWidth:number, unscaledHeight:number):egret.Point { if (!target) return; @@ -225,17 +243,17 @@ module eui.sys { var bounds = egret.$TempRectangle; for (var i = 0; i < count; i++) { var layoutElement = (target.getChildAt(i)); - if (!egret.is(layoutElement,UIComponentClass) || !layoutElement.$includeInLayout) { + if (!egret.is(layoutElement, UIComponentClass) || !layoutElement.$includeInLayout) { continue; } var values = layoutElement.$UIComponent; - var hCenter = values[sys.UIKeys.horizontalCenter]; - var vCenter = values[sys.UIKeys.verticalCenter]; - var left = values[sys.UIKeys.left]; - var right = values[sys.UIKeys.right]; - var top = values[sys.UIKeys.top]; - var bottom = values[sys.UIKeys.bottom]; + var hCenter = formatRelative(values[sys.UIKeys.horizontalCenter], unscaledWidth); + var vCenter = formatRelative(values[sys.UIKeys.verticalCenter], unscaledHeight); + var left = formatRelative(values[sys.UIKeys.left], unscaledWidth); + var right = formatRelative(values[sys.UIKeys.right], unscaledWidth); + var top = formatRelative(values[sys.UIKeys.top], unscaledHeight); + var bottom = formatRelative(values[sys.UIKeys.bottom], unscaledHeight); var percentWidth = values[sys.UIKeys.percentWidth]; var percentHeight = values[sys.UIKeys.percentHeight]; @@ -288,6 +306,6 @@ module eui.sys { maxX = Math.max(maxX, childX + elementWidth); maxY = Math.max(maxY, childY + elementHeight); } - return egret.$TempPoint.setTo(maxX,maxY); + return egret.$TempPoint.setTo(maxX, maxY); } } \ No newline at end of file