1 line
350 KiB
JavaScript
1 line
350 KiB
JavaScript
window.fgui={},window.fairygui=window.fgui,window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,r){function s(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){t.done?o(t.value):new i(function(e){e(t.value)}).then(s,a)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,n=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],n=0}finally{i=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}};!function(t){var e=function(){function e(){this._itemList=new Array,this._objectPool=new Array}return e.prototype.createObject=function(e,i){var n=t.UIPackage.getByName(e);if(!n)throw new Error("package not found: "+e);var o=n.getItemByName(i);if(!o)throw new Error("resource not found: "+i);this.internalCreateObject(o)},e.prototype.createObjectFromURL=function(e){var i=t.UIPackage.getItemByURL(e);if(!i)throw new Error("resource not found: "+e);this.internalCreateObject(i)},e.prototype.cancel=function(){t.GTimers.inst.remove(this.run,this),this._itemList.length=0;var e=this._objectPool.length;if(e>0){for(var i=0;i<e;i++)this._objectPool[i].dispose();this._objectPool.length=0}},e.prototype.internalCreateObject=function(e){this._itemList.length=0,this._objectPool.length=0;var i={pi:e,type:e.objectType};i.childCount=this.collectComponentChildren(e),this._itemList.push(i),this._index=0,t.GTimers.inst.add(1,0,this.run,this)},e.prototype.collectComponentChildren=function(e){var i,n,o,r,s,a,h=e.rawData;h.seek(0,2);var l=h.readShort();for(o=0;o<l;o++){r=h.readShort(),s=h.position,h.seek(s,0);var c=h.readByte(),u=h.readS(),_=h.readS();h.position=s,null!=u?(i={pi:n=null!=(a=null!=_?t.UIPackage.getById(_):e.owner)?a.getItemById(u):null,type:c},null!=n&&n.type==t.PackageItemType.Component&&(i.childCount=this.collectComponentChildren(n))):(i={type:c},c==t.ObjectType.List&&(i.listItemCount=this.collectListChildren(h))),this._itemList.push(i),h.position=s+r}return l},e.prototype.collectListChildren=function(e){e.seek(e.position,8);var i,n,o,r,s,a=0,h=e.readS(),l=e.readShort();for(i=0;i<l;i++)n=e.readShort(),n+=e.position,null==(o=e.readS())&&(o=h),o&&(r=t.UIPackage.getItemByURL(o))&&(s={pi:r,type:r.objectType},r.type==t.PackageItemType.Component&&(s.childCount=this.collectComponentChildren(r)),this._itemList.push(s),a++),e.position=n;return a},e.prototype.run=function(){for(var e,i,n,o,r=egret.getTimer(),s=t.UIConfig.frameTimeForAsyncUIConstruction,a=this._itemList.length;this._index<a;){if((i=this._itemList[this._index]).pi)e=t.UIObjectFactory.newObject(i.pi),this._objectPool.push(e),t.UIPackage._constructing++,i.pi.type==t.PackageItemType.Component?(n=this._objectPool.length-i.childCount-1,e.constructFromResource2(this._objectPool,n),this._objectPool.splice(n,i.childCount)):e.constructFromResource(),t.UIPackage._constructing--;else if(e=t.UIObjectFactory.newObject(i.type),this._objectPool.push(e),i.type==t.ObjectType.List&&i.listItemCount>0){for(n=this._objectPool.length-i.listItemCount-1,o=0;o<i.listItemCount;o++)e.itemPool.returnObject(this._objectPool[o+n]);this._objectPool.splice(n,i.listItemCount)}if(this._index++,this._index%5==0&&egret.getTimer()-r>=s)return}t.GTimers.inst.remove(this.run,this);var h=this._objectPool[0];this._itemList.length=0,this._objectPool.length=0,null!=this.callback&&this.callback.call(this.callbackObj,h)},e}();t.AsyncOperation=e}(fgui||(fgui={})),function(t){var e=0,i=function(i){function n(){var t=i.call(this)||this;return t._pageIds=[],t._pageNames=[],t._selectedIndex=-1,t._previousIndex=-1,t}return __extends(n,i),n.prototype.dispose=function(){},Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(e){if(this._selectedIndex!=e){if(e>this._pageIds.length-1)throw"index out of bounds: "+e;this.changing=!0,this._previousIndex=this._selectedIndex,this._selectedIndex=e,this.parent.applyController(this),this.dispatchEvent(new t.StateChangeEvent(t.StateChangeEvent.CHANGED)),this.changing=!1}},enumerable:!0,configurable:!0}),n.prototype.setSelectedIndex=function(t){if(this._selectedIndex!=t){if(t>this._pageIds.length-1)throw"index out of bounds: "+t;this.changing=!0,this._previousIndex=this._selectedIndex,this._selectedIndex=t,this.parent.applyController(this),this.changing=!1}},Object.defineProperty(n.prototype,"previsousIndex",{get:function(){return this._previousIndex},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedPage",{get:function(){return-1==this._selectedIndex?null:this._pageNames[this._selectedIndex]},set:function(t){var e=this._pageNames.indexOf(t);-1==e&&(e=0),this.selectedIndex=e},enumerable:!0,configurable:!0}),n.prototype.setSelectedPage=function(t){var e=this._pageNames.indexOf(t);-1==e&&(e=0),this.setSelectedIndex(e)},Object.defineProperty(n.prototype,"previousPage",{get:function(){return-1==this._previousIndex?null:this._pageNames[this._previousIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pageCount",{get:function(){return this._pageIds.length},enumerable:!0,configurable:!0}),n.prototype.getPageName=function(t){return this._pageNames[t]},n.prototype.addPage=function(t){this.addPageAt(t||"",this._pageIds.length)},n.prototype.addPageAt=function(t,i){var n=""+e++;i==this._pageIds.length?(this._pageIds.push(n),this._pageNames.push(t)):(this._pageIds.splice(i,0,n),this._pageNames.splice(i,0,t))},n.prototype.removePage=function(t){var e=this._pageNames.indexOf(t);-1!=e&&(this._pageIds.splice(e,1),this._pageNames.splice(e,1),this._selectedIndex>=this._pageIds.length?this.selectedIndex=this._selectedIndex-1:this.parent.applyController(this))},n.prototype.removePageAt=function(t){void 0===t&&(t=0),this._pageIds.splice(t,1),this._pageNames.splice(t,1),this._selectedIndex>=this._pageIds.length?this.selectedIndex=this._selectedIndex-1:this.parent.applyController(this)},n.prototype.clearPages=function(){this._pageIds.length=0,this._pageNames.length=0,-1!=this._selectedIndex?this.selectedIndex=-1:this.parent.applyController(this)},n.prototype.hasPage=function(t){return-1!=this._pageNames.indexOf(t)},n.prototype.getPageIndexById=function(t){return this._pageIds.indexOf(t)},n.prototype.getPageIdByName=function(t){var e=this._pageNames.indexOf(t);return-1!=e?this._pageIds[e]:null},n.prototype.getPageNameById=function(t){var e=this._pageIds.indexOf(t);return-1!=e?this._pageNames[e]:null},n.prototype.getPageId=function(t){return void 0===t&&(t=0),this._pageIds[t]},Object.defineProperty(n.prototype,"selectedPageId",{get:function(){return-1==this._selectedIndex?null:this._pageIds[this._selectedIndex]},set:function(t){var e=this._pageIds.indexOf(t);this.selectedIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"oppositePageId",{set:function(t){this._pageIds.indexOf(t)>0?this.selectedIndex=0:this._pageIds.length>1&&(this.selectedIndex=1)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"previousPageId",{get:function(){return-1==this._previousIndex?null:this._pageIds[this._previousIndex]},enumerable:!0,configurable:!0}),n.prototype.runActions=function(){if(this._actions)for(var t=this._actions.length,e=0;e<t;e++)this._actions[e].run(this,this.previousPageId,this.selectedPageId)},n.prototype.setup=function(e){var i,n,o=e.position;e.seek(o,0),this.name=e.readS(),e.readBool()&&(this.autoRadioGroupDepth=!0),e.seek(o,1);var r=e.readShort();for(i=0;i<r;i++)this._pageIds.push(e.readS()),this._pageNames.push(e.readS());var s=0;if(e.version>=2)switch(e.readByte()){case 1:s=e.readShort();break;case 2:-1==(s=this._pageNames.indexOf(t.UIPackage.branch))&&(s=0);break;case 3:-1==(s=this._pageNames.indexOf(t.UIPackage.getVar(e.readS())))&&(s=0)}if(e.seek(o,2),(r=e.readShort())>0)for(this._actions||(this._actions=new Array),i=0;i<r;i++){n=e.readShort(),n+=e.position;var a=t.ControllerAction.createAction(e.readByte());a.setup(e),this._actions.push(a),e.position=n}this.parent&&this._pageIds.length>0?this._selectedIndex=s:this._selectedIndex=-1},n}(egret.EventDispatcher);t.Controller=i}(fgui||(fgui={})),function(t){var e=function(){function e(){this._agent=new t.GLoader,this._agent.draggable=!0,this._agent.touchable=!1,this._agent.setSize(100,100),this._agent.setPivot(.5,.5,!0),this._agent.align=t.AlignType.Center,this._agent.verticalAlign=t.VertAlignType.Middle,this._agent.sortingOrder=1e6,this._agent.addEventListener(t.DragEvent.DRAG_END,this.__dragEnd,this)}return Object.defineProperty(e,"inst",{get:function(){return null==e._inst&&(e._inst=new e),e._inst},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dragAgent",{get:function(){return this._agent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dragging",{get:function(){return null!=this._agent.parent},enumerable:!0,configurable:!0}),e.prototype.startDrag=function(e,i,n,o){if(!this._agent.parent){this._sourceData=n,this._agent.url=i,t.GRoot.inst.addChild(this._agent);var r=t.GRoot.inst.globalToLocal(t.GRoot.mouseX,t.GRoot.mouseY);this._agent.setXY(r.x,r.y),this._agent.startDrag(o)}},e.prototype.cancel=function(){this._agent.parent&&(this._agent.stopDrag(),t.GRoot.inst.removeChild(this._agent),this._sourceData=null)},e.prototype.__dragEnd=function(e){if(null!=this._agent.parent){t.GRoot.inst.removeChild(this._agent);var i=this._sourceData;this._sourceData=null;for(var n=t.GRoot.inst.getObjectUnderPoint(e.stageX,e.stageY);n;){if(n.hasEventListener(t.DropEvent.DROP)){var o=new t.DropEvent(t.DropEvent.DROP,i);return n.requestFocus(),void n.dispatchEvent(o)}n=n.parent}}},e}();t.DragDropManager=e}(fgui||(fgui={})),function(t){!function(t){t[t.Common=0]="Common",t[t.Check=1]="Check",t[t.Radio=2]="Radio"}(t.ButtonMode||(t.ButtonMode={})),function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Height=2]="Height"}(t.AutoSizeType||(t.AutoSizeType={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center",t[t.Right=2]="Right"}(t.AlignType||(t.AlignType={})),function(t){t[t.Top=0]="Top",t[t.Middle=1]="Middle",t[t.Bottom=2]="Bottom"}(t.VertAlignType||(t.VertAlignType={})),function(t){t[t.None=0]="None",t[t.Scale=1]="Scale",t[t.ScaleMatchHeight=2]="ScaleMatchHeight",t[t.ScaleMatchWidth=3]="ScaleMatchWidth",t[t.ScaleFree=4]="ScaleFree",t[t.ScaleNoBorder=5]="ScaleNoBorder"}(t.LoaderFillType||(t.LoaderFillType={})),function(t){t[t.SingleColumn=0]="SingleColumn",t[t.SingleRow=1]="SingleRow",t[t.FlowHorizontal=2]="FlowHorizontal",t[t.FlowVertical=3]="FlowVertical",t[t.Pagination=4]="Pagination"}(t.ListLayoutType||(t.ListLayoutType={})),function(t){t[t.Single=0]="Single",t[t.Multiple=1]="Multiple",t[t.Multiple_SingleClick=2]="Multiple_SingleClick",t[t.None=3]="None"}(t.ListSelectionMode||(t.ListSelectionMode={})),function(t){t[t.Visible=0]="Visible",t[t.Hidden=1]="Hidden",t[t.Scroll=2]="Scroll"}(t.OverflowType||(t.OverflowType={})),function(t){t[t.Image=0]="Image",t[t.MovieClip=1]="MovieClip",t[t.Sound=2]="Sound",t[t.Component=3]="Component",t[t.Atlas=4]="Atlas",t[t.Font=5]="Font",t[t.Swf=6]="Swf",t[t.Misc=7]="Misc",t[t.Unknown=8]="Unknown",t[t.Spine=9]="Spine",t[t.DragonBones=10]="DragonBones"}(t.PackageItemType||(t.PackageItemType={})),function(t){t[t.Image=0]="Image",t[t.MovieClip=1]="MovieClip",t[t.Swf=2]="Swf",t[t.Graph=3]="Graph",t[t.Loader=4]="Loader",t[t.Group=5]="Group",t[t.Text=6]="Text",t[t.RichText=7]="RichText",t[t.InputText=8]="InputText",t[t.Component=9]="Component",t[t.List=10]="List",t[t.Label=11]="Label",t[t.Button=12]="Button",t[t.ComboBox=13]="ComboBox",t[t.ProgressBar=14]="ProgressBar",t[t.Slider=15]="Slider",t[t.ScrollBar=16]="ScrollBar",t[t.Tree=17]="Tree",t[t.Loader3D=18]="Loader3D"}(t.ObjectType||(t.ObjectType={})),function(t){t[t.Percent=0]="Percent",t[t.ValueAndMax=1]="ValueAndMax",t[t.Value=2]="Value",t[t.Max=3]="Max"}(t.ProgressTitleType||(t.ProgressTitleType={})),function(t){t[t.Default=0]="Default",t[t.Visible=1]="Visible",t[t.Auto=2]="Auto",t[t.Hidden=3]="Hidden"}(t.ScrollBarDisplayType||(t.ScrollBarDisplayType={})),function(t){t[t.Horizontal=0]="Horizontal",t[t.Vertical=1]="Vertical",t[t.Both=2]="Both"}(t.ScrollType||(t.ScrollType={})),function(t){t[t.None=0]="None",t[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical",t[t.Both=3]="Both"}(t.FlipType||(t.FlipType={})),function(t){t[t.Ascent=0]="Ascent",t[t.Descent=1]="Descent",t[t.Arch=2]="Arch"}(t.ChildrenRenderOrder||(t.ChildrenRenderOrder={})),function(t){t[t.None=0]="None",t[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical"}(t.GroupLayoutType||(t.GroupLayoutType={})),function(t){t[t.Auto=0]="Auto",t[t.Up=1]="Up",t[t.Down=2]="Down"}(t.PopupDirection||(t.PopupDirection={})),function(t){t[t.Left_Left=0]="Left_Left",t[t.Left_Center=1]="Left_Center",t[t.Left_Right=2]="Left_Right",t[t.Center_Center=3]="Center_Center",t[t.Right_Left=4]="Right_Left",t[t.Right_Center=5]="Right_Center",t[t.Right_Right=6]="Right_Right",t[t.Top_Top=7]="Top_Top",t[t.Top_Middle=8]="Top_Middle",t[t.Top_Bottom=9]="Top_Bottom",t[t.Middle_Middle=10]="Middle_Middle",t[t.Bottom_Top=11]="Bottom_Top",t[t.Bottom_Middle=12]="Bottom_Middle",t[t.Bottom_Bottom=13]="Bottom_Bottom",t[t.Width=14]="Width",t[t.Height=15]="Height",t[t.LeftExt_Left=16]="LeftExt_Left",t[t.LeftExt_Right=17]="LeftExt_Right",t[t.RightExt_Left=18]="RightExt_Left",t[t.RightExt_Right=19]="RightExt_Right",t[t.TopExt_Top=20]="TopExt_Top",t[t.TopExt_Bottom=21]="TopExt_Bottom",t[t.BottomExt_Top=22]="BottomExt_Top",t[t.BottomExt_Bottom=23]="BottomExt_Bottom",t[t.Size=24]="Size"}(t.RelationType||(t.RelationType={})),function(t){t[t.None=0]="None",t[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical",t[t.Radial90=3]="Radial90",t[t.Radial180=4]="Radial180",t[t.Radial360=5]="Radial360"}(t.FillMethod||(t.FillMethod={})),function(t){t[t.Top=0]="Top",t[t.Bottom=1]="Bottom",t[t.Left=2]="Left",t[t.Right=3]="Right",t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(t.FillOrigin||(t.FillOrigin={})),function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(t.FillOrigin90||(t.FillOrigin90={})),function(t){t[t.Text=0]="Text",t[t.Icon=1]="Icon",t[t.Color=2]="Color",t[t.OutlineColor=3]="OutlineColor",t[t.Playing=4]="Playing",t[t.Frame=5]="Frame",t[t.DeltaTime=6]="DeltaTime",t[t.TimeScale=7]="TimeScale",t[t.FontSize=8]="FontSize",t[t.Selected=9]="Selected"}(t.ObjectPropID||(t.ObjectPropID={}))}(fgui||(fgui={})),function(t){var e=function(e){function h(){var i=e.call(this)||this;return i._x=0,i._y=0,i._alpha=1,i._rotation=0,i._visible=!0,i._touchable=!0,i._scaleX=1,i._scaleY=1,i._skewX=0,i._skewY=0,i._pivotX=0,i._pivotY=0,i._pivotOffsetX=0,i._pivotOffsetY=0,i._sortingOrder=0,i._internalVisible=!0,i._disposed=!1,i.sourceWidth=0,i.sourceHeight=0,i.initWidth=0,i.initHeight=0,i.minWidth=0,i.minHeight=0,i.maxWidth=0,i.maxHeight=0,i._width=0,i._height=0,i._rawWidth=0,i._rawHeight=0,i._sizePercentInGroup=0,i._id=""+n++,i._name="",i.createDisplayObject(),i._relations=new t.Relations(i),i._gears=new Array(10),i}return __extends(h,e),Object.defineProperty(h.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"x",{get:function(){return this._x},set:function(t){this.setXY(t,this._y)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"y",{get:function(){return this._y},set:function(t){this.setXY(this._x,t)},enumerable:!0,configurable:!0}),h.prototype.setXY=function(e,n){if(this._x!=e||this._y!=n){var o=e-this._x,s=n-this._y;this._x=e,this._y=n,this.handleXYChanged(),this instanceof t.GGroup&&this.moveChildren(o,s),this.updateGear(1),!this._parent||this._parent instanceof t.GList||(this._parent.setBoundsChangedFlag(),this._group&&this._group.setBoundsChangedFlag(!0),this.dispatchEventWith(h.XY_CHANGED)),h.draggingObject!=this||i||this.localToGlobalRect(0,0,this._width,this._height,r)}},Object.defineProperty(h.prototype,"xMin",{get:function(){return this._pivotAsAnchor?this._x-this._width*this._pivotX:this._x},set:function(t){this._pivotAsAnchor?this.setXY(t+this._width*this._pivotX,this._y):this.setXY(t,this._y)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"yMin",{get:function(){return this._pivotAsAnchor?this._y-this._height*this._pivotY:this._y},set:function(t){this._pivotAsAnchor?this.setXY(this._x,t+this._height*this._pivotY):this.setXY(this._x,t)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"pixelSnapping",{get:function(){return this._pixelSnapping},set:function(t){this._pixelSnapping!=t&&(this._pixelSnapping=t,this.handleXYChanged())},enumerable:!0,configurable:!0}),h.prototype.center=function(e){var i;i=this._parent?this.parent:this.root,this.setXY((i.width-this._width)/2,(i.height-this._height)/2),e&&(this.addRelation(i,t.RelationType.Center_Center),this.addRelation(i,t.RelationType.Middle_Middle))},Object.defineProperty(h.prototype,"width",{get:function(){return this.ensureSizeCorrect(),this._relations.sizeDirty&&this._relations.ensureRelationsSizeCorrect(),this._width},set:function(t){this.setSize(t,this._rawHeight)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"height",{get:function(){return this.ensureSizeCorrect(),this._relations.sizeDirty&&this._relations.ensureRelationsSizeCorrect(),this._height},set:function(t){this.setSize(this._rawWidth,t)},enumerable:!0,configurable:!0}),h.prototype.setSize=function(e,i,n){if(this._rawWidth!=e||this._rawHeight!=i){this._rawWidth=e,this._rawHeight=i,e<this.minWidth&&(e=this.minWidth),i<this.minHeight&&(i=this.minHeight),this.maxWidth>0&&e>this.maxWidth&&(e=this.maxWidth),this.maxHeight>0&&i>this.maxHeight&&(i=this.maxHeight);var o=e-this._width,r=i-this._height;this._width=e,this._height=i,this.handleSizeChanged(),0==this._pivotX&&0==this._pivotY||(this._pivotAsAnchor?this.applyPivot():(n||this.setXY(this.x-this._pivotX*o,this.y-this._pivotY*r),this.updatePivotOffset())),this instanceof t.GGroup&&this.resizeChildren(o,r),this.updateGear(2),this._parent&&(this._relations.onOwnerSizeChanged(o,r,this._pivotAsAnchor||!n),this._parent.setBoundsChangedFlag(),this._group&&this._group.setBoundsChangedFlag()),this.dispatchEventWith(h.SIZE_CHANGED)}},h.prototype.makeFullScreen=function(){this.setSize(t.GRoot.inst.width,t.GRoot.inst.height)},h.prototype.ensureSizeCorrect=function(){},Object.defineProperty(h.prototype,"actualWidth",{get:function(){return this.width*Math.abs(this._scaleX)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"actualHeight",{get:function(){return this.height*Math.abs(this._scaleY)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"scaleX",{get:function(){return this._scaleX},set:function(t){this.setScale(t,this._scaleY)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"scaleY",{get:function(){return this._scaleY},set:function(t){this.setScale(this._scaleX,t)},enumerable:!0,configurable:!0}),h.prototype.setScale=function(t,e){this._scaleX==t&&this._scaleY==e||(this._scaleX=t,this._scaleY=e,this.handleScaleChanged(),this.applyPivot(),this.updateGear(2))},Object.defineProperty(h.prototype,"skewX",{get:function(){return this._skewX},set:function(t){this.setSkew(t,this._skewY)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"skewY",{get:function(){return this._skewY},set:function(t){this.setSkew(this._skewX,t)},enumerable:!0,configurable:!0}),h.prototype.setSkew=function(t,e){this._skewX==t&&this._skewY==e||(this._skewX=t,this._skewY=e,this._displayObject&&(this._displayObject.skewX=t,this._displayObject.skewY=e),this.applyPivot())},Object.defineProperty(h.prototype,"pivotX",{get:function(){return this._pivotX},set:function(t){this.setPivot(t,this._pivotY)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"pivotY",{get:function(){return this._pivotY},set:function(t){this.setPivot(this._pivotX,t)},enumerable:!0,configurable:!0}),h.prototype.setPivot=function(t,e,i){this._pivotX==t&&this._pivotY==e&&this._pivotAsAnchor==i||(this._pivotX=t,this._pivotY=e,this._pivotAsAnchor=i,this.updatePivotOffset(),this.handleXYChanged())},Object.defineProperty(h.prototype,"pivotAsAnchor",{get:function(){return this._pivotAsAnchor},enumerable:!0,configurable:!0}),h.prototype.internalSetPivot=function(t,e,i){this._pivotX=t,this._pivotY=e,this._pivotAsAnchor=i,i&&this.handleXYChanged()},h.prototype.updatePivotOffset=function(){if(this._displayObject)if(0!=this._pivotX||0!=this._pivotY){var t=this._pivotX*this._width,e=this._pivotY*this._height,i=this._displayObject.matrix.transformPoint(t,e,s);this._pivotOffsetX=this._pivotX*this._width-(i.x-this._displayObject.x),this._pivotOffsetY=this._pivotY*this._height-(i.y-this._displayObject.y)}else this._pivotOffsetX=0,this._pivotOffsetY=0},h.prototype.applyPivot=function(){0==this._pivotX&&0==this._pivotY||(this.updatePivotOffset(),this.handleXYChanged())},Object.defineProperty(h.prototype,"touchable",{get:function(){return this._touchable},set:function(e){if(this._touchable!=e){if(this._touchable=e,this.updateGear(3),this instanceof t.GImage||this instanceof t.GMovieClip||this instanceof t.GTextField&&!(this instanceof t.GTextInput)&&!(this instanceof t.GRichTextField))return;this._displayObject&&(this._displayObject.touchEnabled=this._touchable,this._displayObject instanceof egret.DisplayObjectContainer&&(this._displayObject.touchChildren=this._touchable))}},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"grayed",{get:function(){return this._grayed},set:function(t){this._grayed!=t&&(this._grayed=t,this.handleGrayedChanged(),this.updateGear(3))},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"enabled",{get:function(){return!this._grayed&&this._touchable},set:function(t){this.grayed=!t,this.touchable=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!=t&&(this._rotation=t,this._displayObject&&(this._displayObject.rotation=this.normalizeRotation),this.applyPivot(),this.updateGear(3))},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"normalizeRotation",{get:function(){var t=this._rotation%360;return t>180?t-=360:t<-180&&(t+=360),t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"alpha",{get:function(){return this._alpha},set:function(t){this._alpha!=t&&(this._alpha=t,this.handleAlphaChanged(),this.updateGear(3))},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"visible",{get:function(){return this._visible},set:function(t){this._visible!=t&&(this._visible=t,this.handleVisibleChanged(),this._parent&&this._parent.setBoundsChangedFlag(),this._group&&this._group.excludeInvisibles&&this._group.setBoundsChangedFlag())},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"internalVisible",{get:function(){return this._internalVisible&&(!this._group||this._group.internalVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"internalVisible2",{get:function(){return this._visible&&(!this._group||this._group.internalVisible2)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"internalVisible3",{get:function(){return this._visible&&this._internalVisible},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"sortingOrder",{get:function(){return this._sortingOrder},set:function(t){if(t<0&&(t=0),this._sortingOrder!=t){var e=this._sortingOrder;this._sortingOrder=t,this._parent&&this._parent.childSortingOrderChanged(this,e,this._sortingOrder)}},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"focused",{get:function(){return this.root.focus==this},enumerable:!0,configurable:!0}),h.prototype.requestFocus=function(){this.root.focus=this},Object.defineProperty(h.prototype,"tooltips",{get:function(){return this._tooltips},set:function(t){this._tooltips=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"blendMode",{get:function(){return this._displayObject.blendMode},set:function(t){this._displayObject.blendMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"filters",{get:function(){return this._displayObject.filters},set:function(t){this._displayObject.filters=t},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"inContainer",{get:function(){return null!=this._displayObject&&null!=this._displayObject.parent},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"onStage",{get:function(){return null!=this._displayObject&&null!=this._displayObject.stage},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"resourceURL",{get:function(){return this.packageItem?"ui://"+this.packageItem.owner.id+this.packageItem.id:null},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"group",{get:function(){return this._group},set:function(t){this._group!=t&&(this._group&&this._group.setBoundsChangedFlag(),this._group=t,this._group&&this._group.setBoundsChangedFlag())},enumerable:!0,configurable:!0}),h.prototype.getGear=function(e){var i=this._gears[e];return null==i&&(this._gears[e]=i=t.GearBase.create(this,e)),i},h.prototype.updateGear=function(t){if(!this._underConstruct&&!this._gearLocked){var e=this._gears[t];e&&e.controller&&e.updateState()}},h.prototype.checkGearController=function(t,e){return null!=this._gears[t]&&this._gears[t].controller==e},h.prototype.updateGearFromRelations=function(t,e,i){this._gears[t]&&this._gears[t].updateFromRelations(e,i)},h.prototype.addDisplayLock=function(){var t=this._gears[0];if(t&&t.controller){var e=t.addLock();return this.checkGearDisplay(),e}return 0},h.prototype.releaseDisplayLock=function(t){var e=this._gears[0];e&&e.controller&&(e.releaseLock(t),this.checkGearDisplay())},h.prototype.checkGearDisplay=function(){if(!this._handlingController){var t=null==this._gears[0]||this._gears[0].connected;this._gears[8]&&(t=this._gears[8].evaluate(t)),t!=this._internalVisible&&(this._internalVisible=t,this._parent&&this._parent.childStateChanged(this),this._group&&this._group.excludeInvisibles&&this._group.setBoundsChangedFlag())}},Object.defineProperty(h.prototype,"gearXY",{get:function(){return this.getGear(1)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"gearSize",{get:function(){return this.getGear(2)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"gearLook",{get:function(){return this.getGear(3)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"relations",{get:function(){return this._relations},enumerable:!0,configurable:!0}),h.prototype.addRelation=function(t,e,i){this._relations.add(t,e,i)},h.prototype.removeRelation=function(t,e){this._relations.remove(t,e||0)},Object.defineProperty(h.prototype,"displayObject",{get:function(){return this._displayObject},enumerable:!0,configurable:!0}),h.prototype.setDisplayObject=function(t){this._displayObject!=t&&(this._displayObject&&delete this._displayObject.$owner,this._displayObject=t,this._displayObject.$owner=this)},Object.defineProperty(h.prototype,"parent",{get:function(){return this._parent},set:function(t){this._parent=t},enumerable:!0,configurable:!0}),h.prototype.removeFromParent=function(){this._parent&&this._parent.removeChild(this)},Object.defineProperty(h.prototype,"root",{get:function(){if(this instanceof t.GRoot)return this;for(var e=this._parent;e;){if(e instanceof t.GRoot)return e;e=e.parent}return t.GRoot.inst},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asCom",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asButton",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asLabel",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asProgress",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asTextField",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asRichTextField",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asTextInput",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asLoader",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asList",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asTree",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asGraph",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asGroup",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asSlider",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asComboBox",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asImage",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"asMovieClip",{get:function(){return this},enumerable:!0,configurable:!0}),h.cast=function(t){return t.$owner},Object.defineProperty(h.prototype,"text",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"icon",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"treeNode",{get:function(){return this._treeNode},enumerable:!0,configurable:!0}),h.prototype.dispose=function(){if(!this._disposed){this._disposed=!0,this.removeFromParent(),this._relations.dispose(),this._displayObject=null;for(var t=0;t<10;t++){var e=this._gears[t];e&&e.dispose()}}},h.prototype.addClickListener=function(t,e){this.addEventListener(egret.TouchEvent.TOUCH_TAP,t,e)},h.prototype.removeClickListener=function(t,e){this.removeEventListener(egret.TouchEvent.TOUCH_TAP,t,e)},h.prototype.hasClickListener=function(){return this.hasEventListener(egret.TouchEvent.TOUCH_TAP)},h.prototype.addEventListener=function(t,i,n){e.prototype.addEventListener.call(this,t,i,n),this._displayObject&&this._displayObject.addEventListener(t,this._reDispatch,this)},h.prototype.removeEventListener=function(t,i,n){e.prototype.removeEventListener.call(this,t,i,n),this._displayObject&&!this.hasEventListener(t)&&this._displayObject.removeEventListener(t,this._reDispatch,this)},h.prototype._reDispatch=function(t){this.dispatchEvent(t)},Object.defineProperty(h.prototype,"draggable",{get:function(){return this._draggable},set:function(t){this._draggable!=t&&(this._draggable=t,this.initDrag())},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"dragBounds",{get:function(){return this._dragBounds},set:function(t){this._dragBounds=t},enumerable:!0,configurable:!0}),h.prototype.startDrag=function(t,e,i){null!=this._displayObject.stage&&this.dragBegin(t,e,i)},h.prototype.stopDrag=function(){this.dragEnd()},Object.defineProperty(h.prototype,"dragging",{get:function(){return h.draggingObject==this},enumerable:!0,configurable:!0}),h.prototype.localToGlobal=function(t,e,i){return t=t||0,e=e||0,this._pivotAsAnchor&&(t+=this._pivotX*this._width,e+=this._pivotY*this._height),this._displayObject.localToGlobal(t,e,i)},h.prototype.globalToLocal=function(t,e,i){t=t||0,e=e||0;var n=this._displayObject.globalToLocal(t,e,i);return this._pivotAsAnchor&&(n.x-=this._pivotX*this._width,n.y-=this._pivotY*this._height),n},h.prototype.localToRoot=function(e,i,n){e=e||0,i=i||0;var o=this._displayObject.localToGlobal(e,i,n);return o.x/=t.GRoot.contentScaleFactor,o.y/=t.GRoot.contentScaleFactor,o},h.prototype.rootToLocal=function(e,i,n){return e=e||0,i=i||0,e*=t.GRoot.contentScaleFactor,i*=t.GRoot.contentScaleFactor,this._displayObject.globalToLocal(e,i,n)},h.prototype.localToGlobalRect=function(t,e,i,n,o){t=t||0,e=e||0,i=i||0,n=n||0,o=o||new egret.Rectangle;var r=this.localToGlobal(t,e);return o.x=r.x,o.y=r.y,r=this.localToGlobal(t+i,e+n),o.right=r.x,o.bottom=r.y,o},h.prototype.globalToLocalRect=function(t,e,i,n,o){t=t||0,e=e||0,i=i||0,n=n||0,o=o||new egret.Rectangle;var r=this.globalToLocal(t,e);return o.x=r.x,o.y=r.y,r=this.globalToLocal(t+i,e+n),o.right=r.x,o.bottom=r.y,o},h.prototype.handleControllerChanged=function(t){this._handlingController=!0;for(var e=0;e<10;e++){var i=this._gears[e];i&&i.controller==t&&i.apply()}this._handlingController=!1,this.checkGearDisplay()},h.prototype.createDisplayObject=function(){},h.prototype.switchDisplayObject=function(e){if(e!=this._displayObject){var i=this._displayObject;if(this._displayObject&&this._displayObject.parent){var n=this._displayObject.parent.getChildIndex(this._displayObject);this._displayObject.parent.addChildAt(e,n),this._displayObject.parent.removeChild(this._displayObject)}this._displayObject=e,this._displayObject.x=i.x,this._displayObject.y=i.y,this._displayObject.rotation=i.rotation,this._displayObject.alpha=i.alpha,this._displayObject.visible=i.visible,this._displayObject.touchEnabled=i.touchEnabled,this._displayObject.scaleX=i.scaleX,this._displayObject.scaleY=i.scaleY,t.ToolSet.setColorFilter(this._displayObject,this._grayed),this._displayObject instanceof egret.DisplayObjectContainer&&(this._displayObject.touchChildren=this._touchable)}},h.prototype.handleXYChanged=function(){if(this._displayObject){var t=this._x,e=this._y;this._pivotAsAnchor&&(t-=this._pivotX*this._width,e-=this._pivotY*this._height),this._pixelSnapping&&(t=Math.round(t),e=Math.round(e)),this._displayObject.x=t+this._pivotOffsetX,this._displayObject.y=e+this._pivotOffsetY}},h.prototype.handleSizeChanged=function(){this._displayObject&&(this._displayObject.width=this._width,this._displayObject.height=this._height)},h.prototype.handleScaleChanged=function(){this._displayObject&&(this._displayObject.scaleX=this._scaleX,this._displayObject.scaleY=this._scaleY)},h.prototype.handleGrayedChanged=function(){this._displayObject&&t.ToolSet.setColorFilter(this._displayObject,this._grayed)},h.prototype.handleAlphaChanged=function(){this._displayObject&&(this._displayObject.alpha=this._alpha)},h.prototype.handleVisibleChanged=function(){this._displayObject&&(this._displayObject.visible=this.internalVisible2),this instanceof t.GGroup&&this.handleVisibleChanged()},h.prototype.getProp=function(e){switch(e){case t.ObjectPropID.Text:return this.text;case t.ObjectPropID.Icon:return this.icon;case t.ObjectPropID.Color:case t.ObjectPropID.OutlineColor:return NaN;case t.ObjectPropID.Playing:return!1;case t.ObjectPropID.Frame:case t.ObjectPropID.DeltaTime:return 0;case t.ObjectPropID.TimeScale:return 1;case t.ObjectPropID.FontSize:return 0;case t.ObjectPropID.Selected:return!1;default:return}},h.prototype.setProp=function(e,i){switch(e){case t.ObjectPropID.Text:this.text=i;break;case t.ObjectPropID.Icon:this.icon=i}},h.prototype.constructFromResource=function(){},h.prototype.setup_beforeAdd=function(e,i){var n,o;e.seek(i,0),e.skip(5),this._id=e.readS(),this._name=e.readS(),n=e.readInt(),o=e.readInt(),this.setXY(n,o),e.readBool()&&(this.initWidth=e.readInt(),this.initHeight=e.readInt(),this.setSize(this.initWidth,this.initHeight,!0)),e.readBool()&&(this.minWidth=e.readInt(),this.maxWidth=e.readInt(),this.minHeight=e.readInt(),this.maxHeight=e.readInt()),e.readBool()&&(n=e.readFloat(),o=e.readFloat(),this.setScale(n,o)),e.readBool()&&(n=e.readFloat(),o=e.readFloat(),this.setSkew(n,o)),e.readBool()&&(n=e.readFloat(),o=e.readFloat(),this.setPivot(n,o,e.readBool())),1!=(n=e.readFloat())&&(this.alpha=n),0!=(n=e.readFloat())&&(this.rotation=n),e.readBool()||(this.visible=!1),e.readBool()||(this.touchable=!1),e.readBool()&&(this.grayed=!0);var r=e.readByte();2==r?this.blendMode=egret.BlendMode.ADD:5==r&&(this.blendMode=egret.BlendMode.ERASE),1==e.readByte()&&this._displayObject&&t.ToolSet.setColorFilter(this._displayObject,[e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat()]);var s=e.readS();null!=s&&(this.data=s)},h.prototype.setup_afterAdd=function(t,e){t.seek(e,1);var i=t.readS();null!=i&&(this.tooltips=i);var n=t.readShort();n>=0&&(this.group=this.parent.getChildAt(n)),t.seek(e,2);for(var o=t.readShort(),r=0;r<o;r++){var s=t.readShort();s+=t.position,this.getGear(t.readByte()).setup(t),t.position=s}},h.prototype.initDrag=function(){this._draggable?this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__begin,this):this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__begin,this)},h.prototype.dragBegin=function(e,i,n){if(h.draggingObject){var s=h.draggingObject;s.stopDrag(),h.draggingObject=null;var a=new t.DragEvent(t.DragEvent.DRAG_END);a.stageX=i||t.GRoot.mouseX,a.stageY=n||t.GRoot.mouseY,a.touchPointID=e||0,s.dispatchEvent(a)}o.x=i||t.GRoot.mouseX,o.y=n||t.GRoot.mouseY,this.localToGlobalRect(0,0,this._width,this._height,r),this._dragTesting=!0,h.draggingObject=this,t.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.__moving,this),t.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END,this.__end,this)},h.prototype.dragEnd=function(){h.draggingObject==this&&(this.reset(),this._dragTesting=!1,h.draggingObject=null)},h.prototype.reset=function(){t.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.__moving,this),t.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END,this.__end,this)},h.prototype.__begin=function(e){null==this._dragStartPos&&(this._dragStartPos=new egret.Point),this._dragStartPos.x=e.stageX,this._dragStartPos.y=e.stageY,this._dragTesting=!0,t.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.__moving,this),t.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END,this.__end,this)},h.prototype.__moving=function(e){if(h.draggingObject!=this&&this._draggable&&this._dragTesting){var n=t.UIConfig.touchDragSensitivity;if(this._dragStartPos&&Math.abs(this._dragStartPos.x-e.stageX)<n&&Math.abs(this._dragStartPos.y-e.stageY)<n)return;this._dragTesting=!1,(_=new t.DragEvent(t.DragEvent.DRAG_START)).stageX=e.stageX,_.stageY=e.stageY,_.touchPointID=e.touchPointID,this.dispatchEvent(_),_.isDefaultPrevented()||this.dragBegin(e.touchPointID,e.stageX,e.stageY)}if(h.draggingObject==this){var l=e.stageX-o.x+r.x,c=e.stageY-o.y+r.y;if(this._dragBounds){var u=t.GRoot.inst.localToGlobalRect(this._dragBounds.x,this._dragBounds.y,this._dragBounds.width,this._dragBounds.height,a);l<u.x?l=u.x:l+r.width>u.right&&(l=u.right-r.width)<u.x&&(l=u.x),c<u.y?c=u.y:c+r.height>u.bottom&&(c=u.bottom-r.height)<u.y&&(c=u.y)}i=!0;var _,p=this.parent.globalToLocal(l,c,s);this.setXY(Math.round(p.x),Math.round(p.y)),i=!1,(_=new t.DragEvent(t.DragEvent.DRAG_MOVING)).stageX=e.stageX,_.stageY=e.stageY,_.touchPointID=e.touchPointID,this.dispatchEvent(_)}},h.prototype.__end=function(e){if(h.draggingObject==this){h.draggingObject=null,this.reset();var i=new t.DragEvent(t.DragEvent.DRAG_END);i.stageX=e.stageX,i.stageY=e.stageY,i.touchPointID=e.touchPointID,this.dispatchEvent(i)}else this._dragTesting&&(this._dragTesting=!1,this.reset())},h.XY_CHANGED="__xyChanged",h.SIZE_CHANGED="__sizeChanged",h.SIZE_DELAY_CHANGE="__sizeDelayChange",h.GEAR_STOP="gearStop",h}(egret.EventDispatcher);t.GObject=e;var i,n=0,o=new egret.Point,r=new egret.Rectangle,s=new egret.Point,a=new egret.Rectangle}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._sortingChildCount=0,i._childrenRenderOrder=t.ChildrenRenderOrder.Ascent,i._apexIndex=0,i._children=new Array,i._controllers=new Array,i._transitions=new Array,i._margin=new t.Margin,i._alignOffset=new egret.Point,i}return __extends(i,e),i.prototype.createDisplayObject=function(){this._rootContainer=new t.UIContainer,this.setDisplayObject(this._rootContainer),this._container=this._rootContainer},i.prototype.dispose=function(){var t,i;for(i=this._transitions.length,t=0;t<i;++t){this._transitions[t].dispose()}for(i=this._controllers.length,t=0;t<i;++t){this._controllers[t].dispose()}for(this._scrollPane&&this._scrollPane.dispose(),t=(i=this._children.length)-1;t>=0;--t){var n=this._children[t];n.parent=null,n.dispose()}this._boundsChanged=!1,e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"displayListContainer",{get:function(){return this._container},enumerable:!0,configurable:!0}),i.prototype.addChild=function(t){return this.addChildAt(t,this._children.length),t},i.prototype.addChildAt=function(t,e){if(void 0===e&&(e=0),!t)throw"child is null";var i=this._children.length;if(e>=0&&e<=i){if(t.parent==this)this.setChildIndex(t,e);else{t.removeFromParent(),t.parent=this;var n=this._children.length;0!=t.sortingOrder?(this._sortingChildCount++,e=this.getInsertPosForSortingChild(t)):this._sortingChildCount>0&&e>n-this._sortingChildCount&&(e=n-this._sortingChildCount),e==n?this._children.push(t):this._children.splice(e,0,t),this.childStateChanged(t),this.setBoundsChangedFlag()}return t}throw"Invalid child index"},i.prototype.getInsertPosForSortingChild=function(t){var e=this._children.length,i=0;for(i=0;i<e;i++){var n=this._children[i];if(n!=t&&t.sortingOrder<n.sortingOrder)break}return i},i.prototype.removeChild=function(t,e){var i=this._children.indexOf(t);return-1!=i&&this.removeChildAt(i,e),t},i.prototype.removeChildAt=function(e,i){if(e>=0&&e<this.numChildren){var n=this._children[e];return n.parent=null,0!=n.sortingOrder&&this._sortingChildCount--,this._children.splice(e,1),n.group=null,n.inContainer&&(this._container.removeChild(n.displayObject),this._childrenRenderOrder==t.ChildrenRenderOrder.Arch&&t.GTimers.inst.callLater(this.buildNativeDisplayList,this)),i&&n.dispose(),this.setBoundsChangedFlag(),n}throw"Invalid child index"},i.prototype.removeChildren=function(t,e,i){null==t&&(t=0),null==e&&(e=-1),(e<0||e>=this.numChildren)&&(e=this.numChildren-1);for(var n=t;n<=e;++n)this.removeChildAt(t,i)},i.prototype.getChildAt=function(t){if(t>=0&&t<this.numChildren)return this._children[t];throw"Invalid child index"},i.prototype.getChild=function(t){for(var e=this._children.length,i=0;i<e;++i)if(this._children[i].name==t)return this._children[i];return null},i.prototype.getChildByPath=function(t){for(var e,n=t.split("."),o=n.length,r=this,s=0;s<o&&(e=r.getChild(n[s]));++s)if(s!=o-1){if(!(e instanceof i)){e=null;break}r=e}return e},i.prototype.getVisibleChild=function(t){for(var e=this._children.length,i=0;i<e;++i){var n=this._children[i];if(n.internalVisible&&n.internalVisible&&n.name==t)return n}return null},i.prototype.getChildInGroup=function(t,e){for(var i=this._children.length,n=0;n<i;++n){var o=this._children[n];if(o.group==e&&o.name==t)return o}return null},i.prototype.getChildById=function(t){for(var e=this._children.length,i=0;i<e;++i)if(this._children[i]._id==t)return this._children[i];return null},i.prototype.getChildIndex=function(t){return this._children.indexOf(t)},i.prototype.setChildIndex=function(t,e){var i=this._children.indexOf(t);if(-1==i)throw"Not a child of this container";if(0==t.sortingOrder){var n=this._children.length;this._sortingChildCount>0&&e>n-this._sortingChildCount-1&&(e=n-this._sortingChildCount-1),this._setChildIndex(t,i,e)}},i.prototype.setChildIndexBefore=function(t,e){var i=this._children.indexOf(t);if(-1==i)throw"Not a child of this container";if(0!=t.sortingOrder)return i;var n=this._children.length;return this._sortingChildCount>0&&e>n-this._sortingChildCount-1&&(e=n-this._sortingChildCount-1),i<e?this._setChildIndex(t,i,e-1):this._setChildIndex(t,i,e)},i.prototype._setChildIndex=function(e,i,n){var o=this._children.length;if(n>o&&(n=o),i==n)return i;if(this._children.splice(i,1),this._children.splice(n,0,e),e.inContainer){var r,s=0;if(this._childrenRenderOrder==t.ChildrenRenderOrder.Ascent){for(r=0;r<n;r++)this._children[r].inContainer&&s++;s==this._container.numChildren&&s--,this._container.setChildIndex(e.displayObject,s)}else if(this._childrenRenderOrder==t.ChildrenRenderOrder.Descent){for(r=o-1;r>n;r--)this._children[r].inContainer&&s++;s==this._container.numChildren&&s--,this._container.setChildIndex(e.displayObject,s)}else t.GTimers.inst.callLater(this.buildNativeDisplayList,this);this.setBoundsChangedFlag()}return n},i.prototype.swapChildren=function(t,e){var i=this._children.indexOf(t),n=this._children.indexOf(e);if(-1==i||-1==n)throw"Not a child of this container";this.swapChildrenAt(i,n)},i.prototype.swapChildrenAt=function(t,e){var i=this._children[t],n=this._children[e];this.setChildIndex(i,e),this.setChildIndex(n,t)},Object.defineProperty(i.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0}),i.prototype.isAncestorOf=function(t){if(!t)return!1;for(var e=t.parent;e;){if(e==this)return!0;e=e.parent}return!1},i.prototype.addController=function(t){this._controllers.push(t),t.parent=this,this.applyController(t)},i.prototype.getControllerAt=function(t){return this._controllers[t]},i.prototype.getController=function(t){for(var e=this._controllers.length,i=0;i<e;++i){var n=this._controllers[i];if(n.name==t)return n}return null},i.prototype.removeController=function(t){var e=this._controllers.indexOf(t);if(-1==e)throw"controller not exists";t.parent=null,this._controllers.splice(e,1);for(var i=this._children.length,n=0;n<i;n++){this._children[n].handleControllerChanged(t)}},Object.defineProperty(i.prototype,"controllers",{get:function(){return this._controllers},enumerable:!0,configurable:!0}),i.prototype.childStateChanged=function(e){if(!this._buildingDisplayList){var i,n,o=this._children.length;if(e instanceof t.GGroup)for(n=0;n<o;n++)(i=this._children[n]).group==e&&this.childStateChanged(i);else if(e.displayObject)if(e.internalVisible){if(!e.displayObject.parent){var r=0;if(this._childrenRenderOrder==t.ChildrenRenderOrder.Ascent){for(n=0;n<o&&(i=this._children[n])!=e;n++)i.displayObject&&i.displayObject.parent&&r++;this._container.addChildAt(e.displayObject,r)}else if(this._childrenRenderOrder==t.ChildrenRenderOrder.Descent){for(n=o-1;n>=0&&(i=this._children[n])!=e;n--)i.displayObject&&i.displayObject.parent&&r++;this._container.addChildAt(e.displayObject,r)}else this._container.addChild(e.displayObject),t.GTimers.inst.callLater(this.buildNativeDisplayList,this)}}else e.displayObject.parent&&this._container.removeChild(e.displayObject)}},i.prototype.buildNativeDisplayList=function(){var e,i,n=this._children.length;if(0!=n)switch(this._childrenRenderOrder){case t.ChildrenRenderOrder.Ascent:for(e=0;e<n;e++)(i=this._children[e]).displayObject&&i.internalVisible&&this._container.addChild(i.displayObject);break;case t.ChildrenRenderOrder.Descent:for(e=n-1;e>=0;e--)(i=this._children[e]).displayObject&&i.internalVisible&&this._container.addChild(i.displayObject);break;case t.ChildrenRenderOrder.Arch:var o=t.ToolSet.clamp(this._apexIndex,0,n);for(e=0;e<o;e++)(i=this._children[e]).displayObject&&i.internalVisible&&this._container.addChild(i.displayObject);for(e=n-1;e>=o;e--)(i=this._children[e]).displayObject&&i.internalVisible&&this._container.addChild(i.displayObject)}},i.prototype.applyController=function(t){this._applyingController=t;for(var e=this._children.length,i=0;i<e;i++)this._children[i].handleControllerChanged(t);this._applyingController=null,t.runActions()},i.prototype.applyAllControllers=function(){for(var t=this._controllers.length,e=0;e<t;++e)this.applyController(this._controllers[e])},i.prototype.adjustRadioGroupDepth=function(e,i){var n,o,r=this._children.length,s=-1,a=-1;for(n=0;n<r;n++)(o=this._children[n])==e?s=n:o instanceof t.GButton&&o.relatedController==i&&n>a&&(a=n);s<a&&(this._applyingController&&this._children[a].handleControllerChanged(this._applyingController),this.swapChildrenAt(s,a))},i.prototype.getTransitionAt=function(t){return this._transitions[t]},i.prototype.getTransition=function(t){for(var e=this._transitions.length,i=0;i<e;++i){var n=this._transitions[i];if(n.name==t)return n}return null},i.prototype.isChildInView=function(t){return this._rootContainer.scrollRect?t.x+t.width>=0&&t.x<=this.width&&t.y+t.height>=0&&t.y<=this.height:!this._scrollPane||this._scrollPane.isChildInView(t)},i.prototype.getFirstChildInView=function(){for(var t=this._children.length,e=0;e<t;++e){var i=this._children[e];if(this.isChildInView(i))return e}return-1},Object.defineProperty(i.prototype,"scrollPane",{get:function(){return this._scrollPane},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"opaque",{get:function(){return this._rootContainer.opaque},set:function(t){this._rootContainer.opaque=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"margin",{get:function(){return this._margin},set:function(t){this._margin.copy(t),this._rootContainer.scrollRect&&(this._container.x=this._margin.left+this._alignOffset.x,this._container.y=this._margin.top+this._alignOffset.y),this.handleSizeChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"childrenRenderOrder",{get:function(){return this._childrenRenderOrder},set:function(t){this._childrenRenderOrder!=t&&(this._childrenRenderOrder=t,this.buildNativeDisplayList())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"apexIndex",{get:function(){return this._apexIndex},set:function(e){this._apexIndex!=e&&(this._apexIndex=e,this._childrenRenderOrder==t.ChildrenRenderOrder.Arch&&this.buildNativeDisplayList())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mask",{get:function(){return this._rootContainer.mask},set:function(t){this._rootContainer.mask=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"baseUserData",{get:function(){var t=this.packageItem.rawData;return t.seek(0,4),t.readS()},enumerable:!0,configurable:!0}),i.prototype.updateScrollRect=function(){var t=this._rootContainer.scrollRect;null==t&&(t=new egret.Rectangle);var e=this.width-this._margin.right,i=this.height-this._margin.bottom;t.setTo(0,0,e,i),this._rootContainer.scrollRect=t},i.prototype.setupScroll=function(e){this._rootContainer==this._container&&(this._container=new egret.DisplayObjectContainer,this._rootContainer.addChild(this._container)),this._scrollPane=new t.ScrollPane(this),this._scrollPane.setup(e),this.setBoundsChangedFlag()},i.prototype.setupOverflow=function(e){e==t.OverflowType.Hidden?(this._rootContainer==this._container&&(this._container=new egret.DisplayObjectContainer,this._rootContainer.addChild(this._container)),this.updateScrollRect(),this._container.x=this._margin.left,this._container.y=this._margin.top):0==this._margin.left&&0==this._margin.top||(this._rootContainer==this._container&&(this._container=new egret.DisplayObjectContainer,this._rootContainer.addChild(this._container)),this._container.x=this._margin.left,this._container.y=this._margin.top),this.setBoundsChangedFlag()},i.prototype.handleSizeChanged=function(){if(e.prototype.handleSizeChanged.call(this),this._scrollPane?this._scrollPane.onOwnerSizeChanged():this._rootContainer.scrollRect&&this.updateScrollRect(),this._rootContainer.hitArea instanceof t.PixelHitTest){var i=this._rootContainer.hitArea;0!=this.sourceWidth&&(i.scaleX=this._width/this.sourceWidth),0!=this.sourceHeight&&(i.scaleY=this._height/this.sourceHeight)}},i.prototype.handleGrayedChanged=function(){var t=this.getController("grayed");if(t)t.selectedIndex=this.grayed?1:0;else for(var e=this.grayed,i=this._children.length,n=0;n<i;++n)this._children[n].grayed=e},i.prototype.handleControllerChanged=function(t){e.prototype.handleControllerChanged.call(this,t),this._scrollPane&&this._scrollPane.handleControllerChanged(t)},i.prototype.setBoundsChangedFlag=function(){(this._scrollPane||this._trackBounds)&&(this._boundsChanged||(this._boundsChanged=!0,egret.callLater(this.__render,this)))},i.prototype.__render=function(){if(this._boundsChanged){var t=this._children.length;if(t>0)for(var e=0;e<t;e++){this._children[e].ensureSizeCorrect()}this.updateBounds()}},i.prototype.ensureBoundsCorrect=function(){var t=this._children.length;if(t>0)for(var e=0;e<t;e++){this._children[e].ensureSizeCorrect()}this._boundsChanged&&this.updateBounds()},i.prototype.updateBounds=function(){var t=0,e=0,i=0,n=0,o=this._children.length;if(o>0){t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY;var r=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY,a=0,h=0;for(h=0;h<o;h++){var l=this._children[h];(a=l.x)<t&&(t=a),(a=l.y)<e&&(e=a),(a=l.x+l.actualWidth)>r&&(r=a),(a=l.y+l.actualHeight)>s&&(s=a)}i=r-t,n=s-e}this.setBounds(t,e,i,n)},i.prototype.setBounds=function(t,e,i,n){void 0===n&&(n=0),this._boundsChanged=!1,this._scrollPane&&this._scrollPane.setContentSize(Math.round(t+i),Math.round(e+n))},Object.defineProperty(i.prototype,"viewWidth",{get:function(){return this._scrollPane?this._scrollPane.viewWidth:this.width-this._margin.left-this._margin.right},set:function(t){this._scrollPane?this._scrollPane.viewWidth=t:this.width=t+this._margin.left+this._margin.right},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"viewHeight",{get:function(){return this._scrollPane?this._scrollPane.viewHeight:this.height-this._margin.top-this._margin.bottom},set:function(t){this._scrollPane?this._scrollPane.viewHeight=t:this.height=t+this._margin.top+this._margin.bottom},enumerable:!0,configurable:!0}),i.prototype.getSnappingPosition=function(t,e,i){i||(i=new egret.Point);var n=this._children.length;if(0==n)return i.x=0,i.y=0,i;this.ensureBoundsCorrect();var o=null,r=null,s=0;if(0!=e){for(;s<n;s++)if(e<(o=this._children[s]).y){if(0==s){e=0;break}e=e<(r=this._children[s-1]).y+r.actualHeight/2?r.y:o.y;break}s==n&&(e=o.y)}if(0!=t){for(s>0&&s--;s<n;s++)if(t<(o=this._children[s]).x){if(0==s){t=0;break}t=t<(r=this._children[s-1]).x+r.actualWidth/2?r.x:o.x;break}s==n&&(t=o.x)}return i.x=t,i.y=e,i},i.prototype.childSortingOrderChanged=function(t,e,i){if(void 0===i&&(i=0),0==i)this._sortingChildCount--,this.setChildIndex(t,this._children.length);else{0==e&&this._sortingChildCount++;var n=this._children.indexOf(t),o=this.getInsertPosForSortingChild(t);n<o?this._setChildIndex(t,n,o-1):this._setChildIndex(t,n,o)}},i.prototype.constructFromResource=function(){this.constructFromResource2(null,0)},i.prototype.constructFromResource2=function(e,i){var n,o,r,s,a,h,l,c,u=this.packageItem.getBranch();u.decoded||(u.decoded=!0,t.TranslationHelper.translateComponent(u));var _=u.rawData;_.seek(0,0),this._underConstruct=!0,this.sourceWidth=_.readInt(),this.sourceHeight=_.readInt(),this.initWidth=this.sourceWidth,this.initHeight=this.sourceHeight,this.setSize(this.sourceWidth,this.sourceHeight),_.readBool()&&(this.minWidth=_.readInt(),this.maxWidth=_.readInt(),this.minHeight=_.readInt(),this.maxHeight=_.readInt()),_.readBool()&&(a=_.readFloat(),h=_.readFloat(),this.internalSetPivot(a,h,_.readBool())),_.readBool()&&(this._margin.top=_.readInt(),this._margin.bottom=_.readInt(),this._margin.left=_.readInt(),this._margin.right=_.readInt());var p=_.readByte();if(p==t.OverflowType.Scroll){var d=_.position;_.seek(0,7),this.setupScroll(_),_.position=d}else this.setupOverflow(p);_.readBool()&&_.skip(8),this._buildingDisplayList=!0,_.seek(0,1);var g,f=_.readShort();for(n=0;n<f;n++){s=_.readShort(),s+=_.position;var y=new t.Controller;this._controllers.push(y),y.parent=this,y.setup(_),_.position=s}_.seek(0,2);var m=_.readShort();for(n=0;n<m;n++){if(o=_.readShort(),r=_.position,e)g=e[i+n];else{_.seek(r,0);var b,v=_.readByte(),w=_.readS(),C=_.readS(),S=null;if(null!=w)S=(b=null!=C?t.UIPackage.getById(C):u.owner)?b.getItemById(w):null;S?(g=t.UIObjectFactory.newObject(S)).constructFromResource():g=t.UIObjectFactory.newObject(v)}g._underConstruct=!0,g.setup_beforeAdd(_,r),g.parent=this,this._children.push(g),_.position=r+o}for(_.seek(0,3),this.relations.setup(_,!0),_.seek(0,2),_.skip(2),n=0;n<m;n++)s=_.readShort(),s+=_.position,_.seek(_.position,3),this._children[n].relations.setup(_,!1),_.position=s;for(_.seek(0,2),_.skip(2),n=0;n<m;n++)s=_.readShort(),s+=_.position,(g=this._children[n]).setup_afterAdd(_,_.position),g._underConstruct=!1,_.position=s;_.seek(0,4),_.skip(2),this.opaque=_.readBool();var x=_.readShort();-1!=x&&(this.mask=this.getChildAt(x).displayObject,_.readBool());var T=_.readS();l=_.readInt(),c=_.readInt(),null!=T?(S=u.owner.getItemById(T))&&S.pixelHitTestData&&(this._rootContainer.hitArea=new t.PixelHitTest(S.pixelHitTestData,l,c)):0!=l&&-1!=c&&(this._rootContainer.hitArea=this.getChildAt(c).displayObject),_.seek(0,5);var I=_.readShort();for(n=0;n<I;n++){s=_.readShort(),s+=_.position;var P=new t.Transition(this);P.setup(_),this._transitions.push(P),_.position=s}this._transitions.length>0&&(this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE,this.___added,this),this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE,this.___removed,this)),this.applyAllControllers(),this._buildingDisplayList=!1,this._underConstruct=!1,this.buildNativeDisplayList(),this.setBoundsChangedFlag(),u.objectType!=t.ObjectType.Component&&this.constructExtension(_),this.onConstruct()},i.prototype.onConstruct=function(){this.constructFromXML(null)},i.prototype.constructExtension=function(t){},i.prototype.constructFromXML=function(t){},i.prototype.setup_afterAdd=function(t,i){e.prototype.setup_afterAdd.call(this,t,i),t.seek(i,4);var n=t.readShort();-1!=n&&this._scrollPane&&(this._scrollPane.pageController=this._parent.getControllerAt(n));for(var o=t.readShort(),r=0;r<o;r++){var s=this.getController(t.readS()),a=t.readS();s&&(s.selectedPageId=a)}if(t.version>=2)for(o=t.readShort(),r=0;r<o;r++){var h=t.readS(),l=t.readShort(),c=t.readS(),u=this.getChildByPath(h);u&&u.setProp(l,c)}},i.prototype.___added=function(t){for(var e=this._transitions.length,i=0;i<e;++i)this._transitions[i].onOwnerAddedToStage()},i.prototype.___removed=function(t){for(var e=this._transitions.length,i=0;i<e;++i)this._transitions[i].onOwnerRemovedFromStage()},i}(t.GObject);t.GComponent=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._mode=t.ButtonMode.Common,i._title="",i._icon="",i._sound=t.UIConfig.buttonSound,i._soundVolumeScale=t.UIConfig.buttonSoundVolumeScale,i._changeStateOnClick=!0,i._downEffect=0,i._downEffectValue=.8,i}return __extends(i,e),Object.defineProperty(i.prototype,"icon",{get:function(){return this._icon},set:function(t){this._icon=t,t=this._selected&&this._selectedIcon?this._selectedIcon:this._icon,this._iconObject&&(this._iconObject.icon=t),this.updateGear(7)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedIcon",{get:function(){return this._selectedIcon},set:function(t){this._selectedIcon=t,t=this._selected&&this._selectedIcon?this._selectedIcon:this._icon,this._iconObject&&(this._iconObject.icon=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._title},set:function(t){this._title=t,this._titleObject&&(this._titleObject.text=this._selected&&this._selectedTitle?this._selectedTitle:this._title),this.updateGear(6)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this.title},set:function(t){this.title=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedTitle",{get:function(){return this._selectedTitle},set:function(t){this._selectedTitle=t,this._titleObject&&(this._titleObject.text=this._selected&&this._selectedTitle?this._selectedTitle:this._title)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleColor",{get:function(){var t=this.getTextField();return t?t.color:0},set:function(t){var e=this.getTextField();e&&(e.color=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleFontSize",{get:function(){var t=this.getTextField();return t?t.fontSize:0},set:function(t){var e=this.getTextField();e&&(e.fontSize=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"sound",{get:function(){return this._sound},set:function(t){this._sound=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"soundVolumeScale",{get:function(){return this._soundVolumeScale},set:function(t){this._soundVolumeScale=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this._selected},set:function(e){if(this._mode!=t.ButtonMode.Common&&this._selected!=e){if(this._selected=e,this.grayed&&this._buttonController&&this._buttonController.hasPage(i.DISABLED)?this._selected?this.setState(i.SELECTED_DISABLED):this.setState(i.DISABLED):this._selected?this.setState(this._over?i.SELECTED_OVER:i.DOWN):this.setState(this._over?i.OVER:i.UP),this._selectedTitle&&this._titleObject&&(this._titleObject.text=this._selected?this._selectedTitle:this._title),this._selectedIcon){var n=this._selected?this._selectedIcon:this._icon;this._iconObject&&(this._iconObject.icon=n)}this._relatedController&&this._parent&&!this._parent._buildingDisplayList&&(this._selected?(this._relatedController.selectedPageId=this._relatedPageId,this._relatedController.autoRadioGroupDepth&&this._parent.adjustRadioGroupDepth(this,this._relatedController)):this._mode==t.ButtonMode.Check&&this._relatedController.selectedPageId==this._relatedPageId&&(this._relatedController.oppositePageId=this._relatedPageId))}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mode",{get:function(){return this._mode},set:function(e){this._mode!=e&&(e==t.ButtonMode.Common&&(this.selected=!1),this._mode=e)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"relatedController",{get:function(){return this._relatedController},set:function(t){this._relatedController=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"relatedPageId",{get:function(){return this._relatedPageId},set:function(t){this._relatedPageId=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"changeStateOnClick",{get:function(){return this._changeStateOnClick},set:function(t){this._changeStateOnClick=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"linkedPopup",{get:function(){return this._linkedPopup},set:function(t){this._linkedPopup=t},enumerable:!0,configurable:!0}),i.prototype.getTextField=function(){return this._titleObject instanceof t.GTextField?this._titleObject:this._titleObject instanceof t.GLabel||this._titleObject instanceof i?this._titleObject.getTextField():null},i.prototype.addStateListener=function(e,i){this.addEventListener(t.StateChangeEvent.CHANGED,e,i)},i.prototype.removeStateListener=function(e,i){this.removeEventListener(t.StateChangeEvent.CHANGED,e,i)},i.prototype.fireClick=function(e){e&&this._mode==t.ButtonMode.Common&&(this.setState(i.OVER),t.GTimers.inst.add(100,1,function(){this.setState(i.DOWN)},this),t.GTimers.inst.add(200,1,function(){this.setState(i.UP)},this)),this.__click(null)},i.prototype.setState=function(e){if(this._buttonController&&(this._buttonController.selectedPage=e),1==this._downEffect){var n=this.numChildren;if(e==i.DOWN||e==i.SELECTED_OVER||e==i.SELECTED_DISABLED)for(var o=255*this._downEffectValue,r=(o<<16)+(o<<8)+o,s=0;s<n;s++){null==(a=this.getChildAt(s)).color||a instanceof t.GTextField||(a.color=r)}else for(s=0;s<n;s++){var a;null==(a=this.getChildAt(s)).color||a instanceof t.GTextField||(a.color=16777215)}}else 2==this._downEffect&&(e==i.DOWN||e==i.SELECTED_OVER||e==i.SELECTED_DISABLED?this._downScaled||(this._downScaled=!0,this._rootContainer.cacheHitArea(!0),this.setScale(this.scaleX*this._downEffectValue,this.scaleY*this._downEffectValue)):this._downScaled&&(this._downScaled=!1,this._rootContainer.cacheHitArea(!1),this.setScale(this.scaleX/this._downEffectValue,this.scaleY/this._downEffectValue)))},i.prototype.handleControllerChanged=function(t){e.prototype.handleControllerChanged.call(this,t),this._relatedController==t&&(this.selected=this._relatedPageId==t.selectedPageId)},i.prototype.handleGrayedChanged=function(){this._buttonController&&this._buttonController.hasPage(i.DISABLED)?this.grayed?this._selected&&this._buttonController.hasPage(i.SELECTED_DISABLED)?this.setState(i.SELECTED_DISABLED):this.setState(i.DISABLED):this._selected?this.setState(i.DOWN):this.setState(i.UP):e.prototype.handleGrayedChanged.call(this)},i.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.titleColor;case t.ObjectPropID.OutlineColor:var n=this.getTextField();return n?n.strokeColor:0;case t.ObjectPropID.FontSize:return this.titleFontSize;case t.ObjectPropID.Selected:return this.selected;default:return e.prototype.getProp.call(this,i)}},i.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.titleColor=n;break;case t.ObjectPropID.OutlineColor:var o=this.getTextField();o&&(o.strokeColor=n);break;case t.ObjectPropID.FontSize:this.titleFontSize=n;break;case t.ObjectPropID.Selected:this.selected=n;break;default:e.prototype.setProp.call(this,i,n)}},i.prototype.constructExtension=function(e){e.seek(0,6),this._mode=e.readByte();var n=e.readS();n&&(this._sound=n),this._soundVolumeScale=e.readFloat(),this._downEffect=e.readByte(),this._downEffectValue=e.readFloat(),2==this._downEffect&&this.setPivot(.5,.5,this.pivotAsAnchor),this._buttonController=this.getController("button"),this._titleObject=this.getChild("title"),this._iconObject=this.getChild("icon"),this._titleObject&&(this._title=this._titleObject.text),this._iconObject&&(this._icon=this._iconObject.icon),this._mode==t.ButtonMode.Common&&this.setState(i.UP),this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__mousedown,this),this.addEventListener(egret.TouchEvent.TOUCH_TAP,this.__click,this)},i.prototype.setup_afterAdd=function(t,i){var n,o;(e.prototype.setup_afterAdd.call(this,t,i),t.seek(i,6))&&(t.readByte()==this.packageItem.objectType&&(null!=(n=t.readS())&&(this.title=n),null!=(n=t.readS())&&(this.selectedTitle=n),null!=(n=t.readS())&&(this.icon=n),null!=(n=t.readS())&&(this.selectedIcon=n),t.readBool()&&(this.titleColor=t.readColor()),0!=(o=t.readInt())&&(this.titleFontSize=o),(o=t.readShort())>=0&&(this._relatedController=this.parent.getControllerAt(o)),this._relatedPageId=t.readS(),null!=(n=t.readS())&&(this._sound=n),t.readBool()&&(this._soundVolumeScale=t.readFloat()),this.selected=t.readBool()))},i.prototype.__mousedown=function(e){this._down=!0,t.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END,this.__mouseup,this),this._mode==t.ButtonMode.Common&&(this.grayed&&this._buttonController&&this._buttonController.hasPage(i.DISABLED)?this.setState(i.SELECTED_DISABLED):this.setState(i.DOWN)),this._linkedPopup&&(this._linkedPopup instanceof t.Window?this._linkedPopup.toggleStatus():this.root.togglePopup(this._linkedPopup,this))},i.prototype.__mouseup=function(e){if(this._down){if(t.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END,this.__mouseup,this),this._down=!1,!this.displayObject)return;this._mode==t.ButtonMode.Common&&(this.grayed&&this._buttonController&&this._buttonController.hasPage(i.DISABLED)?this.setState(i.DISABLED):this._over?this.setState(i.OVER):this.setState(i.UP))}},i.prototype.__click=function(e){if(this._sound){var i=t.UIPackage.getItemByURL(this._sound);if(i){var n=i.owner.getItemAsset(i);n&&t.GRoot.inst.playOneShotSound(n,this._soundVolumeScale)}}this._mode==t.ButtonMode.Check?this._changeStateOnClick&&(this.selected=!this._selected,this.dispatchEvent(new t.StateChangeEvent(t.StateChangeEvent.CHANGED))):this._mode==t.ButtonMode.Radio?this._changeStateOnClick&&!this._selected&&(this.selected=!0,this.dispatchEvent(new t.StateChangeEvent(t.StateChangeEvent.CHANGED))):this._relatedController&&(this._relatedController.selectedPageId=this._relatedPageId)},i.UP="up",i.DOWN="down",i.OVER="over",i.SELECTED_OVER="selectedOver",i.DISABLED="disabled",i.SELECTED_DISABLED="selectedDisabled",i}(t.GComponent);t.GButton=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._visibleItemCount=0,i._selectedIndex=0,i._popupDirection=t.PopupDirection.Auto,i._visibleItemCount=t.UIConfig.defaultComboBoxVisibleItemCount,i._itemsUpdated=!0,i._selectedIndex=-1,i._items=[],i._values=[],i}return __extends(i,e),Object.defineProperty(i.prototype,"text",{get:function(){return this._titleObject?this._titleObject.text:null},set:function(t){this._titleObject&&(this._titleObject.text=t),this.updateGear(6)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"icon",{get:function(){return this._iconObject?this._iconObject.icon:null},set:function(t){this._iconObject&&(this._iconObject.icon=t),this.updateGear(7)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleColor",{get:function(){var t=this.getTextField();return t?t.color:0},set:function(t){var e=this.getTextField();e&&(e.color=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleFontSize",{get:function(){var t=this.getTextField();return t?t.fontSize:0},set:function(t){var e=this.getTextField();e&&(e.fontSize=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"visibleItemCount",{get:function(){return this._visibleItemCount},set:function(t){this._visibleItemCount=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"popupDirection",{get:function(){return this._popupDirection},set:function(t){this._popupDirection=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"items",{get:function(){return this._items},set:function(t){t?this._items=t.concat():this._items.length=0,this._items.length>0?(this._selectedIndex>=this._items.length?this._selectedIndex=this._items.length-1:-1==this._selectedIndex&&(this._selectedIndex=0),this.text=this._items[this._selectedIndex],this._icons&&this._selectedIndex<this._icons.length&&(this.icon=this._icons[this._selectedIndex])):(this.text="",this._icons&&(this.icon=null),this._selectedIndex=-1),this._itemsUpdated=!0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"icons",{get:function(){return this._icons},set:function(t){this._icons=t,this._icons&&-1!=this._selectedIndex&&this._selectedIndex<this._icons.length&&(this.icon=this._icons[this._selectedIndex])},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"values",{get:function(){return this._values},set:function(t){t?this._values=t.concat():this._values.length=0},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){this._selectedIndex!=t&&(this._selectedIndex=t,this._selectedIndex>=0&&this._selectedIndex<this._items.length?(this.text=this._items[this._selectedIndex],this._icons&&this._selectedIndex<this._icons.length&&(this.icon=this._icons[this._selectedIndex])):(this.text="",this._icons&&(this.icon=null)),this.updateSelectionController())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this._values[this._selectedIndex]},set:function(t){var e=this._values.indexOf(t);-1==e&&null==t&&(e=this._values.indexOf("")),this.selectedIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"selectionController",{get:function(){return this._selectionController},set:function(t){this._selectionController=t},enumerable:!0,configurable:!0}),i.prototype.getTextField=function(){return this._titleObject instanceof t.GTextField?this._titleObject:this._titleObject instanceof t.GLabel||this._titleObject instanceof t.GButton?this._titleObject.getTextField():null},i.prototype.setState=function(t){this._buttonController&&(this._buttonController.selectedPage=t)},i.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.titleColor;case t.ObjectPropID.OutlineColor:var n=this.getTextField();return n?n.strokeColor:0;case t.ObjectPropID.FontSize:return(n=this.getTextField())?n.fontSize:0;default:return e.prototype.getProp.call(this,i)}},i.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.titleColor=n;break;case t.ObjectPropID.OutlineColor:var o=this.getTextField();o&&(o.strokeColor=n);break;case t.ObjectPropID.FontSize:(o=this.getTextField())&&(o.fontSize=n);break;default:e.prototype.setProp.call(this,i,n)}},i.prototype.constructExtension=function(e){var i;if(this._buttonController=this.getController("button"),this._titleObject=this.getChild("title"),this._iconObject=this.getChild("icon"),i=e.readS()){if(this.dropdown=t.UIPackage.createObjectFromURL(i),!this.dropdown)return void console.error("下拉框必须为元件");if(this.dropdown.name="this.dropdown",this._list=this.dropdown.getChild("list").asList,null==this._list)return void console.error(this.resourceURL+": 下拉框的弹出元件里必须包含名为list的列表");this._list.addEventListener(t.ItemEvent.CLICK,this.__clickItem,this),this._list.addRelation(this.dropdown,t.RelationType.Width),this._list.removeRelation(this.dropdown,t.RelationType.Height),this.dropdown.addRelation(this._list,t.RelationType.Height),this.dropdown.removeRelation(this._list,t.RelationType.Width),this.dropdown.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE,this.__popupWinClosed,this)}this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__mousedown,this)},i.prototype.handleControllerChanged=function(t){e.prototype.handleControllerChanged.call(this,t),this._selectionController==t&&(this.selectedIndex=t.selectedIndex)},i.prototype.updateSelectionController=function(){if(this._selectionController&&!this._selectionController.changing&&this._selectedIndex<this._selectionController.pageCount){var t=this._selectionController;this._selectionController=null,t.selectedIndex=this._selectedIndex,this._selectionController=t}},i.prototype.dispose=function(){this.dropdown&&(this.dropdown.dispose(),this.dropdown=null),e.prototype.dispose.call(this)},i.prototype.setup_afterAdd=function(t,i){if(e.prototype.setup_afterAdd.call(this,t,i),t.seek(i,6)&&t.readByte()==this.packageItem.objectType){var n,o,r,s,a=t.readShort();for(n=0;n<a;n++)r=t.readShort(),r+=t.position,this._items[n]=t.readS(),this._values[n]=t.readS(),null!=(s=t.readS())&&(null==this._icons&&(this._icons=new Array),this._icons[n]=s),t.position=r;null!=(s=t.readS())?(this.text=s,this._selectedIndex=this._items.indexOf(s)):this._items.length>0?(this._selectedIndex=0,this.text=this._items[0]):this._selectedIndex=-1,null!=(s=t.readS())&&(this.icon=s),t.readBool()&&(this.titleColor=t.readColor()),(o=t.readInt())>0&&(this._visibleItemCount=o),this._popupDirection=t.readByte(),(o=t.readShort())>=0&&(this._selectionController=this.parent.getControllerAt(o))}},i.prototype.showDropdown=function(){if(this._itemsUpdated){this._itemsUpdated=!1,this._list.removeChildrenToPool();for(var e=this._items.length,i=0;i<e;i++){var n=this._list.addItemFromPool();n.name=i<this._values.length?this._values[i]:"",n.text=this._items[i],n.icon=this._icons&&i<this._icons.length?this._icons[i]:null}this._list.resizeToFit(this._visibleItemCount)}this._list.selectedIndex=-1,this.dropdown.width=this.width,this._list.ensureBoundsCorrect(),this.root.togglePopup(this.dropdown,this,this._popupDirection),this.dropdown.parent&&this.setState(t.GButton.DOWN)},i.prototype.__popupWinClosed=function(e){this._over?this.setState(t.GButton.OVER):this.setState(t.GButton.UP)},i.prototype.__clickItem=function(e){t.GTimers.inst.add(100,1,this.__clickItem2,this,this._list.getChildIndex(e.itemObject))},i.prototype.__clickItem2=function(e){this.dropdown.parent instanceof t.GRoot&&this.dropdown.parent.hidePopup(),this._selectedIndex=-1,this.selectedIndex=e,this.dispatchEvent(new t.StateChangeEvent(t.StateChangeEvent.CHANGED))},i.prototype.__mousedown=function(e){e.target instanceof egret.TextField&&e.target.type==egret.TextFieldType.INPUT||(this._down=!0,t.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END,this.__mouseup,this),this.dropdown&&this.showDropdown())},i.prototype.__mouseup=function(e){this._down&&(this._down=!1,t.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END,this.__mouseup,this),this.dropdown&&!this.dropdown.parent&&(this._over?this.setState(t.GButton.OVER):this.setState(t.GButton.UP)))},i}(t.GComponent);t.GComboBox=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._type=0,t._lineSize=0,t._lineColor=0,t._fillColor=0,t._lineSize=1,t._lineAlpha=1,t._fillAlpha=1,t._fillColor=16777215,t}return __extends(i,e),Object.defineProperty(i.prototype,"graphics",{get:function(){return this._graphics},enumerable:!0,configurable:!0}),i.prototype.drawRect=function(t,e,i,n,o,r){this._type=1,this._lineSize=t,this._lineColor=e,this._lineAlpha=i,this._fillColor=n,this._fillAlpha=o,this._cornerRadius=r,this.updateGraph()},i.prototype.drawEllipse=function(t,e,i,n,o){this._type=2,this._lineSize=t,this._lineColor=e,this._lineAlpha=i,this._fillColor=n,this._fillAlpha=o,this._cornerRadius=null,this.updateGraph()},i.prototype.drawRegularPolygon=function(t,e,i,n,o,r,s,a){this._type=4,this._lineSize=t,this._lineColor=e,this._lineAlpha=i,this._fillColor=n,this._fillAlpha=o,this._sides=r,this._startAngle=s||0,this._distances=a,this.updateGraph()},i.prototype.drawPolygon=function(t,e,i,n,o,r){this._type=3,this._lineSize=t,this._lineColor=e,this._lineAlpha=i,this._fillColor=n,this._fillAlpha=o,this._polygonPoints=r,this.updateGraph()},Object.defineProperty(i.prototype,"distances",{get:function(){return this._distances},set:function(t){this._distances=t,3==this._type&&this.updateGraph()},enumerable:!0,configurable:!0}),i.prototype.clearGraphics=function(){this._graphics&&(this._type=0,this._graphics.clear())},Object.defineProperty(i.prototype,"color",{get:function(){return this._fillColor},set:function(t){this._fillColor=t,0!=this._type&&this.updateGraph()},enumerable:!0,configurable:!0}),i.prototype.updateGraph=function(){var e=this.graphics;e.clear();var i=this.width,n=this.height;if(0!=i&&0!=n){if(0==this._lineSize?e.lineStyle(0,0,0):e.lineStyle(this._lineSize,this._lineColor,this._lineAlpha),e.beginFill(this._fillColor,this._fillAlpha),1==this._type)this._cornerRadius?1==this._cornerRadius.length?e.drawRoundRect(0,0,i,n,2*this._cornerRadius[0],2*this._cornerRadius[0]):e.drawRoundRect(0,0,i,n,2*this._cornerRadius[0],2*this._cornerRadius[1]):e.drawRect(0,0,i,n);else if(2==this._type)e.drawEllipse(0,0,i,n);else if(3==this._type)t.ToolSet.fillPath(e,this._polygonPoints,0,0);else if(4==this._type){this._polygonPoints||(this._polygonPoints=[]);var o=Math.min(this._width,this._height)/2;this._polygonPoints.length=0;for(var r,s=this._startAngle*Math.PI/180,a=2*Math.PI/this._sides,h=0;h<this._sides;h++){this._distances?(r=this._distances[h],isNaN(r)&&(r=1)):r=1;var l=o+o*r*Math.cos(s),c=o+o*r*Math.sin(s);this._polygonPoints.push(l,c),s+=a}t.ToolSet.fillPath(e,this._polygonPoints,0,0)}e.endFill()}},i.prototype.replaceMe=function(t){if(!this._parent)throw"parent not set";t.name=this.name,t.alpha=this.alpha,t.rotation=this.rotation,t.visible=this.visible,t.touchable=this.touchable,t.grayed=this.grayed,t.setXY(this.x,this.y),t.setSize(this.width,this.height);var e=this._parent.getChildIndex(this);this._parent.addChildAt(t,e),t.relations.copyFrom(this.relations),this._parent.removeChild(this,!0)},i.prototype.addBeforeMe=function(t){if(null==this._parent)throw"parent not set";var e=this._parent.getChildIndex(this);this._parent.addChildAt(t,e)},i.prototype.addAfterMe=function(t){if(null==this._parent)throw"parent not set";var e=this._parent.getChildIndex(this);e++,this._parent.addChildAt(t,e)},i.prototype.setNativeObject=function(t){var e=new egret.Sprite;this.setDisplayObject(e),this._parent&&this._parent.childStateChanged(this),this.handleXYChanged(),e.alpha=this.alpha,e.rotation=this.rotation,e.visible=this.visible,e.touchEnabled=this.touchable,e.touchChildren=this.touchable,e.addChild(t)},i.prototype.createDisplayObject=function(){var t=new egret.Sprite;t.touchEnabled=!0,this._graphics=t.graphics,this.setDisplayObject(t)},i.prototype.getProp=function(i){return i==t.ObjectPropID.Color?this.color:e.prototype.getProp.call(this,i)},i.prototype.setProp=function(i,n){i==t.ObjectPropID.Color?this.color=n:e.prototype.setProp.call(this,i,n)},i.prototype.handleSizeChanged=function(){e.prototype.handleSizeChanged.call(this),0!=this._type&&this.updateGraph()},i.prototype.setup_beforeAdd=function(t,i){if(e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,5),this._type=t.readByte(),0!=this._type){var n,o;this._lineSize=t.readInt();var r=t.readColor(!0);if(this._lineColor=16777215&r,this._lineAlpha=(r>>24&255)/255,r=t.readColor(!0),this._fillColor=16777215&r,this._fillAlpha=(r>>24&255)/255,t.readBool())for(this._cornerRadius=new Array(4),n=0;n<4;n++)this._cornerRadius[n]=t.readFloat();if(3==this._type)for(o=t.readShort(),this._polygonPoints=[],this._polygonPoints.length=o,n=0;n<o;n++)this._polygonPoints[n]=t.readFloat();else if(4==this._type&&(this._sides=t.readShort(),this._startAngle=t.readFloat(),(o=t.readShort())>0))for(this._distances=[],n=0;n<o;n++)this._distances[n]=t.readFloat();this.updateGraph()}},i}(t.GObject);t.GGraph=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._layout=0,t._lineGap=0,t._columnGap=0,t._mainGridIndex=-1,t._mainGridMinSize=50,t._mainChildIndex=-1,t._totalSize=0,t._numChildren=0,t._updating=0,t}return __extends(i,e),i.prototype.dispose=function(){this._boundsChanged=!1,e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout!=t&&(this._layout=t,this.setBoundsChangedFlag())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"lineGap",{get:function(){return this._lineGap},set:function(t){this._lineGap!=t&&(this._lineGap=t,this.setBoundsChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"columnGap",{get:function(){return this._columnGap},set:function(t){this._columnGap!=t&&(this._columnGap=t,this.setBoundsChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"excludeInvisibles",{get:function(){return this._excludeInvisibles},set:function(t){this._excludeInvisibles!=t&&(this._excludeInvisibles=t,this.setBoundsChangedFlag())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"autoSizeDisabled",{get:function(){return this._autoSizeDisabled},set:function(t){this._autoSizeDisabled=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mainGridMinSize",{get:function(){return this._mainGridMinSize},set:function(t){this._mainGridMinSize!=t&&(this._mainGridMinSize=t,this.setBoundsChangedFlag())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mainGridIndex",{get:function(){return this._mainGridIndex},set:function(t){this._mainGridIndex!=t&&(this._mainGridIndex=t,this.setBoundsChangedFlag())},enumerable:!0,configurable:!0}),i.prototype.setBoundsChangedFlag=function(e){0==this._updating&&this._parent&&(e||(this._percentReady=!1),this._boundsChanged||(this._boundsChanged=!0,this._layout!=t.GroupLayoutType.None&&t.GTimers.inst.callLater(this.ensureBoundsCorrect,this)))},i.prototype.ensureSizeCorrect=function(){null!=this._parent&&this._boundsChanged&&0!=this._layout&&(this._boundsChanged=!1,this._autoSizeDisabled?this.resizeChildren(0,0):(this.handleLayout(),this.updateBounds()))},i.prototype.ensureBoundsCorrect=function(){null!=this._parent&&this._boundsChanged&&(this._boundsChanged=!1,0==this._layout?this.updateBounds():this._autoSizeDisabled?this.resizeChildren(0,0):(this.handleLayout(),this.updateBounds()))},i.prototype.updateBounds=function(){t.GTimers.inst.remove(this.ensureBoundsCorrect,this);var e,i,n,o=this._parent.numChildren,r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=!0;for(e=0;e<o;e++)(i=this._parent.getChildAt(e)).group!=this||this._excludeInvisibles&&!i.internalVisible3||((n=i.xMin)<r&&(r=n),(n=i.yMin)<s&&(s=n),(n=i.xMin+i.width)>a&&(a=n),(n=i.yMin+i.height)>h&&(h=n),l=!1);var c=0,u=0;l||(this._updating|=1,this.setXY(r,s),this._updating&=2,c=a-r,u=h-s),0==(2&this._updating)?(this._updating|=2,this.setSize(c,u),this._updating&=1):(this._updating&=1,this.resizeChildren(this._width-c,this._height-u))},i.prototype.handleLayout=function(){var e,i,n;if(this._updating|=1,this._layout==t.GroupLayoutType.Horizontal){var o=this.x;for(n=this._parent.numChildren,i=0;i<n;i++)(e=this._parent.getChildAt(i)).group==this&&(this._excludeInvisibles&&!e.internalVisible3||(e.xMin=o,0!=e.width&&(o+=e.width+this._columnGap)))}else if(this._layout==t.GroupLayoutType.Vertical){var r=this.y;for(n=this._parent.numChildren,i=0;i<n;i++)(e=this._parent.getChildAt(i)).group==this&&(this._excludeInvisibles&&!e.internalVisible3||(e.yMin=r,0!=e.height&&(r+=e.height+this._lineGap)))}this._updating&=2},i.prototype.moveChildren=function(t,e){if(0==(1&this._updating)&&null!=this._parent){this._updating|=1;var i,n,o=this._parent.numChildren;for(i=0;i<o;i++)(n=this._parent.getChildAt(i)).group==this&&n.setXY(n.x+t,n.y+e);this._updating&=2}},i.prototype.resizeChildren=function(e,i){if(this._layout!=t.GroupLayoutType.None&&0==(2&this._updating)&&null!=this._parent)if(this._updating|=2,!this._boundsChanged||(this._boundsChanged=!1,this._autoSizeDisabled)){var n,o,r=this._parent.numChildren;if(!this._percentReady){this._percentReady=!0,this._numChildren=0,this._totalSize=0,this._mainChildIndex=-1;var s=0;for(n=0;n<r;n++)(o=this._parent.getChildAt(n)).group==this&&(this._excludeInvisibles&&!o.internalVisible3||(s==this._mainGridIndex&&(this._mainChildIndex=n),this._numChildren++,1==this._layout?this._totalSize+=o.width:this._totalSize+=o.height),s++);for(-1!=this._mainChildIndex&&(1==this._layout?(o=this._parent.getChildAt(this._mainChildIndex),this._totalSize+=this._mainGridMinSize-o.width,o._sizePercentInGroup=this._mainGridMinSize/this._totalSize):(o=this._parent.getChildAt(this._mainChildIndex),this._totalSize+=this._mainGridMinSize-o.height,o._sizePercentInGroup=this._mainGridMinSize/this._totalSize)),n=0;n<r;n++)(o=this._parent.getChildAt(n)).group==this&&n!=this._mainChildIndex&&(this._totalSize>0?o._sizePercentInGroup=(1==this._layout?o.width:o.height)/this._totalSize:o._sizePercentInGroup=0)}var a=0,h=1,l=!1;if(1==this._layout){a=this.width-(this._numChildren-1)*this._columnGap,-1!=this._mainChildIndex&&a>=this._totalSize&&((o=this._parent.getChildAt(this._mainChildIndex)).setSize(a-(this._totalSize-this._mainGridMinSize),o._rawHeight+i,!0),a-=o.width,h-=o._sizePercentInGroup,l=!0);var c=this.x;for(n=0;n<r;n++)(o=this._parent.getChildAt(n)).group==this&&(!this._excludeInvisibles||o.internalVisible3?(l&&n==this._mainChildIndex||(o.setSize(Math.round(o._sizePercentInGroup/h*a),o._rawHeight+i,!0),h-=o._sizePercentInGroup,a-=o.width),o.xMin=c,0!=o.width&&(c+=o.width+this._columnGap)):o.setSize(o._rawWidth,o._rawHeight+i,!0))}else{a=this.height-(this._numChildren-1)*this._lineGap,-1!=this._mainChildIndex&&a>=this._totalSize&&((o=this._parent.getChildAt(this._mainChildIndex)).setSize(o._rawWidth+e,a-(this._totalSize-this._mainGridMinSize),!0),a-=o.height,h-=o._sizePercentInGroup,l=!0);var u=this.y;for(n=0;n<r;n++)(o=this._parent.getChildAt(n)).group==this&&(!this._excludeInvisibles||o.internalVisible3?(l&&n==this._mainChildIndex||(o.setSize(o._rawWidth+e,Math.round(o._sizePercentInGroup/h*a),!0),h-=o._sizePercentInGroup,a-=o.height),o.yMin=u,0!=o.height&&(u+=o.height+this._lineGap)):o.setSize(o._rawWidth+e,o._rawHeight,!0))}this._updating&=1}else this.updateBounds()},i.prototype.handleAlphaChanged=function(){if(!this._underConstruct)for(var t=this._parent.numChildren,e=0;e<t;e++){var i=this._parent.getChildAt(e);i.group==this&&(i.alpha=this.alpha)}},i.prototype.handleVisibleChanged=function(){if(this._parent)for(var t=this._parent.numChildren,e=0;e<t;e++){var i=this._parent.getChildAt(e);i.group==this&&i.handleVisibleChanged()}},i.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,5),this._layout=t.readByte(),this._lineGap=t.readInt(),this._columnGap=t.readInt(),t.version>=2&&(this._excludeInvisibles=t.readBool(),this._autoSizeDisabled=t.readBool(),this._mainChildIndex=t.readInt())},i.prototype.setup_afterAdd=function(t,i){e.prototype.setup_afterAdd.call(this,t,i),this.visible||this.handleVisibleChanged()},i}(t.GObject);t.GGroup=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._flip=t.FlipType.None,i}return __extends(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this._content.color},set:function(t){this._content.color!=t&&(this._content.color=t,this.updateGear(4))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"flip",{get:function(){return this._flip},set:function(e){if(this._flip!=e){this._flip=e;var i=1,n=1;this._flip!=t.FlipType.Horizontal&&this._flip!=t.FlipType.Both||(i=-1),this._flip!=t.FlipType.Vertical&&this._flip!=t.FlipType.Both||(n=-1),this._content.scaleX=i,this._content.scaleY=n,this.handleXYChanged()}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillMethod",{get:function(){return this._content.fillMethod},set:function(t){this._content.fillMethod=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillOrigin",{get:function(){return this._content.fillOrigin},set:function(t){this._content.fillOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillClockwise",{get:function(){return this._content.fillClockwise},set:function(t){this._content.fillClockwise=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillAmount",{get:function(){return this._content.fillAmount},set:function(t){this._content.fillAmount=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"texture",{get:function(){return this._content.texture},set:function(t){t?(this.sourceWidth=t.textureWidth,this.sourceHeight=t.textureHeight):(this.sourceWidth=0,this.sourceHeight=0),this.initWidth=this.sourceWidth,this.initHeight=this.sourceHeight,this._content.scale9Grid=null,this._content.fillMode=egret.BitmapFillMode.SCALE,this._content.texture=t},enumerable:!0,configurable:!0}),i.prototype.createDisplayObject=function(){this._content=new t.Image,this._content.touchEnabled=!1,this.setDisplayObject(this._content)},i.prototype.constructFromResource=function(){var t=this.packageItem.getBranch();this.sourceWidth=t.width,this.sourceHeight=t.height,this.initWidth=this.sourceWidth,this.initHeight=this.sourceHeight,this.setSize(this.sourceWidth,this.sourceHeight),(t=t.getHighResolution()).load(),this._content.scale9Grid=t.scale9Grid,this._content.smoothing=t.smoothing,t.scaleByTile&&(this._content.fillMode=egret.BitmapFillMode.REPEAT),this.setSize(this.sourceWidth,this.sourceHeight),this._content.texture=t.asset},i.prototype.handleXYChanged=function(){e.prototype.handleXYChanged.call(this),this._flip!=t.FlipType.None&&(-1==this._content.scaleX&&(this._content.x+=this.width),-1==this._content.scaleY&&(this._content.y+=this.height))},i.prototype.getProp=function(i){return i==t.ObjectPropID.Color?this.color:e.prototype.getProp.call(this,i)},i.prototype.setProp=function(i,n){i==t.ObjectPropID.Color?this.color=n:e.prototype.setProp.call(this,i,n)},i.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,5),t.readBool()&&(this.color=t.readColor()),this.flip=t.readByte(),this._content.fillMethod=t.readByte(),0!=this._content.fillMethod&&(this._content.fillOrigin=t.readByte(),this._content.fillClockwise=t.readBool(),this._content.fillAmount=t.readFloat())},i}(t.GObject);t.GImage=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){return e.call(this)||this}return __extends(i,e),Object.defineProperty(i.prototype,"icon",{get:function(){if(this._iconObject)return this._iconObject.icon},set:function(t){this._iconObject&&(this._iconObject.icon=t),this.updateGear(7)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._titleObject?this._titleObject.text:null},set:function(t){this._titleObject&&(this._titleObject.text=t),this.updateGear(6)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"text",{get:function(){return this.title},set:function(t){this.title=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleColor",{get:function(){var t=this.getTextField();return t?t.color:0},set:function(t){var e=this.getTextField();e&&(e.color=t),this.updateGear(4)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleFontSize",{get:function(){var t=this.getTextField();return t?t.fontSize:0},set:function(t){var e=this.getTextField();e&&(e.fontSize=t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"editable",{get:function(){return!!(this._titleObject&&this._titleObject instanceof t.GTextInput)&&this._titleObject.asTextInput.editable},set:function(t){this._titleObject&&(this._titleObject.asTextInput.editable=t)},enumerable:!0,configurable:!0}),i.prototype.getTextField=function(){return this._titleObject instanceof t.GTextField?this._titleObject:this._titleObject instanceof i||this._titleObject instanceof t.GButton?this._titleObject.getTextField():null},i.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.titleColor;case t.ObjectPropID.OutlineColor:var n=this.getTextField();return n?n.strokeColor:0;case t.ObjectPropID.FontSize:return this.titleFontSize;default:return e.prototype.getProp.call(this,i)}},i.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.titleColor=n;break;case t.ObjectPropID.OutlineColor:var o=this.getTextField();o&&(o.strokeColor=n);break;case t.ObjectPropID.FontSize:this.titleFontSize=n;break;default:e.prototype.setProp.call(this,i,n)}},i.prototype.constructExtension=function(t){this._titleObject=this.getChild("title"),this._iconObject=this.getChild("icon")},i.prototype.setup_afterAdd=function(i,n){if(e.prototype.setup_afterAdd.call(this,i,n),i.seek(n,6)&&i.readByte()==this.packageItem.objectType){var o;null!=(o=i.readS())&&(this.title=o),null!=(o=i.readS())&&(this.icon=o),i.readBool()&&(this.titleColor=i.readColor());var r=i.readInt();if(0!=r&&(this.titleFontSize=r),i.readBool()){var s=this.getTextField();s instanceof t.GTextInput?(null!=(o=i.readS())&&(s.promptText=o),null!=(o=i.readS())&&(s.restrict=o),0!=(r=i.readInt())&&(s.maxLength=r),r=i.readInt(),i.readBool()&&(s.password=!0)):i.skip(13)}}},i}(t.GComponent);t.GLabel=e}(fgui||(fgui={})),function(t){var e=function(e){function n(){var i=e.call(this)||this;return i.scrollItemToViewOnClick=!0,i.foldInvisibleItems=!1,i._lineCount=0,i._columnCount=0,i._lineGap=0,i._columnGap=0,i._lastSelectedIndex=0,i._numItems=0,i._realNumItems=0,i._firstIndex=0,i._curLineItemCount=0,i._curLineItemCount2=0,i._virtualListChanged=0,i.itemInfoVer=0,i._trackBounds=!0,i._pool=new t.GObjectPool,i._layout=t.ListLayoutType.SingleColumn,i._autoResizeItem=!0,i._lastSelectedIndex=-1,i._selectionMode=t.ListSelectionMode.Single,i.opaque=!0,i._align=t.AlignType.Left,i._verticalAlign=t.VertAlignType.Top,i._container=new egret.DisplayObjectContainer,i._rootContainer.addChild(i._container),i}return __extends(n,e),n.prototype.dispose=function(){this._pool.clear(),e.prototype.dispose.call(this)},Object.defineProperty(n.prototype,"layout",{get:function(){return this._layout},set:function(t){this._layout!=t&&(this._layout=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lineCount",{get:function(){return this._lineCount},set:function(t){this._lineCount!=t&&(this._lineCount=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"columnCount",{get:function(){return this._columnCount},set:function(t){this._columnCount!=t&&(this._columnCount=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"lineGap",{get:function(){return this._lineGap},set:function(t){this._lineGap!=t&&(this._lineGap=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"columnGap",{get:function(){return this._columnGap},set:function(t){this._columnGap!=t&&(this._columnGap=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this._align},set:function(t){this._align!=t&&(this._align=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(t){this._verticalAlign!=t&&(this._verticalAlign=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"virtualItemSize",{get:function(){return this._itemSize},set:function(t){this._virtual&&(this._itemSize||(this._itemSize=new egret.Point),this._itemSize.copyFrom(t),this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"defaultItem",{get:function(){return this._defaultItem},set:function(t){this._defaultItem=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"autoResizeItem",{get:function(){return this._autoResizeItem},set:function(t){this._autoResizeItem!=t&&(this._autoResizeItem=t,this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectionMode",{get:function(){return this._selectionMode},set:function(t){this._selectionMode=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectionController",{get:function(){return this._selectionController},set:function(t){this._selectionController=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"itemPool",{get:function(){return this._pool},enumerable:!0,configurable:!0}),n.prototype.getFromPool=function(t){t||(t=this._defaultItem);var e=this._pool.getObject(t);return e&&(e.visible=!0),e},n.prototype.returnToPool=function(t){t.displayObject.cacheAsBitmap=!1,this._pool.returnObject(t)},n.prototype.addChildAt=function(i,n){return e.prototype.addChildAt.call(this,i,n),i instanceof t.GButton&&(i.selected=!1,i.changeStateOnClick=!1),i.addEventListener(egret.TouchEvent.TOUCH_TAP,this.__clickItem,this),i},n.prototype.addItem=function(e){return e||(e=this._defaultItem),this.addChild(t.UIPackage.createObjectFromURL(e))},n.prototype.addItemFromPool=function(t){return this.addChild(this.getFromPool(t))},n.prototype.removeChildAt=function(t,i){var n=e.prototype.removeChildAt.call(this,t,i);return n.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.__clickItem,this),n},n.prototype.removeChildToPoolAt=function(t){var i=e.prototype.removeChildAt.call(this,t);this.returnToPool(i)},n.prototype.removeChildToPool=function(t){e.prototype.removeChild.call(this,t),this.returnToPool(t)},n.prototype.removeChildrenToPool=function(t,e){null==t&&(t=0),null==e&&(e=-1),(e<0||e>=this._children.length)&&(e=this._children.length-1);for(var i=t;i<=e;++i)this.removeChildToPoolAt(t)},Object.defineProperty(n.prototype,"selectedIndex",{get:function(){var e;if(this._virtual)for(e=0;e<this._realNumItems;e++){var i=this._virtualItems[e];if(i.obj instanceof t.GButton&&i.obj.selected||null==i.obj&&i.selected)return this._loop?e%this._numItems:e}else{var n=this._children.length;for(e=0;e<n;e++){var o=this._children[e];if(o instanceof t.GButton&&o.selected)return e}}return-1},set:function(e){e>=0&&e<this.numItems?(this._selectionMode!=t.ListSelectionMode.Single&&this.clearSelection(),this.addSelection(e)):this.clearSelection()},enumerable:!0,configurable:!0}),n.prototype.getSelection=function(e){var i;if(e||(e=new Array),this._virtual)for(i=0;i<this._realNumItems;i++){var n=this._virtualItems[i];if(n.obj instanceof t.GButton&&n.obj.selected||null==n.obj&&n.selected){var o=i;if(this._loop&&(o=i%this._numItems,-1!=e.indexOf(o)))continue;e.push(o)}}else{var r=this._children.length;for(i=0;i<r;i++){var s=this._children[i];s instanceof t.GButton&&s.selected&&e.push(i)}}return e},n.prototype.addSelection=function(e,i){if(this._selectionMode!=t.ListSelectionMode.None){var n;if(this.checkVirtualList(),this._selectionMode==t.ListSelectionMode.Single&&this.clearSelection(),i&&this.scrollToView(e),this._lastSelectedIndex=e,this._virtual){var o=this._virtualItems[e];o.obj&&(n=o.obj),o.selected=!0}else n=this.getChildAt(e);n instanceof t.GButton&&!n.selected&&(n.selected=!0,this.updateSelectionController(e))}},n.prototype.removeSelection=function(e){if(this._selectionMode!=t.ListSelectionMode.None){var i;if(this._virtual){var n=this._virtualItems[e];n.obj&&(i=n.obj),n.selected=!1}else i=this.getChildAt(e);i instanceof t.GButton&&(i.selected=!1)}},n.prototype.clearSelection=function(){var e;if(this._virtual)for(e=0;e<this._realNumItems;e++){var i=this._virtualItems[e];i.obj instanceof t.GButton&&(i.obj.selected=!1),i.selected=!1}else{var n=this._children.length;for(e=0;e<n;e++){var o=this._children[e];o instanceof t.GButton&&(o.selected=!1)}}},n.prototype.clearSelectionExcept=function(e){var i;if(this._virtual)for(i=0;i<this._realNumItems;i++){var n=this._virtualItems[i];n.obj!=e&&(n.obj instanceof t.GButton&&(n.obj.selected=!1),n.selected=!1)}else{var o=this._children.length;for(i=0;i<o;i++){var r=this._children[i];r instanceof t.GButton&&r!=e&&(r.selected=!1)}}},n.prototype.selectAll=function(){this.checkVirtualList();var e,i=-1;if(this._virtual)for(e=0;e<this._realNumItems;e++){var n=this._virtualItems[e];n.obj instanceof t.GButton&&!n.obj.selected&&(n.obj.selected=!0,i=e),n.selected=!0}else{var o=this._children.length;for(e=0;e<o;e++){var r=this._children[e];r instanceof t.GButton&&!r.selected&&(r.selected=!0,i=e)}}-1!=i&&this.updateSelectionController(i)},n.prototype.selectNone=function(){this.clearSelection()},n.prototype.selectReverse=function(){this.checkVirtualList();var e,i=-1;if(this._virtual)for(e=0;e<this._realNumItems;e++){var n=this._virtualItems[e];n.obj instanceof t.GButton&&(n.obj.selected=!n.obj.selected,n.obj.selected&&(i=e)),n.selected=!n.selected}else{var o=this._children.length;for(e=0;e<o;e++){var r=this._children[e];r instanceof t.GButton&&(r.selected=!r.selected,r.selected&&(i=e))}}-1!=i&&this.updateSelectionController(i)},n.prototype.handleArrowKey=function(e){var i=this.selectedIndex;if(-1!=i)switch(e){case 1:if(this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowVertical)--i>=0&&(this.clearSelection(),this.addSelection(i,!0));else if(this._layout==t.ListLayoutType.FlowHorizontal||this._layout==t.ListLayoutType.Pagination){for(var n=this._children[i],o=0,r=i-1;r>=0;r--){var s=this._children[r];if(s.y!=n.y){n=s;break}o++}for(;r>=0;r--)if((s=this._children[r]).y!=n.y){this.clearSelection(),this.addSelection(r+o+1,!0);break}}break;case 3:if(this._layout==t.ListLayoutType.SingleRow||this._layout==t.ListLayoutType.FlowHorizontal||this._layout==t.ListLayoutType.Pagination)++i<this._children.length&&(this.clearSelection(),this.addSelection(i,!0));else if(this._layout==t.ListLayoutType.FlowVertical){n=this._children[i],o=0;var a=this._children.length;for(r=i+1;r<a;r++){if((s=this._children[r]).x!=n.x){n=s;break}o++}for(;r<a;r++)if((s=this._children[r]).x!=n.x){this.clearSelection(),this.addSelection(r-o-1,!0);break}}break;case 5:if(this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowVertical)++i<this._children.length&&(this.clearSelection(),this.addSelection(i,!0));else if(this._layout==t.ListLayoutType.FlowHorizontal||this._layout==t.ListLayoutType.Pagination){for(n=this._children[i],o=0,a=this._children.length,r=i+1;r<a;r++){if((s=this._children[r]).y!=n.y){n=s;break}o++}for(;r<a;r++)if((s=this._children[r]).y!=n.y){this.clearSelection(),this.addSelection(r-o-1,!0);break}}break;case 7:if(this._layout==t.ListLayoutType.SingleRow||this._layout==t.ListLayoutType.FlowHorizontal||this._layout==t.ListLayoutType.Pagination)--i>=0&&(this.clearSelection(),this.addSelection(i,!0));else if(this._layout==t.ListLayoutType.FlowVertical){for(n=this._children[i],o=0,r=i-1;r>=0;r--){if((s=this._children[r]).x!=n.x){n=s;break}o++}for(;r>=0;r--)if((s=this._children[r]).x!=n.x){this.clearSelection(),this.addSelection(r+o+1,!0);break}}}},n.prototype.__clickItem=function(e){if(!this._scrollPane||!this._scrollPane.isDragged){var i=e.currentTarget;this.setSelectionOnEvent(i),this._scrollPane&&this.scrollItemToViewOnClick&&this._scrollPane.scrollToView(i,!0);var n=new t.ItemEvent(t.ItemEvent.CLICK,i);n.stageX=e.stageX,n.stageY=e.stageY,this.dispatchItemEvent(n)}},n.prototype.dispatchItemEvent=function(t){this.dispatchEvent(t)},n.prototype.setSelectionOnEvent=function(e){if(e instanceof t.GButton&&this._selectionMode!=t.ListSelectionMode.None){var i=!1,n=this.childIndexToItemIndex(this.getChildIndex(e));if(this._selectionMode==t.ListSelectionMode.Single)e.selected||(this.clearSelectionExcept(e),e.selected=!0);else if(t.GRoot.shiftKeyDown){if(!e.selected)if(-1!=this._lastSelectedIndex){var o,r=Math.min(this._lastSelectedIndex,n),s=Math.max(this._lastSelectedIndex,n);if(s=Math.min(s,this.numItems-1),this._virtual)for(o=r;o<=s;o++){var a=this._virtualItems[o];a.obj instanceof t.GButton&&(a.obj.selected=!0),a.selected=!0}else for(o=r;o<=s;o++){var h=this.getChildAt(o);h instanceof t.GButton&&(h.selected=!0)}i=!0}else e.selected=!0}else t.GRoot.ctrlKeyDown||this._selectionMode==t.ListSelectionMode.Multiple_SingleClick?e.selected=!e.selected:e.selected?this.clearSelectionExcept(e):(this.clearSelectionExcept(e),e.selected=!0);i||(this._lastSelectedIndex=n),e.selected&&this.updateSelectionController(n)}},n.prototype.resizeToFit=function(e,i){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===i&&(i=0),this.ensureBoundsCorrect();var n=this.numItems;if(e>n&&(e=n),this._virtual){var o=Math.ceil(e/this._curLineItemCount);this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal?this.viewHeight=o*this._itemSize.y+Math.max(0,o-1)*this._lineGap:this.viewWidth=o*this._itemSize.x+Math.max(0,o-1)*this._columnGap}else if(0==e)this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal?this.viewHeight=i:this.viewWidth=i;else{for(var r,s=e-1;s>=0&&(r=this.getChildAt(s),this.foldInvisibleItems&&!r.visible);)s--;if(s<0)this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal?this.viewHeight=i:this.viewWidth=i;else{var a=0;this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal?((a=r.y+r.height)<i&&(a=i),this.viewHeight=a):((a=r.x+r.width)<i&&(a=i),this.viewWidth=a)}}},n.prototype.getMaxItemWidth=function(){for(var t=this._children.length,e=0,i=0;i<t;i++){var n=this.getChildAt(i);n.width>e&&(e=n.width)}return e},n.prototype.handleSizeChanged=function(){e.prototype.handleSizeChanged.call(this),this.setBoundsChangedFlag(),this._virtual&&this.setVirtualListChangedFlag(!0)},n.prototype.handleControllerChanged=function(t){e.prototype.handleControllerChanged.call(this,t),this._selectionController==t&&(this.selectedIndex=t.selectedIndex)},n.prototype.updateSelectionController=function(t){if(this._selectionController&&!this._selectionController.changing&&t<this._selectionController.pageCount){var e=this._selectionController;this._selectionController=null,e.selectedIndex=t,this._selectionController=e}},n.prototype.getSnappingPosition=function(n,o,r){var s,a;return this._virtual?(r||(r=new egret.Point),this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal?(s=o,i=o,a=this.getIndexOnPos1(!1),o=i,a<this._virtualItems.length&&s-o>this._virtualItems[a].height/2&&a<this._realNumItems&&(o+=this._virtualItems[a].height+this._lineGap)):this._layout==t.ListLayoutType.SingleRow||this._layout==t.ListLayoutType.FlowVertical?(s=n,i=n,a=this.getIndexOnPos2(!1),n=i,a<this._virtualItems.length&&s-n>this._virtualItems[a].width/2&&a<this._realNumItems&&(n+=this._virtualItems[a].width+this._columnGap)):(s=n,i=n,a=this.getIndexOnPos3(!1),n=i,a<this._virtualItems.length&&s-n>this._virtualItems[a].width/2&&a<this._realNumItems&&(n+=this._virtualItems[a].width+this._columnGap)),r.x=n,r.y=o,r):e.prototype.getSnappingPosition.call(this,n,o,r)},n.prototype.scrollToView=function(e,i,n){if(this._virtual){if(0==this._numItems)return;if(this.checkVirtualList(),e>=this._virtualItems.length)throw"Invalid child index: "+e+">"+this._virtualItems.length;var o;this._loop&&(e=Math.floor(this._firstIndex/this._numItems)*this._numItems+e);var r,s=this._virtualItems[e],a=0;if(this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal){for(r=this._curLineItemCount-1;r<e;r+=this._curLineItemCount)a+=this._virtualItems[r].height+this._lineGap;o=new egret.Rectangle(0,a,this._itemSize.x,s.height)}else if(this._layout==t.ListLayoutType.SingleRow||this._layout==t.ListLayoutType.FlowVertical){for(r=this._curLineItemCount-1;r<e;r+=this._curLineItemCount)a+=this._virtualItems[r].width+this._columnGap;o=new egret.Rectangle(a,0,s.width,this._itemSize.y)}else{var h=e/(this._curLineItemCount*this._curLineItemCount2);o=new egret.Rectangle(h*this.viewWidth+e%this._curLineItemCount*(s.width+this._columnGap),e/this._curLineItemCount%this._curLineItemCount2*(s.height+this._lineGap),s.width,s.height)}this._scrollPane&&this._scrollPane.scrollToView(o,i,n)}else{var l=this.getChildAt(e);l&&(this._scrollPane?this._scrollPane.scrollToView(l,i,n):this.parent&&this.parent.scrollPane&&this.parent.scrollPane.scrollToView(l,i,n))}},n.prototype.getFirstChildInView=function(){return this.childIndexToItemIndex(e.prototype.getFirstChildInView.call(this))},n.prototype.childIndexToItemIndex=function(e){if(!this._virtual)return e;if(this._layout==t.ListLayoutType.Pagination){for(var i=this._firstIndex;i<this._realNumItems;i++)if(this._virtualItems[i].obj&&--e<0)return i;return e}return e+=this._firstIndex,this._loop&&this._numItems>0&&(e%=this._numItems),e},n.prototype.itemIndexToChildIndex=function(e){if(!this._virtual)return e;if(this._layout==t.ListLayoutType.Pagination)return this.getChildIndex(this._virtualItems[e].obj);if(this._loop&&this._numItems>0){var i=this._firstIndex%this._numItems;e>=i?e-=i:e=this._numItems-i+e}else e-=this._firstIndex;return e},n.prototype.setVirtual=function(){this._setVirtual(!1)},n.prototype.setVirtualAndLoop=function(){this._setVirtual(!0)},n.prototype._setVirtual=function(e){if(!this._virtual){if(null==this._scrollPane)throw"Virtual list must be scrollable!";if(e){if(this._layout==t.ListLayoutType.FlowHorizontal||this._layout==t.ListLayoutType.FlowVertical)throw"Loop list is not supported for FlowHorizontal or FlowVertical layout!";this._scrollPane.bouncebackEffect=!1}if(this._virtual=!0,this._loop=e,this._virtualItems=new Array,this.removeChildrenToPool(),null==this._itemSize){this._itemSize=new egret.Point;var i=this.getFromPool(null);if(null==i)throw"Virtual List must have a default list item resource.";this._itemSize.x=i.width,this._itemSize.y=i.height,this.returnToPool(i)}this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal?(this._scrollPane.scrollStep=this._itemSize.y,this._loop&&(this._scrollPane._loop=2)):(this._scrollPane.scrollStep=this._itemSize.x,this._loop&&(this._scrollPane._loop=1)),this._scrollPane.addEventListener(t.ScrollPane.SCROLL,this.__scrolled,this),this.setVirtualListChangedFlag(!0)}},Object.defineProperty(n.prototype,"numItems",{get:function(){return this._virtual?this._numItems:this._children.length},set:function(e){if(this._virtual){if(null==this.itemRenderer)throw"Set itemRenderer first!";this._numItems=e,this._loop?this._realNumItems=6*this._numItems:this._realNumItems=this._numItems;var i=this._virtualItems.length;if(this._realNumItems>i)for(r=i;r<this._realNumItems;r++){var n={width:this._itemSize.x,height:this._itemSize.y,updateFlag:0};this._virtualItems.push(n)}else for(r=this._realNumItems;r<i;r++)this._virtualItems[r].selected=!1;0!=this._virtualListChanged&&t.GTimers.inst.remove(this._refreshVirtualList,this),this._refreshVirtualList()}else{var o=this._children.length;if(e>o)for(var r=o;r<e;r++)null==this.itemProvider?this.addItemFromPool():this.addItemFromPool(this.itemProvider.call(this.callbackThisObj,r));else this.removeChildrenToPool(e,o);if(null!=this.itemRenderer)for(r=0;r<e;r++)this.itemRenderer.call(this.callbackThisObj,r,this.getChildAt(r))}},enumerable:!0,configurable:!0}),n.prototype.refreshVirtualList=function(){this.setVirtualListChangedFlag(!1)},n.prototype.checkVirtualList=function(){0!=this._virtualListChanged&&(this._refreshVirtualList(),t.GTimers.inst.remove(this._refreshVirtualList,this))},n.prototype.setVirtualListChangedFlag=function(e){e?this._virtualListChanged=2:0==this._virtualListChanged&&(this._virtualListChanged=1),t.GTimers.inst.callLater(this._refreshVirtualList,this)},n.prototype._refreshVirtualList=function(){var e=2==this._virtualListChanged;this._virtualListChanged=0,this._eventLocked=!0,e&&(this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.SingleRow?this._curLineItemCount=1:this._layout==t.ListLayoutType.FlowHorizontal?this._columnCount>0?this._curLineItemCount=this._columnCount:(this._curLineItemCount=Math.floor((this._scrollPane.viewWidth+this._columnGap)/(this._itemSize.x+this._columnGap)),this._curLineItemCount<=0&&(this._curLineItemCount=1)):this._layout==t.ListLayoutType.FlowVertical?this._lineCount>0?this._curLineItemCount=this._lineCount:(this._curLineItemCount=Math.floor((this._scrollPane.viewHeight+this._lineGap)/(this._itemSize.y+this._lineGap)),this._curLineItemCount<=0&&(this._curLineItemCount=1)):(this._columnCount>0?this._curLineItemCount=this._columnCount:(this._curLineItemCount=Math.floor((this._scrollPane.viewWidth+this._columnGap)/(this._itemSize.x+this._columnGap)),this._curLineItemCount<=0&&(this._curLineItemCount=1)),this._lineCount>0?this._curLineItemCount2=this._lineCount:(this._curLineItemCount2=Math.floor((this._scrollPane.viewHeight+this._lineGap)/(this._itemSize.y+this._lineGap)),this._curLineItemCount2<=0&&(this._curLineItemCount2=1))));var i=0,n=0;if(this._realNumItems>0){var o,r=Math.ceil(this._realNumItems/this._curLineItemCount)*this._curLineItemCount,s=Math.min(this._curLineItemCount,this._realNumItems);if(this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal){for(o=0;o<r;o+=this._curLineItemCount)i+=this._virtualItems[o].height+this._lineGap;if(i>0&&(i-=this._lineGap),this._autoResizeItem)n=this._scrollPane.viewWidth;else{for(o=0;o<s;o++)n+=this._virtualItems[o].width+this._columnGap;n>0&&(n-=this._columnGap)}}else if(this._layout==t.ListLayoutType.SingleRow||this._layout==t.ListLayoutType.FlowVertical){for(o=0;o<r;o+=this._curLineItemCount)n+=this._virtualItems[o].width+this._columnGap;if(n>0&&(n-=this._columnGap),this._autoResizeItem)i=this._scrollPane.viewHeight;else{for(o=0;o<s;o++)i+=this._virtualItems[o].height+this._lineGap;i>0&&(i-=this._lineGap)}}else{n=Math.ceil(r/(this._curLineItemCount*this._curLineItemCount2))*this.viewWidth,i=this.viewHeight}}this.handleAlign(n,i),this._scrollPane.setContentSize(n,i),this._eventLocked=!1,this.handleScroll(!0)},n.prototype.__scrolled=function(t){this.handleScroll(!1)},n.prototype.getIndexOnPos1=function(t){if(this._realNumItems<this._curLineItemCount)return i=0,0;var e,n,o;if(this.numChildren>0&&!t){if((n=this.getChildAt(0).y)>i){for(e=this._firstIndex-this._curLineItemCount;e>=0;e-=this._curLineItemCount)if((n-=this._virtualItems[e].height+this._lineGap)<=i)return i=n,e;return i=0,0}for(e=this._firstIndex;e<this._realNumItems;e+=this._curLineItemCount){if((o=n+this._virtualItems[e].height+this._lineGap)>i)return i=n,e;n=o}return i=n,this._realNumItems-this._curLineItemCount}for(n=0,e=0;e<this._realNumItems;e+=this._curLineItemCount){if((o=n+this._virtualItems[e].height+this._lineGap)>i)return i=n,e;n=o}return i=n,this._realNumItems-this._curLineItemCount},n.prototype.getIndexOnPos2=function(t){if(this._realNumItems<this._curLineItemCount)return i=0,0;var e,n,o;if(this.numChildren>0&&!t){if((n=this.getChildAt(0).x)>i){for(e=this._firstIndex-this._curLineItemCount;e>=0;e-=this._curLineItemCount)if((n-=this._virtualItems[e].width+this._columnGap)<=i)return i=n,e;return i=0,0}for(e=this._firstIndex;e<this._realNumItems;e+=this._curLineItemCount){if((o=n+this._virtualItems[e].width+this._columnGap)>i)return i=n,e;n=o}return i=n,this._realNumItems-this._curLineItemCount}for(n=0,e=0;e<this._realNumItems;e+=this._curLineItemCount){if((o=n+this._virtualItems[e].width+this._columnGap)>i)return i=n,e;n=o}return i=n,this._realNumItems-this._curLineItemCount},n.prototype.getIndexOnPos3=function(t){if(this._realNumItems<this._curLineItemCount)return i=0,0;var e,n,o=this.viewWidth,r=Math.floor(i/o),s=r*(this._curLineItemCount*this._curLineItemCount2),a=r*o;for(e=0;e<this._curLineItemCount;e++){if((n=a+this._virtualItems[s+e].width+this._columnGap)>i)return i=a,s+e;a=n}return i=a,s+this._curLineItemCount-1},n.prototype.handleScroll=function(e){if(!this._eventLocked){if(this._layout==t.ListLayoutType.SingleColumn||this._layout==t.ListLayoutType.FlowHorizontal){for(var i=0;this.handleScroll1(e);)if(e=!1,++i>20){console.log("FairyGUI: list will never be filled as the item renderer function always returns a different size.");break}this.handleArchOrder1()}else if(this._layout==t.ListLayoutType.SingleRow||this._layout==t.ListLayoutType.FlowVertical){for(i=0;this.handleScroll2(e);)if(e=!1,++i>20){console.log("FairyGUI: list will never be filled as the item renderer function always returns a different size.");break}this.handleArchOrder2()}else this.handleScroll3(e);this._boundsChanged=!1}},n.prototype.handleScroll1=function(e){var n=this._scrollPane.scrollingPosY,o=n+this._scrollPane.viewHeight,r=o==this._scrollPane.contentHeight;i=n;var s=this.getIndexOnPos1(e);if(n=i,s==this._firstIndex&&!e)return!1;var a=this._firstIndex;this._firstIndex=s;var h,l,c,u,_,p=s,d=a>s,g=this.numChildren,f=a+g-1,y=d?f:a,m=0,b=n,v=0,w=0,C=this.defaultItem,S=(this._scrollPane.viewWidth-this._columnGap*(this._curLineItemCount-1))/this._curLineItemCount;for(this.itemInfoVer++;p<this._realNumItems&&(r||b<o);){if((null==(l=this._virtualItems[p]).obj||e)&&(null!=this.itemProvider&&(null==(C=this.itemProvider.call(this.callbackThisObj,p%this._numItems))&&(C=this._defaultItem),C=t.UIPackage.normalizeURL(C)),l.obj&&l.obj.resourceURL!=C&&(l.obj instanceof t.GButton&&(l.selected=l.obj.selected),this.removeChildToPool(l.obj),l.obj=null)),null==l.obj){if(d){for(_=y;_>=a;_--)if((c=this._virtualItems[_]).obj&&c.updateFlag!=this.itemInfoVer&&c.obj.resourceURL==C){c.obj instanceof t.GButton&&(c.selected=c.obj.selected),l.obj=c.obj,c.obj=null,_==y&&y--;break}}else for(_=y;_<=f;_++)if((c=this._virtualItems[_]).obj&&c.updateFlag!=this.itemInfoVer&&c.obj.resourceURL==C){c.obj instanceof t.GButton&&(c.selected=c.obj.selected),l.obj=c.obj,c.obj=null,_==y&&y++;break}l.obj?this.setChildIndex(l.obj,d?p-s:this.numChildren):(l.obj=this._pool.getObject(C),d?this.addChildAt(l.obj,p-s):this.addChild(l.obj)),l.obj instanceof t.GButton&&(l.obj.selected=l.selected),h=!0}else h=e;h&&(this._autoResizeItem&&(this._layout==t.ListLayoutType.SingleColumn||this._columnCount>0)&&l.obj.setSize(S,l.obj.height,!0),this.itemRenderer.call(this.callbackThisObj,p%this._numItems,l.obj),p%this._curLineItemCount==0&&(v+=Math.ceil(l.obj.height)-l.height,p==s&&a>s&&(w=Math.ceil(l.obj.height)-l.height)),l.width=Math.ceil(l.obj.width),l.height=Math.ceil(l.obj.height)),l.updateFlag=this.itemInfoVer,l.obj.setXY(m,b),p==s&&(o+=l.height),m+=l.width+this._columnGap,p%this._curLineItemCount==this._curLineItemCount-1&&(m=0,b+=l.height+this._lineGap),p++}for(u=0;u<g;u++)(l=this._virtualItems[a+u]).updateFlag!=this.itemInfoVer&&l.obj&&(l.obj instanceof t.GButton&&(l.selected=l.obj.selected),this.removeChildToPool(l.obj),l.obj=null);for(g=this._children.length,u=0;u<g;u++){var x=this._virtualItems[s+u].obj;this._children[u]!=x&&this.setChildIndex(x,u)}return 0==v&&0==w||this._scrollPane.changeContentSizeOnScrolling(0,v,0,w),p>0&&this.numChildren>0&&this._container.y<=0&&this.getChildAt(0).y>-this._container.y},n.prototype.handleScroll2=function(e){var n=this._scrollPane.scrollingPosX,o=n+this._scrollPane.viewWidth,r=n==this._scrollPane.contentWidth;i=n;var s=this.getIndexOnPos2(e);if(n=i,s==this._firstIndex&&!e)return!1;var a=this._firstIndex;this._firstIndex=s;var h,l,c,u,_,p=s,d=a>s,g=this.numChildren,f=a+g-1,y=d?f:a,m=n,b=0,v=0,w=0,C=this.defaultItem,S=(this._scrollPane.viewHeight-this._lineGap*(this._curLineItemCount-1))/this._curLineItemCount;for(this.itemInfoVer++;p<this._realNumItems&&(r||m<o);){if((null==(l=this._virtualItems[p]).obj||e)&&(null!=this.itemProvider&&(null==(C=this.itemProvider.call(this.callbackThisObj,p%this._numItems))&&(C=this._defaultItem),C=t.UIPackage.normalizeURL(C)),l.obj&&l.obj.resourceURL!=C&&(l.obj instanceof t.GButton&&(l.selected=l.obj.selected),this.removeChildToPool(l.obj),l.obj=null)),null==l.obj){if(d){for(_=y;_>=a;_--)if((c=this._virtualItems[_]).obj&&c.updateFlag!=this.itemInfoVer&&c.obj.resourceURL==C){c.obj instanceof t.GButton&&(c.selected=c.obj.selected),l.obj=c.obj,c.obj=null,_==y&&y--;break}}else for(_=y;_<=f;_++)if((c=this._virtualItems[_]).obj&&c.updateFlag!=this.itemInfoVer&&c.obj.resourceURL==C){c.obj instanceof t.GButton&&(c.selected=c.obj.selected),l.obj=c.obj,c.obj=null,_==y&&y++;break}l.obj?this.setChildIndex(l.obj,d?p-s:this.numChildren):(l.obj=this._pool.getObject(C),d?this.addChildAt(l.obj,p-s):this.addChild(l.obj)),l.obj instanceof t.GButton&&(l.obj.selected=l.selected),h=!0}else h=e;h&&(this._autoResizeItem&&(this._layout==t.ListLayoutType.SingleRow||this._lineCount>0)&&l.obj.setSize(l.obj.width,S,!0),this.itemRenderer.call(this.callbackThisObj,p%this._numItems,l.obj),p%this._curLineItemCount==0&&(v+=Math.ceil(l.obj.width)-l.width,p==s&&a>s&&(w=Math.ceil(l.obj.width)-l.width)),l.width=Math.ceil(l.obj.width),l.height=Math.ceil(l.obj.height)),l.updateFlag=this.itemInfoVer,l.obj.setXY(m,b),p==s&&(o+=l.width),b+=l.height+this._lineGap,p%this._curLineItemCount==this._curLineItemCount-1&&(b=0,m+=l.width+this._columnGap),p++}for(u=0;u<g;u++)(l=this._virtualItems[a+u]).updateFlag!=this.itemInfoVer&&l.obj&&(l.obj instanceof t.GButton&&(l.selected=l.obj.selected),this.removeChildToPool(l.obj),l.obj=null);for(g=this._children.length,u=0;u<g;u++){var x=this._virtualItems[s+u].obj;this._children[u]!=x&&this.setChildIndex(x,u)}return 0==v&&0==w||this._scrollPane.changeContentSizeOnScrolling(v,0,w,0),p>0&&this.numChildren>0&&this._container.x<=0&&this.getChildAt(0).x>-this._container.x},n.prototype.handleScroll3=function(e){var n=this._scrollPane.scrollingPosX;i=n;var o=this.getIndexOnPos3(e);if(n=i,o!=this._firstIndex||e){var r=this._firstIndex;this._firstIndex=o;var s,a,h,l,c,u,_=r,p=this._virtualItems.length,d=this._curLineItemCount*this._curLineItemCount2,g=o%this._curLineItemCount,f=this.viewWidth,y=Math.floor(o/d)*d,m=y+2*d,b=this._defaultItem,v=(this._scrollPane.viewWidth-this._columnGap*(this._curLineItemCount-1))/this._curLineItemCount,w=(this._scrollPane.viewHeight-this._lineGap*(this._curLineItemCount2-1))/this._curLineItemCount2;for(this.itemInfoVer++,a=y;a<m;a++)if(!(a>=this._realNumItems)){if(c=a%this._curLineItemCount,a-y<d){if(c<g)continue}else if(c>g)continue;(h=this._virtualItems[a]).updateFlag=this.itemInfoVer}var C=0;for(a=y;a<m;a++)if(!(a>=this._realNumItems)&&(h=this._virtualItems[a]).updateFlag==this.itemInfoVer){if(null==h.obj){for(;_<p;){if((l=this._virtualItems[_]).obj&&l.updateFlag!=this.itemInfoVer){l.obj instanceof t.GButton&&(l.selected=l.obj.selected),h.obj=l.obj,l.obj=null;break}_++}-1==C&&(C=this.getChildIndex(u)+1),null==h.obj?(null!=this.itemProvider&&(null==(b=this.itemProvider.call(this.callbackThisObj,a%this._numItems))&&(b=this._defaultItem),b=t.UIPackage.normalizeURL(b)),h.obj=this._pool.getObject(b),this.addChildAt(h.obj,C)):C=this.setChildIndexBefore(h.obj,C),C++,h.obj instanceof t.GButton&&(h.obj.selected=h.selected),s=!0}else s=e,C=-1,u=h.obj;s&&(this._autoResizeItem&&(this._curLineItemCount==this._columnCount&&this._curLineItemCount2==this._lineCount?h.obj.setSize(v,w,!0):this._curLineItemCount==this._columnCount?h.obj.setSize(v,h.obj.height,!0):this._curLineItemCount2==this._lineCount&&h.obj.setSize(h.obj.width,w,!0)),this.itemRenderer.call(this.callbackThisObj,a%this._numItems,h.obj),h.width=Math.ceil(h.obj.width),h.height=Math.ceil(h.obj.height))}var S=y/d*f,x=S,T=0,I=0;for(a=y;a<m;a++)a>=this._realNumItems||((h=this._virtualItems[a]).updateFlag==this.itemInfoVer&&h.obj.setXY(x,T),h.height>I&&(I=h.height),a%this._curLineItemCount==this._curLineItemCount-1?(x=S,T+=I+this._lineGap,I=0,a==y+d-1&&(x=S+=f,T=0)):x+=h.width+this._columnGap);for(a=_;a<p;a++)(h=this._virtualItems[a]).updateFlag!=this.itemInfoVer&&h.obj&&(h.obj instanceof t.GButton&&(h.selected=h.obj.selected),this.removeChildToPool(h.obj),h.obj=null)}},n.prototype.handleArchOrder1=function(){if(this._childrenRenderOrder==t.ChildrenRenderOrder.Arch){for(var e=this._scrollPane.posY+this.viewHeight/2,i=Number.POSITIVE_INFINITY,n=0,o=0,r=this.numChildren,s=0;s<r;s++){var a=this.getChildAt(s);this.foldInvisibleItems&&!a.visible||(n=Math.abs(e-a.y-a.height/2))<i&&(i=n,o=s)}this.apexIndex=o}},n.prototype.handleArchOrder2=function(){if(this._childrenRenderOrder==t.ChildrenRenderOrder.Arch){for(var e=this._scrollPane.posX+this.viewWidth/2,i=Number.POSITIVE_INFINITY,n=0,o=0,r=this.numChildren,s=0;s<r;s++){var a=this.getChildAt(s);this.foldInvisibleItems&&!a.visible||(n=Math.abs(e-a.x-a.width/2))<i&&(i=n,o=s)}this.apexIndex=o}},n.prototype.handleAlign=function(e,i){var n=0,o=0;i<this.viewHeight&&(this._verticalAlign==t.VertAlignType.Middle?o=Math.floor((this.viewHeight-i)/2):this._verticalAlign==t.VertAlignType.Bottom&&(o=this.viewHeight-i)),e<this.viewWidth&&(this._align==t.AlignType.Center?n=Math.floor((this.viewWidth-e)/2):this._align==t.AlignType.Right&&(n=this.viewWidth-e)),n==this._alignOffset.x&&o==this._alignOffset.y||(this._alignOffset.setTo(n,o),this._scrollPane?this._scrollPane.adjustMaskContainer():(this._container.x=this._margin.left+this._alignOffset.x,this._container.y=this._margin.top+this._alignOffset.y))},n.prototype.updateBounds=function(){if(!this._virtual){var e,i,n=0,o=0,r=0,s=0,a=0,h=0,l=0,c=0,u=0,_=this._children.length,p=this.viewWidth,d=this.viewHeight,g=0,f=0,y=0;if(this._layout==t.ListLayoutType.SingleColumn){for(e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(0!=o&&(o+=this._lineGap),i.y=o,this._autoResizeItem&&i.setSize(p,i.height,!0),o+=Math.ceil(i.height),i.width>r&&(r=i.width));if((h=o)<=d&&this._autoResizeItem&&this._scrollPane&&this._scrollPane._displayInDemand&&this._scrollPane.vtScrollBar)for(p+=this._scrollPane.vtScrollBar.width,e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(i.setSize(p,i.height,!0),i.width>r&&(r=i.width));a=Math.ceil(r)}else if(this._layout==t.ListLayoutType.SingleRow){for(e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(0!=n&&(n+=this._columnGap),i.x=n,this._autoResizeItem&&i.setSize(i.width,d,!0),n+=Math.ceil(i.width),i.height>s&&(s=i.height));if((a=n)<=p&&this._autoResizeItem&&this._scrollPane&&this._scrollPane._displayInDemand&&this._scrollPane.hzScrollBar)for(d+=this._scrollPane.hzScrollBar.height,e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(i.setSize(i.width,d,!0),i.height>s&&(s=i.height));h=Math.ceil(s)}else if(this._layout==t.ListLayoutType.FlowHorizontal)if(this._autoResizeItem&&this._columnCount>0){for(e=0;e<_;e++)if(i=this.getChildAt(e),(!this.foldInvisibleItems||i.visible)&&(g+=i.sourceWidth,++l==this._columnCount||e==_-1)){for(y=(p-g-(l-1)*this._columnGap)/g,n=0,l=f;l<=e;l++)i=this.getChildAt(l),this.foldInvisibleItems&&!i.visible||(i.setXY(n,o),l<e?(i.setSize(i.sourceWidth+Math.round(i.sourceWidth*y),i.height,!0),n+=Math.ceil(i.width)+this._columnGap):i.setSize(p-n,i.height,!0),i.height>s&&(s=i.height));o+=Math.ceil(s)+this._lineGap,s=0,l=0,f=e+1,g=0}h=o+Math.ceil(s),a=p}else{for(e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(0!=n&&(n+=this._columnGap),(0!=this._columnCount&&l>=this._columnCount||0==this._columnCount&&n+i.width>p&&0!=s)&&(n=0,o+=Math.ceil(s)+this._lineGap,s=0,l=0),i.setXY(n,o),(n+=Math.ceil(i.width))>r&&(r=n),i.height>s&&(s=i.height),l++);h=o+Math.ceil(s),a=Math.ceil(r)}else if(this._layout==t.ListLayoutType.FlowVertical)if(this._autoResizeItem&&this._lineCount>0){for(e=0;e<_;e++)if(i=this.getChildAt(e),(!this.foldInvisibleItems||i.visible)&&(g+=i.sourceHeight,++l==this._lineCount||e==_-1)){for(y=(d-g-(l-1)*this._lineGap)/g,o=0,l=f;l<=e;l++)i=this.getChildAt(l),this.foldInvisibleItems&&!i.visible||(i.setXY(n,o),l<e?(i.setSize(i.width,i.sourceHeight+Math.round(i.sourceHeight*y),!0),o+=Math.ceil(i.height)+this._lineGap):i.setSize(i.width,d-o,!0),i.width>r&&(r=i.width));n+=Math.ceil(r)+this._columnGap,r=0,l=0,f=e+1,g=0}a=n+Math.ceil(r),h=d}else{for(e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(0!=o&&(o+=this._lineGap),(0!=this._lineCount&&l>=this._lineCount||0==this._lineCount&&o+i.height>d&&0!=r)&&(o=0,n+=Math.ceil(r)+this._columnGap,r=0,l=0),i.setXY(n,o),(o+=Math.ceil(i.height))>s&&(s=o),i.width>r&&(r=i.width),l++);a=n+Math.ceil(r),h=Math.ceil(s)}else{var m;if(this._autoResizeItem&&this._lineCount>0&&(m=Math.floor((d-(this._lineCount-1)*this._lineGap)/this._lineCount)),this._autoResizeItem&&this._columnCount>0){for(e=0;e<_;e++)if(i=this.getChildAt(e),(!this.foldInvisibleItems||i.visible)&&(0==l&&(0!=this._lineCount&&u>=this._lineCount||0==this._lineCount&&o+(this._lineCount>0?m:i.height)>d)&&(c++,o=0,u=0),g+=i.sourceWidth,++l==this._columnCount||e==_-1)){for(y=(p-g-(l-1)*this._columnGap)/g,n=0,l=f;l<=e;l++)i=this.getChildAt(l),this.foldInvisibleItems&&!i.visible||(i.setXY(c*p+n,o),l<e?(i.setSize(i.sourceWidth+Math.round(i.sourceWidth*y),this._lineCount>0?m:i.height,!0),n+=Math.ceil(i.width)+this._columnGap):i.setSize(p-n,this._lineCount>0?m:i.height,!0),i.height>s&&(s=i.height));o+=Math.ceil(s)+this._lineGap,s=0,l=0,f=e+1,g=0,u++}}else for(e=0;e<_;e++)i=this.getChildAt(e),this.foldInvisibleItems&&!i.visible||(0!=n&&(n+=this._columnGap),this._autoResizeItem&&this._lineCount>0&&i.setSize(i.width,m,!0),(0!=this._columnCount&&l>=this._columnCount||0==this._columnCount&&n+i.width>p&&0!=s)&&(n=0,o+=Math.ceil(s)+this._lineGap,s=0,l=0,u++,(0!=this._lineCount&&u>=this._lineCount||0==this._lineCount&&o+i.height>d&&0!=r)&&(c++,o=0,u=0)),i.setXY(c*p+n,o),(n+=Math.ceil(i.width))>r&&(r=n),i.height>s&&(s=i.height),l++);h=c>0?d:o+Math.ceil(s),a=(c+1)*p}this.handleAlign(a,h),this.setBounds(0,0,a,h)}},n.prototype.setup_beforeAdd=function(i,n){e.prototype.setup_beforeAdd.call(this,i,n),i.seek(n,5),this._layout=i.readByte(),this._selectionMode=i.readByte(),this._align=i.readByte(),this._verticalAlign=i.readByte(),this._lineGap=i.readShort(),this._columnGap=i.readShort(),this._lineCount=i.readShort(),this._columnCount=i.readShort(),this._autoResizeItem=i.readBool(),this._childrenRenderOrder=i.readByte(),this._apexIndex=i.readShort(),i.readBool()&&(this._margin.top=i.readInt(),this._margin.bottom=i.readInt(),this._margin.left=i.readInt(),this._margin.right=i.readInt());var o=i.readByte();if(o==t.OverflowType.Scroll){var r=i.position;i.seek(n,7),this.setupScroll(i),i.position=r}else this.setupOverflow(o);i.readBool()&&i.skip(8),i.version>=2&&(this.scrollItemToViewOnClick=i.readBool(),this.foldInvisibleItems=i.readBool()),i.seek(n,8),this._defaultItem=i.readS(),this.readItems(i)},n.prototype.readItems=function(t){var e,i,n,o;for(e=t.readShort(),i=0;i<e;i++)if(n=t.readShort(),n+=t.position,null!=(o=t.readS())||(o=this.defaultItem)){var r=this.getFromPool(o);null!=r&&(this.addChild(r),this.setupItem(t,r)),t.position=n}else t.position=n},n.prototype.setupItem=function(e,i){var n,o,r;if(null!=(n=e.readS())&&(i.text=n),null!=(n=e.readS())&&i instanceof t.GButton&&(i.selectedTitle=n),null!=(n=e.readS())&&(i.icon=n),null!=(n=e.readS())&&i instanceof t.GButton&&(i.selectedIcon=n),null!=(n=e.readS())&&(i.name=n),i instanceof t.GComponent){for(o=e.readShort(),r=0;r<o;r++){var s=i.getController(e.readS());n=e.readS(),s&&(s.selectedPageId=n)}if(e.version>=2)for(o=e.readShort(),r=0;r<o;r++){var a=e.readS(),h=e.readShort(),l=e.readS(),c=i.getChildByPath(a);c&&c.setProp(h,l)}}},n.prototype.setup_afterAdd=function(t,i){e.prototype.setup_afterAdd.call(this,t,i),t.seek(i,6);var n=t.readShort();-1!=n&&(this._selectionController=this.parent.getControllerAt(n))},n}(t.GComponent);t.GList=e;var i=0}(fgui||(fgui={})),function(t){var e=function(){function e(){this._count=0,this._pool={}}return e.prototype.clear=function(){for(var t in this._pool)for(var e=this._pool[t],i=e.length,n=0;n<i;n++)e[n].dispose();this._pool={},this._count=0},Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!0,configurable:!0}),e.prototype.getObject=function(e){if(null==(e=t.UIPackage.normalizeURL(e)))return null;var i=this._pool[e];return i&&i.length?(this._count--,i.shift()):t.UIPackage.createObjectFromURL(e)},e.prototype.returnObject=function(t){var e=t.resourceURL;if(e){var i=this._pool[e];null==i&&(i=new Array,this._pool[e]=i),this._count++,i.push(t)}},e}();t.GObjectPool=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._url="",i._fill=t.LoaderFillType.None,i._align=t.AlignType.Left,i._verticalAlign=t.VertAlignType.Top,i._showErrorSign=!0,i}return __extends(i,e),i.prototype.createDisplayObject=function(){this._container=new t.UIContainer,this._container.opaque=!0,this.setDisplayObject(this._container),this._content=new t.MovieClip,this._container.addChild(this._content)},i.prototype.dispose=function(){if(!this._contentItem){var t=this._content.texture;t&&this.freeExternal(t)}this._content2&&this._content2.dispose(),e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"url",{get:function(){return this._url},set:function(t){this._url!=t&&(this.clearContent(),this._url=t,this.loadContent(),this.updateGear(7))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"icon",{get:function(){return this._url},set:function(t){this.url=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this._align},set:function(t){this._align!=t&&(this._align=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(t){this._verticalAlign!=t&&(this._verticalAlign=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fill",{get:function(){return this._fill},set:function(t){this._fill!=t&&(this._fill=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shrinkOnly",{get:function(){return this._shrinkOnly},set:function(t){this._shrinkOnly!=t&&(this._shrinkOnly=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"autoSize",{get:function(){return this._autoSize},set:function(t){this._autoSize!=t&&(this._autoSize=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"playing",{get:function(){return this._content.playing},set:function(t){this._content.playing!=t&&(this._content.playing=t,this.updateGear(5))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"frame",{get:function(){return this._content.frame},set:function(t){this._content.frame!=t&&(this._content.frame=t,this.updateGear(5))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"color",{get:function(){return this._content.color},set:function(t){this._content.color!=t&&(this._content.color=t,this.updateGear(4))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"showErrorSign",{get:function(){return this._showErrorSign},set:function(t){this._showErrorSign=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"content",{get:function(){return this._content},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"component",{get:function(){return this._content2},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"texture",{get:function(){return this._content.texture},set:function(t){this.url=null,this._content.frames=null,this._content.texture=t,t?(this.sourceWidth=t.textureWidth,this.sourceHeight=t.textureHeight):this.sourceWidth=this.sourceHeight=0,this.updateLayout()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillMethod",{get:function(){return this._content.fillMethod},set:function(t){this._content.fillMethod=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillOrigin",{get:function(){return this._content.fillOrigin},set:function(t){this._content.fillOrigin=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillClockwise",{get:function(){return this._content.fillClockwise},set:function(t){this._content.fillClockwise=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillAmount",{get:function(){return this._content.fillAmount},set:function(t){this._content.fillAmount=t},enumerable:!0,configurable:!0}),i.prototype.loadContent=function(){this._url&&(t.ToolSet.startsWith(this._url,"ui://")?this.loadFromPackage(this._url):this.loadExternal())},i.prototype.loadFromPackage=function(e){if(this._contentItem=t.UIPackage.getItemByURL(e),this._contentItem)if(this._contentItem=this._contentItem.getBranch(),this.sourceWidth=this._contentItem.width,this.sourceHeight=this._contentItem.height,this._contentItem=this._contentItem.getHighResolution(),this._contentItem.load(),this._autoSize&&this.setSize(this.sourceWidth,this.sourceHeight),this._contentItem.type==t.PackageItemType.Image)null==this._contentItem.asset?this.setErrorState():(this._content.texture=this._contentItem.asset,this._content.scale9Grid=this._contentItem.scale9Grid,this._contentItem.scaleByTile?this._content.fillMode=egret.BitmapFillMode.REPEAT:this._content.fillMode=egret.BitmapFillMode.SCALE,this.updateLayout());else if(this._contentItem.type==t.PackageItemType.MovieClip)this._content.interval=this._contentItem.interval,this._content.swing=this._contentItem.swing,this._content.repeatDelay=this._contentItem.repeatDelay,this._content.frames=this._contentItem.frames,this.updateLayout();else if(this._contentItem.type==t.PackageItemType.Component){var i=t.UIPackage.createObjectFromURL(e);i?i instanceof t.GComponent?(this._content2=i.asCom,this._container.addChild(this._content2.displayObject),this.updateLayout()):(i.dispose(),this.setErrorState()):this.setErrorState()}else this.setErrorState();else this.setErrorState()},i.prototype.loadExternal=function(){RES.getResByUrl(this._url,this.__getResCompleted,this)},i.prototype.freeExternal=function(t){},i.prototype.onExternalLoadSuccess=function(t){this._content.texture=t,this._content.scale9Grid=null,this._content.fillMode=egret.BitmapFillMode.SCALE,this.sourceWidth=t.textureWidth,this.sourceHeight=t.textureHeight,this.updateLayout()},i.prototype.onExternalLoadFailed=function(){this.setErrorState()},i.prototype.__getResCompleted=function(t,e){t instanceof egret.Texture?this.onExternalLoadSuccess(t):this.onExternalLoadFailed()},i.prototype.setErrorState=function(){this._showErrorSign&&(null==this._errorSign&&null!=t.UIConfig.loaderErrorSign&&(this._errorSign=i._errorSignPool.getObject(t.UIConfig.loaderErrorSign)),this._errorSign&&(this._errorSign.setSize(this.width,this.height),this._container.addChild(this._errorSign.displayObject)))},i.prototype.clearErrorState=function(){this._errorSign&&(this._container.removeChild(this._errorSign.displayObject),i._errorSignPool.returnObject(this._errorSign),this._errorSign=null)},i.prototype.updateLayout=function(){if(this._content2||this._content){var e=this.sourceWidth,i=this.sourceHeight;if(this._autoSize&&(this._updatingLayout=!0,0==e&&(e=50),0==i&&(i=30),this.setSize(e,i),this._updatingLayout=!1,e==this._width&&i==this._height))this._content2?(this._content2.setXY(0,0),this._content2.setScale(1,1)):(this._content.x=0,this._content.y=0,this._content.width=e,this._content.height=i);else{var n,o,r=1,s=1;this._fill!=t.LoaderFillType.None&&(r=this.width/this.sourceWidth,s=this.height/this.sourceHeight,1==r&&1==s||(this._fill==t.LoaderFillType.ScaleMatchHeight?r=s:this._fill==t.LoaderFillType.ScaleMatchWidth?s=r:this._fill==t.LoaderFillType.Scale?r>s?r=s:s=r:this._fill==t.LoaderFillType.ScaleNoBorder&&(r>s?s=r:r=s),this._shrinkOnly&&(r>1&&(r=1),s>1&&(s=1)),e=this.sourceWidth*r,i=this.sourceHeight*s)),this._content2?this._content2.setScale(r,s):(this._content.width=e,this._content.height=i),n=this._align==t.AlignType.Center?Math.floor((this.width-e)/2):this._align==t.AlignType.Right?this.width-e:0,o=this._verticalAlign==t.VertAlignType.Middle?Math.floor((this.height-i)/2):this._verticalAlign==t.VertAlignType.Bottom?this.height-i:0,this._content2?this._content2.setXY(n,o):(this._content.x=n,this._content.y=o)}}else this._autoSize&&(this._updatingLayout=!0,this.setSize(50,30),this._updatingLayout=!1)},i.prototype.clearContent=function(){this.clearErrorState(),!this._contentItem&&this._content.texture&&this.freeExternal(this._content.texture),this._content.texture=null,this._content.frames=null,this._content2&&(this._container.removeChild(this._content2.displayObject),this._content2.dispose(),this._content2=null),this._contentItem=null},i.prototype.handleSizeChanged=function(){e.prototype.handleSizeChanged.call(this),this._updatingLayout||this.updateLayout()},i.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.color;case t.ObjectPropID.Playing:return this.playing;case t.ObjectPropID.Frame:return this.frame;case t.ObjectPropID.TimeScale:return this._content.timeScale;default:return e.prototype.getProp.call(this,i)}},i.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.color=n;break;case t.ObjectPropID.Playing:this.playing=n;break;case t.ObjectPropID.Frame:this.frame=n;break;case t.ObjectPropID.TimeScale:this._content.timeScale=n;break;case t.ObjectPropID.DeltaTime:this._content.advance(n);break;default:e.prototype.setProp.call(this,i,n)}},i.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,5),this._url=t.readS(),this._align=t.readByte(),this._verticalAlign=t.readByte(),this._fill=t.readByte(),this._shrinkOnly=t.readBool(),this._autoSize=t.readBool(),this._showErrorSign=t.readBool(),this._content.playing=t.readBool(),this._content.frame=t.readInt(),t.readBool()&&(this.color=t.readColor()),this._content.fillMethod=t.readByte(),0!=this._content.fillMethod&&(this._content.fillOrigin=t.readByte(),this._content.fillClockwise=t.readBool(),this._content.fillAmount=t.readFloat()),this._url&&this.loadContent()},i._errorSignPool=new t.GObjectPool,i}(t.GObject);t.GLoader=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._frame=0,i._playing=!0,i._url="",i._fill=t.LoaderFillType.None,i._align=t.AlignType.Left,i._verticalAlign=t.VertAlignType.Top,i._color=16777215,i}return __extends(i,e),i.prototype.createDisplayObject=function(){var e=new t.UIContainer;e.opaque=!0,this.setDisplayObject(e),this._container=new egret.DisplayObjectContainer,e.addChild(this._container)},i.prototype.dispose=function(){e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"url",{get:function(){return this._url},set:function(t){this._url!=t&&(this._url=t,this.loadContent(),this.updateGear(7))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"icon",{get:function(){return this._url},set:function(t){this.url=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"align",{get:function(){return this._align},set:function(t){this._align!=t&&(this._align=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(t){this._verticalAlign!=t&&(this._verticalAlign=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fill",{get:function(){return this._fill},set:function(t){this._fill!=t&&(this._fill=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"shrinkOnly",{get:function(){return this._shrinkOnly},set:function(t){this._shrinkOnly!=t&&(this._shrinkOnly=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"autoSize",{get:function(){return this._autoSize},set:function(t){this._autoSize!=t&&(this._autoSize=t,this.updateLayout())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"playing",{get:function(){return this._playing},set:function(t){this._playing!=t&&(this._playing=t,this.updateGear(5),this.onChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame!=t&&(this._frame=t,this.updateGear(5),this.onChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"animationName",{get:function(){return this._animationName},set:function(t){this._animationName!=t&&(this._animationName=t,this.onChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"skinName",{get:function(){return this._skinName},set:function(t){this._skinName!=t&&(this._skinName=t,this.onChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop!=t&&(this._loop=t,this.onChange())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"color",{get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this.updateGear(4),this._content&&(this._content.tint=t))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"content",{get:function(){},enumerable:!0,configurable:!0}),i.prototype.loadContent=function(){this.clearContent(),this._url&&(t.ToolSet.startsWith(this._url,"ui://")?this.loadFromPackage(this._url):this.loadExternal())},i.prototype.loadFromPackage=function(e){this._contentItem=t.UIPackage.getItemByURL(e),this._contentItem&&(this._contentItem=this._contentItem.getBranch(),this.sourceWidth=this._contentItem.width,this.sourceHeight=this._contentItem.height,this._contentItem=this._contentItem.getHighResolution(),this._autoSize&&this.setSize(this.sourceWidth,this.sourceHeight),this._contentItem.type!=t.PackageItemType.Spine&&this._contentItem.type!=t.PackageItemType.DragonBones||this._contentItem.owner.getItemAssetAsync(this._contentItem,this.onLoaded.bind(this)))},i.prototype.onLoaded=function(e,i){this._contentItem==i&&(e&&console.warn(e),this._contentItem.asset&&this._contentItem.type==t.PackageItemType.DragonBones&&this.setDragonBones(this._contentItem.armatureName,this._contentItem.asset.name,this._contentItem.atlasAsset.name,this._skinName,this._contentItem.skeletonAnchor))},i.prototype.setDragonBones=function(t,e,i,n,o){this.url=null;var r=dragonBones.EgretFactory.factory;this._content=r.buildArmatureDisplay(t,e,i,n),this._container.addChild(this._content),this._content.x=o.x,this._content.y=o.y,this._content.tint=this._color,this.onChangeDragonBones(),this.updateLayout()},i.prototype.onChange=function(){this.onChangeDragonBones()},i.prototype.onChangeDragonBones=function(){this._content instanceof dragonBones.EgretArmatureDisplay&&(this._animationName?this._playing?this._content.animation.play(this._animationName,this._loop?0:1):this._content.animation.gotoAndStopByFrame(this._animationName,this._frame):this._content.animation.reset())},i.prototype.loadExternal=function(){},i.prototype.updateLayout=function(){var e=this.sourceWidth,i=this.sourceHeight;if(this._autoSize&&(this._updatingLayout=!0,0==e&&(e=50),0==i&&(i=30),this.setSize(e,i),this._updatingLayout=!1,e==this._width&&i==this._height))return this._container.scaleX=this._container.scaleY=1,void(this._container.x=this._container.y=0);var n,o,r=1,s=1;this._fill!=t.LoaderFillType.None&&(r=this.width/this.sourceWidth,s=this.height/this.sourceHeight,1==r&&1==s||(this._fill==t.LoaderFillType.ScaleMatchHeight?r=s:this._fill==t.LoaderFillType.ScaleMatchWidth?s=r:this._fill==t.LoaderFillType.Scale?r>s?r=s:s=r:this._fill==t.LoaderFillType.ScaleNoBorder&&(r>s?s=r:r=s),this._shrinkOnly&&(r>1&&(r=1),s>1&&(s=1)),e=this.sourceWidth*r,i=this.sourceHeight*s)),this._container.scaleX=r,this._container.scaleY=s,n=this._align==t.AlignType.Center?Math.floor((this.width-e)/2):this._align==t.AlignType.Right?this.width-e:0,o=this._verticalAlign==t.VertAlignType.Middle?Math.floor((this.height-i)/2):this._verticalAlign==t.VertAlignType.Bottom?this.height-i:0,this._container.x=n,this._container.y=o},i.prototype.clearContent=function(){this._contentItem=null,this._content&&(this._container.removeChild(this._content),"dispose"in this._content&&this._content.dispose(),this._content=null)},i.prototype.handleSizeChanged=function(){e.prototype.handleSizeChanged.call(this),this._updatingLayout||this.updateLayout()},i.prototype.handleGrayedChanged=function(){},i.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.color;case t.ObjectPropID.Playing:return this.playing;case t.ObjectPropID.Frame:return this.frame;case t.ObjectPropID.TimeScale:return 1;default:return e.prototype.getProp.call(this,i)}},i.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.color=n;break;case t.ObjectPropID.Playing:this.playing=n;break;case t.ObjectPropID.Frame:this.frame=n;break;case t.ObjectPropID.TimeScale:case t.ObjectPropID.DeltaTime:break;default:e.prototype.setProp.call(this,i,n)}},i.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,5),this._url=t.readS(),this._align=t.readByte(),this._verticalAlign=t.readByte(),this._fill=t.readByte(),this._shrinkOnly=t.readBool(),this._autoSize=t.readBool(),this._animationName=t.readS(),this._skinName=t.readS(),this._playing=t.readBool(),this._frame=t.readInt(),this._loop=t.readBool(),t.readBool()&&(this.color=t.readColor()),this._url&&this.loadContent()},i}(t.GObject);t.GLoader3D=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){return e.call(this)||this}return __extends(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this._content.color},set:function(t){this._content.color!=t&&(this._content.color=t,this.updateGear(4))},enumerable:!0,configurable:!0}),i.prototype.createDisplayObject=function(){this._content=new t.MovieClip,this._content.touchEnabled=!1,this.setDisplayObject(this._content)},Object.defineProperty(i.prototype,"playing",{get:function(){return this._content.playing},set:function(t){this._content.playing!=t&&(this._content.playing=t,this.updateGear(5))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"frame",{get:function(){return this._content.frame},set:function(t){this._content.frame!=t&&(this._content.frame=t,this.updateGear(5))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"timeScale",{get:function(){return this._content.timeScale},set:function(t){this._content.timeScale=t},enumerable:!0,configurable:!0}),i.prototype.rewind=function(){this._content.rewind()},i.prototype.syncStatus=function(t){this._content.syncStatus(t._content)},i.prototype.advance=function(t){this._content.advance(t)},i.prototype.setPlaySettings=function(t,e,i,n,o,r){this._content.setPlaySettings(t,e,i,n,o,r)},i.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.color;case t.ObjectPropID.Playing:return this.playing;case t.ObjectPropID.Frame:return this.frame;case t.ObjectPropID.TimeScale:return this.timeScale;default:return e.prototype.getProp.call(this,i)}},i.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.color=n;break;case t.ObjectPropID.Playing:this.playing=n;break;case t.ObjectPropID.Frame:this.frame=n;break;case t.ObjectPropID.TimeScale:this.timeScale=n;break;case t.ObjectPropID.DeltaTime:this.advance(n);break;default:e.prototype.setProp.call(this,i,n)}},i.prototype.constructFromResource=function(){var t=this.packageItem.getBranch();this.sourceWidth=t.width,this.sourceHeight=t.height,this.initWidth=this.sourceWidth,this.initHeight=this.sourceHeight,this.setSize(this.sourceWidth,this.sourceHeight),(t=t.getHighResolution()).load(),this._content.interval=t.interval,this._content.swing=t.swing,this._content.repeatDelay=t.repeatDelay,this._content.frames=t.frames,this._content.smoothing=t.smoothing},i.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,5),t.readBool()&&(this.color=t.readColor()),t.readByte(),this._content.frame=t.readInt(),this._content.playing=t.readBool()},i}(t.GObject);t.GMovieClip=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._min=0,i._max=0,i._value=0,i._barMaxWidth=0,i._barMaxHeight=0,i._barMaxWidthDelta=0,i._barMaxHeightDelta=0,i._barStartX=0,i._barStartY=0,i._titleType=t.ProgressTitleType.Percent,i._value=50,i._max=100,i}return __extends(i,e),Object.defineProperty(i.prototype,"titleType",{get:function(){return this._titleType},set:function(t){this._titleType!=t&&(this._titleType=t,this.update(this._value))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"min",{get:function(){return this._min},set:function(t){this._min!=t&&(this._min=t,this.update(this._value))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"max",{get:function(){return this._max},set:function(t){this._max!=t&&(this._max=t,this.update(this._value))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this._value},set:function(e){this._value!=e&&(t.GTween.kill(this,!1,this.update),this._value=e,this.update(e))},enumerable:!0,configurable:!0}),i.prototype.tweenValue=function(e,i){var n,o=t.GTween.getTween(this,this.update);return o?(n=o.value.x,o.kill()):n=this._value,this._value=e,t.GTween.to(n,this._value,i).setTarget(this,this.update).setEase(t.EaseType.Linear)},i.prototype.update=function(e){var i=t.ToolSet.clamp01((e-this._min)/(this._max-this._min));if(this._titleObject)switch(this._titleType){case t.ProgressTitleType.Percent:this._titleObject.text=Math.floor(100*i)+"%";break;case t.ProgressTitleType.ValueAndMax:this._titleObject.text=Math.floor(e)+"/"+Math.floor(this._max);break;case t.ProgressTitleType.Value:this._titleObject.text=""+Math.floor(e);break;case t.ProgressTitleType.Max:this._titleObject.text=""+Math.floor(this._max)}var n=this.width-this._barMaxWidthDelta,o=this.height-this._barMaxHeightDelta;this._reverse?(this._barObjectH&&(this.setFillAmount(this._barObjectH,1-i)||(this._barObjectH.width=Math.round(n*i),this._barObjectH.x=this._barStartX+(n-this._barObjectH.width))),this._barObjectV&&(this.setFillAmount(this._barObjectV,1-i)||(this._barObjectV.height=Math.round(o*i),this._barObjectV.y=this._barStartY+(o-this._barObjectV.height)))):(this._barObjectH&&(this.setFillAmount(this._barObjectH,i)||(this._barObjectH.width=Math.round(n*i))),this._barObjectV&&(this.setFillAmount(this._barObjectV,i)||(this._barObjectV.height=Math.round(o*i)))),this._aniObject&&this._aniObject.setProp(t.ObjectPropID.Frame,Math.floor(100*i))},i.prototype.setFillAmount=function(e,i){return(e instanceof t.GImage||e instanceof t.GLoader)&&e.fillMethod!=t.FillMethod.None&&(e.fillAmount=i,!0)},i.prototype.constructExtension=function(t){t.seek(0,6),this._titleType=t.readByte(),this._reverse=t.readBool(),this._titleObject=this.getChild("title"),this._barObjectH=this.getChild("bar"),this._barObjectV=this.getChild("bar_v"),this._aniObject=this.getChild("ani"),this._barObjectH&&(this._barMaxWidth=this._barObjectH.width,this._barMaxWidthDelta=this.width-this._barMaxWidth,this._barStartX=this._barObjectH.x),this._barObjectV&&(this._barMaxHeight=this._barObjectV.height,this._barMaxHeightDelta=this.height-this._barMaxHeight,this._barStartY=this._barObjectV.y)},i.prototype.handleSizeChanged=function(){e.prototype.handleSizeChanged.call(this),this._barObjectH&&(this._barMaxWidth=this.width-this._barMaxWidthDelta),this._barObjectV&&(this._barMaxHeight=this.height-this._barMaxHeightDelta),this._underConstruct||this.update(this._value)},i.prototype.setup_afterAdd=function(t,i){e.prototype.setup_afterAdd.call(this,t,i),t.seek(i,6)&&t.readByte()==this.packageItem.objectType?(this._value=t.readInt(),this._max=t.readInt(),t.version>=2&&(this._min=t.readInt()),this.update(this._value)):this.update(this._value)},i}(t.GComponent);t.GProgressBar=e}(fgui||(fgui={})),function(t){var e=function(e){function s(){var i=e.call(this)||this;return i._fontSize=0,i._leading=0,i._letterSpacing=0,i._textWidth=0,i._textHeight=0,i._fontSize=12,i._align=t.AlignType.Left,i._verticalAlign=t.VertAlignType.Top,i._text="",i._leading=3,i._color=0,i._autoSize=t.AutoSizeType.Both,i._widthAutoSize=!0,i._heightAutoSize=!0,i}return __extends(s,e),s.prototype.createDisplayObject=function(){this._textField=new egret.TextField,this._textField.touchEnabled=!1,this.setDisplayObject(this._textField)},s.prototype.switchBitmapMode=function(t){t&&this.displayObject==this._textField?(null==this._bitmapContainer&&(this._bitmapContainer=new egret.Sprite),this.switchDisplayObject(this._bitmapContainer)):t||this.displayObject!=this._bitmapContainer||this.switchDisplayObject(this._textField)},s.prototype.dispose=function(){e.prototype.dispose.call(this),this._bitmapFont=null,this._requireRender=!1},Object.defineProperty(s.prototype,"text",{get:function(){return this._text},set:function(t){this._text=t,null==this._text&&(this._text=""),this.updateGear(6),this.parent&&this.parent._underConstruct?this.renderNow():this.render()},enumerable:!0,configurable:!0}),s.prototype.updateTextFieldText=function(){var e=this._text;if(this._templateVars&&(e=this.parseTemplate(e)),this._ubbEnabled){var i=s._htmlParser.parser(t.UBBParser.inst.parse(t.ToolSet.encodeHTML(e)));if(this._underline)for(var n=0;n<i.length;n++){var o=i[n];o.style?o.style.underline=!0:o.style={underline:!0}}this._textField.textFlow=i}else if(this._underline){(i=new Array(1))[0]={text:e,style:{underline:!0}},this._textField.textFlow=i}else this._textField.text=e},Object.defineProperty(s.prototype,"font",{get:function(){return this._font},set:function(t){this._font!=t&&(this._font=t,this.updateTextFormat())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){t<0||this._fontSize!=t&&(this._fontSize=t,this.updateTextFormat())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"color",{get:function(){return this._color},set:function(t){this._color!=t&&(this._color=t,this.updateGear(4),this.updateTextFormat())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"align",{get:function(){return this._align},set:function(t){this._align!=t&&(this._align=t,this._textField.textAlign=this.getAlignTypeString(this._align),this._bitmapFont&&!this._underConstruct&&this.render())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(t){this._verticalAlign!=t&&(this._verticalAlign=t,this._textField.verticalAlign=this.getVertAlignTypeString(this._verticalAlign),this._bitmapFont&&!this._underConstruct&&this.render())},enumerable:!0,configurable:!0}),s.prototype.getAlignTypeString=function(e){return e==t.AlignType.Left?egret.HorizontalAlign.LEFT:e==t.AlignType.Center?egret.HorizontalAlign.CENTER:egret.HorizontalAlign.RIGHT},s.prototype.getVertAlignTypeString=function(e){return e==t.VertAlignType.Top?egret.VerticalAlign.TOP:e==t.VertAlignType.Middle?egret.VerticalAlign.MIDDLE:egret.VerticalAlign.BOTTOM},Object.defineProperty(s.prototype,"leading",{get:function(){return this._leading},set:function(t){this._leading!=t&&(this._leading=t,this.updateTextFormat())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"letterSpacing",{get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!=t&&(this._letterSpacing=t,this.updateTextFormat())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"underline",{get:function(){return this._underline},set:function(t){this._underline=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"bold",{get:function(){return this._textField.bold},set:function(t){this._textField.bold=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"italic",{get:function(){return this._textField.italic},set:function(t){this._textField.italic=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"singleLine",{get:function(){return!this._textField.multiline},set:function(t){t=!t,this._textField.multiline!=t&&(this._textField.multiline=t,this.render())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"stroke",{get:function(){return this._textField.stroke},set:function(t){this._textField.stroke=t},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"strokeColor",{get:function(){return this._textField.strokeColor},set:function(t){this._textField.strokeColor=t,this.updateGear(4)},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"ubbEnabled",{get:function(){return this._ubbEnabled},set:function(t){this._ubbEnabled!=t&&(this._ubbEnabled=t,this.render())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"autoSize",{get:function(){return this._autoSize},set:function(e){this._autoSize!=e&&(this._autoSize=e,this._widthAutoSize=e==t.AutoSizeType.Both,this._heightAutoSize=e==t.AutoSizeType.Both||e==t.AutoSizeType.Height,this.render())},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"textWidth",{get:function(){return this._requireRender&&this.renderNow(),this._textWidth},enumerable:!0,configurable:!0}),s.prototype.ensureSizeCorrect=function(){this._sizeDirty&&this._requireRender&&this.renderNow()},s.prototype.updateTextFormat=function(){if(this._textField.size=this._fontSize,this._bitmapFont=null,t.ToolSet.startsWith(this._font,"ui://")){var e=t.UIPackage.getItemByURL(this._font);e&&(this._bitmapFont=e.owner.getItemAsset(e))}null==this._bitmapFont&&(this._font?this._textField.fontFamily=this._font:this._textField.fontFamily=t.UIConfig.defaultFont),this.grayed?this._textField.textColor=11184810:this._textField.textColor=this._color,this._textField.lineSpacing=this._leading,this._underConstruct||this.render()},s.prototype.render=function(){this._requireRender||(this._requireRender=!0,egret.callLater(this.__render,this)),this._sizeDirty||!this._widthAutoSize&&!this._heightAutoSize||(this._sizeDirty=!0,this.dispatchEventWith(t.GObject.SIZE_DELAY_CHANGE))},s.prototype.__render=function(){this._requireRender&&this.renderNow()},s.prototype.renderNow=function(t){if(void 0===t&&(t=!0),this._requireRender=!1,this._sizeDirty=!1,this._bitmapFont)this.renderWithBitmapFont(t);else{this.switchBitmapMode(!1),this._textField.width=this._widthAutoSize?this.maxWidth<=0?1e4:this.maxWidth:Math.ceil(this.width),this.updateTextFieldText(),this._textWidth=Math.ceil(this._textField.textWidth),this._textWidth>0&&(this._textWidth+=4),this._textHeight=Math.ceil(this._textField.textHeight),this._textHeight>0&&(this._textHeight+=4);var e,i=0;this._widthAutoSize?(e=this._textWidth,this._textField.width=e):e=this.width,this._heightAutoSize?(i=this._textHeight,this._textField.height!=this._textHeight&&(this._textField.height=this._textHeight)):(i=this.height,this._textHeight>i&&(this._textHeight=i)),t&&(this._updatingSize=!0,this.setSize(e,i),this._updatingSize=!1)}},s.prototype.renderWithBitmapFont=function(e){this.switchBitmapMode(!0),this._bitmapPool||(this._bitmapPool=[]);for(var s=this._bitmapContainer.numChildren,a=0;a<s;a++){var h=this._bitmapContainer.getChildAt(a);this._bitmapPool.push(h)}this._bitmapContainer.removeChildren(),this._lines?function(t){for(var e=t.length,n=0;n<e;n++){var o=t[n];i.push(o)}t.length=0}(this._lines):this._lines=new Array;var l,c=this._letterSpacing,u=this._leading-1,_=this.width-2*o,p=0,d=0,g=0,f=0,y=0,m=0,b=0,v=0,w=0,C="",S=r,x=!this._widthAutoSize&&this._textField.multiline,T=this._bitmapFont.resizable?this._fontSize/this._bitmapFont.size:1,I=this._bitmapFont.tint;this._textWidth=0,this._textHeight=0;var P=this._text;this._templateVars&&(P=this.parseTemplate(P));for(var O=P.length,j=0;j<O;++j){var k=P.charAt(j),B=k.charCodeAt(0);if(10!=B){if(B>=65&&B<=90||B>=97&&B<=122?(0==m&&(b=p),m++):(m>0&&(v=p),m=0),32==B)f=Math.ceil(this._fontSize/2),y=this._fontSize;else{var L=this._bitmapFont.glyphs[k];L?(f=Math.ceil(L.advance*T),y=Math.ceil(L.lineHeight*T)):(f=0,y=0)}if(y>g&&(g=y),y>d&&(d=y),0!=p&&(p+=c),p+=f,!x||p<=_)C+=k;else{if((l=n()).height=d,l.textHeight=g,0==C.length)l.text=k;else if(m>0&&v>0){var A=(C+=k).length-m;l.text=t.ToolSet.trimRight(C.substr(0,A)),l.width=v,C=C.substr(A),p-=b}else l.text=C,l.width=p-(f+c),C=k,p=f,d=y,g=y;l.y=S,S+=l.height+u,l.width>this._textWidth&&(this._textWidth=l.width),m=0,b=0,v=0,this._lines.push(l)}}else C+=k,(l=n()).width=p,0==g&&(0==w&&(w=this._fontSize),0==d&&(d=w),g=d),l.height=d,w=d,l.textHeight=g,l.text=C,l.y=S,S+=l.height+u,l.width>this._textWidth&&(this._textWidth=l.width),this._lines.push(l),C="",p=0,d=0,g=0,m=0,b=0,v=0}C.length>0&&((l=n()).width=p,0==d&&(d=w),0==g&&(g=d),l.height=d,l.textHeight=g,l.text=C,l.y=S,l.width>this._textWidth&&(this._textWidth=l.width),this._lines.push(l)),this._textWidth>0&&(this._textWidth+=2*o),0==this._lines.length?this._textHeight=0:(l=this._lines[this._lines.length-1],this._textHeight=l.y+l.height+r);var z,E=0;if(z=this._widthAutoSize?0==this._textWidth?0:this._textWidth:this.width,E=this._heightAutoSize?0==this._textHeight?0:this._textHeight:this.height,e&&(this._updatingSize=!0,this.setSize(z,E),this._updatingSize=!1),0!=z&&0!=E){var M=o,F=0,R=0;_=this.width-2*o;var D=this._lines.length;for(a=0;a<D;a++){l=this._lines[a],M=o,F=this._align==t.AlignType.Center?(_-l.width)/2:this._align==t.AlignType.Right?_-l.width:0,O=l.text.length;for(var G=0;G<O;G++){var H;if(10!=(B=(k=l.text.charAt(G)).charCodeAt(0)))if(32!=B)if(L=this._bitmapFont.glyphs[k])R=(l.height+l.textHeight)/2-Math.ceil(L.lineHeight*T),this._bitmapPool.length?H=this._bitmapPool.pop():(H=new egret.Bitmap).smoothing=!0,H.x=M+F+Math.ceil(L.x*T),H.y=l.y+R+Math.ceil(L.y*T),H.$backupY=H.y,H.texture=L.texture,H.scaleX=T,H.scaleY=T,H.tint=I?this._color:16777215,this._bitmapContainer.addChild(H),M+=c+Math.ceil(L.advance*T);else M+=c;else M+=c+Math.ceil(this._fontSize/2)}}this.doAlign()}},s.prototype.handleSizeChanged=function(){this._updatingSize||(this._bitmapFont?this._widthAutoSize?this.doAlign():this.render():this._underConstruct?(this._textField.width=this.width,this._textField.height=this.height):this._widthAutoSize||(this._heightAutoSize?this._textField.width=this.width:(this._textField.width=this.width,this._textField.height=this.height)))},s.prototype.parseTemplate=function(t){for(var e,i,n,o,r=0,s="";-1!=(e=t.indexOf("{",r));)if(e>0&&92==t.charCodeAt(e-1))s+=t.substring(r,e-1),s+="{",r=e+1;else{if(s+=t.substring(r,e),r=e,-1==(e=t.indexOf("}",r)))break;e!=r+1?(-1!=(i=(n=t.substring(r+1,e)).indexOf("="))?s+=null==(o=this._templateVars[n.substring(0,i)])?n.substring(i+1):o:null!=(o=this._templateVars[n])&&(s+=o),r=e+1):(s+=t.substr(r,2),r=e+1)}return r<t.length&&(s+=t.substr(r)),s},Object.defineProperty(s.prototype,"templateVars",{get:function(){return this._templateVars},set:function(t){(this._templateVars||t)&&(this._templateVars=t,this.flushVars())},enumerable:!0,configurable:!0}),s.prototype.setVar=function(t,e){return this._templateVars||(this._templateVars={}),this._templateVars[t]=e,this},s.prototype.flushVars=function(){this.render()},s.prototype.handleGrayedChanged=function(){e.prototype.handleGrayedChanged.call(this),this.updateTextFormat()},s.prototype.doAlign=function(){var e;if(this._verticalAlign==t.VertAlignType.Top||0==this._textHeight)e=r;else{var i=this.height-this._textHeight;i<0&&(i=0),e=this._verticalAlign==t.VertAlignType.Middle?Math.floor(i/2):Math.floor(i)}for(var n=this._bitmapContainer.numChildren,o=0;o<n;o++){var s=this._bitmapContainer.getChildAt(o);s.y=s.$backupY+e}},s.prototype.getProp=function(i){switch(i){case t.ObjectPropID.Color:return this.color;case t.ObjectPropID.OutlineColor:return this.strokeColor;case t.ObjectPropID.FontSize:return this.fontSize;default:return e.prototype.getProp.call(this,i)}},s.prototype.setProp=function(i,n){switch(i){case t.ObjectPropID.Color:this.color=n;break;case t.ObjectPropID.OutlineColor:this.strokeColor=n;break;case t.ObjectPropID.FontSize:this.fontSize=n;break;default:e.prototype.setProp.call(this,i,n)}},s.prototype.setup_beforeAdd=function(i,n){e.prototype.setup_beforeAdd.call(this,i,n),i.seek(n,5),this._font=i.readS(),this._fontSize=i.readShort(),this._color=i.readColor(),this.align=i.readByte(),this.verticalAlign=i.readByte(),this._leading=i.readShort(),this._letterSpacing=i.readShort(),this._ubbEnabled=i.readBool(),this._autoSize=i.readByte(),this._widthAutoSize=this._autoSize==t.AutoSizeType.Both,this._heightAutoSize=this._autoSize==t.AutoSizeType.Both||this._autoSize==t.AutoSizeType.Height,this._underline=i.readBool(),this._textField.italic=i.readBool(),this._textField.bold=i.readBool(),this._textField.multiline=!i.readBool(),i.readBool()&&(this._textField.strokeColor=i.readColor(),this.stroke=i.readFloat()+1),i.readBool()&&i.skip(12),i.readBool()&&(this._templateVars={})},s.prototype.setup_afterAdd=function(t,i){e.prototype.setup_afterAdd.call(this,t,i),this.updateTextFormat(),t.seek(i,6);var n=t.readS();null!=n&&(this.text=n),this._sizeDirty=!1},s._htmlParser=new egret.HtmlTextParser,s}(t.GObject);t.GTextField=e;var i=[];function n(){if(i.length){var t=i.pop();return t.width=0,t.height=0,t.textHeight=0,t.text=null,t.y=0,t}return{width:0,height:0,textHeight:0,text:null,y:0}}var o=2,r=2}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._textField.touchEnabled=!0,t}return __extends(i,e),i.prototype.updateTextFieldText=function(){var e,i=this._text;if(this._templateVars&&(i=this.parseTemplate(i)),e=this._ubbEnabled?t.GTextField._htmlParser.parser(t.UBBParser.inst.parse(i)):t.GTextField._htmlParser.parser(i),this._underline)for(var n=0;n<e.length;n++){var o=e[n];o.style?o.style.underline=!0:o.style={underline:!0}}this._textField.textFlow=e},i}(t.GTextField);t.GRichTextField=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return null==i._inst&&(i._inst=t),t.opaque=!1,t._volumeScale=1,t._popupStack=new Array,t._justClosedPopups=new Array,t.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE,t.__addedToStage,t),t}return __extends(i,e),Object.defineProperty(i,"inst",{get:function(){return null==i._inst&&new i,i._inst},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"nativeStage",{get:function(){return this._nativeStage},enumerable:!0,configurable:!0}),i.prototype.showWindow=function(t){this.addChild(t),t.requestFocus(),t.x>this.width?t.x=this.width-t.width:t.x+t.width<0&&(t.x=0),t.y>this.height?t.y=this.height-t.height:t.y+t.height<0&&(t.y=0),this.adjustModalLayer()},i.prototype.hideWindow=function(t){t.hide()},i.prototype.hideWindowImmediately=function(t){t.parent==this&&this.removeChild(t),this.adjustModalLayer()},i.prototype.bringToFront=function(e){var i,n=this.numChildren;for(i=null==this._modalLayer.parent||e.modal?n-1:this.getChildIndex(this._modalLayer)-1;i>=0;i--){var o=this.getChildAt(i);if(o==e)return;if(o instanceof t.Window)break}i>=0&&this.setChildIndex(e,i)},i.prototype.showModalWait=function(e){null!=t.UIConfig.globalModalWaiting&&(null==this._modalWaitPane&&(this._modalWaitPane=t.UIPackage.createObjectFromURL(t.UIConfig.globalModalWaiting)),this._modalWaitPane.setSize(this.width,this.height),this._modalWaitPane.addRelation(this,t.RelationType.Size),this.addChild(this._modalWaitPane),this._modalWaitPane.text=e)},i.prototype.closeModalWait=function(){null!=this._modalWaitPane&&null!=this._modalWaitPane.parent&&this.removeChild(this._modalWaitPane)},i.prototype.closeAllExceptModals=function(){for(var e=this._children.slice(),i=e.length,n=0;n<i;n++){var o=e[n];o instanceof t.Window&&!o.modal&&o.hide()}},i.prototype.closeAllWindows=function(){for(var e=this._children.slice(),i=e.length,n=0;n<i;n++){var o=e[n];o instanceof t.Window&&o.hide()}},i.prototype.getTopWindow=function(){for(var e=this.numChildren-1;e>=0;e--){var i=this.getChildAt(e);if(i instanceof t.Window)return i}return null},Object.defineProperty(i.prototype,"modalLayer",{get:function(){return this._modalLayer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"hasModalWindow",{get:function(){return null!=this._modalLayer.parent},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"modalWaiting",{get:function(){return this._modalWaitPane&&this._modalWaitPane.inContainer},enumerable:!0,configurable:!0}),i.prototype.showPopup=function(e,n,o){if(this._popupStack.length>0){var r=this._popupStack.indexOf(e);if(-1!=r)for(var s=this._popupStack.length-1;s>=r;s--)this.removeChild(this._popupStack.pop())}if(this._popupStack.push(e),n)for(var a=n;a;){if(a.parent==this){e.sortingOrder<a.sortingOrder&&(e.sortingOrder=a.sortingOrder);break}a=a.parent}var h;this.addChild(e),this.adjustModalLayer();var l,c,u=0,_=0;n?(h=n.localToRoot(),u=n.width,_=n.height):h=this.globalToLocal(i.mouseX,i.mouseY),(l=h.x)+e.width>this.width&&(l=l+u-e.width),c=h.y+_,((void 0===o||o===t.PopupDirection.Auto)&&h.y+e.height>this.height||!1===o||o===t.PopupDirection.Up)&&(c=h.y-e.height-1)<0&&(c=0,l+=u/2),e.x=l,e.y=c},i.prototype.togglePopup=function(t,e,i){-1==this._justClosedPopups.indexOf(t)&&this.showPopup(t,e,i)},i.prototype.hidePopup=function(t){if(t){var e=this._popupStack.indexOf(t);if(-1!=e)for(var i=this._popupStack.length-1;i>=e;i--)this.closePopup(this._popupStack.pop())}else{for(i=this._popupStack.length-1;i>=0;i--)this.closePopup(this._popupStack[i]);this._popupStack.length=0}},Object.defineProperty(i.prototype,"hasAnyPopup",{get:function(){return 0!=this._popupStack.length},enumerable:!0,configurable:!0}),i.prototype.closePopup=function(e){e.parent&&(e instanceof t.Window?e.hide():this.removeChild(e))},i.prototype.showTooltips=function(e){if(null==this._defaultTooltipWin){var i=t.UIConfig.tooltipsWin;if(!i)return void console.error("UIConfig.tooltipsWin not defined");this._defaultTooltipWin=t.UIPackage.createObjectFromURL(i)}this._defaultTooltipWin.text=e,this.showTooltipsWin(this._defaultTooltipWin)},i.prototype.showTooltipsWin=function(t,e){this.hideTooltips(),this._tooltipWin=t;var n=0,o=0;e?(n=e.x,o=e.y):(n=i.mouseX+10,o=i.mouseY+20);var r=this.globalToLocal(n,o);n=r.x,o=r.y,n+this._tooltipWin.width>this.width&&(n=n-this._tooltipWin.width-1)<0&&(n=10),o+this._tooltipWin.height>this.height&&(o=o-this._tooltipWin.height-1,n-this._tooltipWin.width-1>0&&(n=n-this._tooltipWin.width-1),o<0&&(o=10)),this._tooltipWin.x=n,this._tooltipWin.y=o,this.addChild(this._tooltipWin)},i.prototype.hideTooltips=function(){this._tooltipWin&&(this._tooltipWin.parent&&this.removeChild(this._tooltipWin),this._tooltipWin=null)},i.prototype.getObjectUnderPoint=function(e,i){var n=this._nativeStage.$hitTest(e,i);return n?t.ToolSet.displayObjectToGObject(n):null},Object.defineProperty(i.prototype,"focus",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),i.prototype.setFocus=function(t){},Object.defineProperty(i.prototype,"volumeScale",{get:function(){return this._volumeScale},set:function(t){this._volumeScale=t},enumerable:!0,configurable:!0}),i.prototype.playOneShotSound=function(t,e){e=e||1;var i=this._volumeScale*e;t.play(0,1).volume=i},i.prototype.adjustModalLayer=function(){var e=this.numChildren;this._modalWaitPane&&this._modalWaitPane.parent&&this.setChildIndex(this._modalWaitPane,e-1);for(var i=e-1;i>=0;i--){var n=this.getChildAt(i);if(n instanceof t.Window&&n.modal)return void(null==this._modalLayer.parent?this.addChildAt(this._modalLayer,i):this.setChildIndexBefore(this._modalLayer,i))}this._modalLayer.parent&&this.removeChild(this._modalLayer)},i.prototype.__addedToStage=function(e){this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE,this.__addedToStage,this),this._nativeStage=this.displayObject.stage,this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__stageMouseDownCapture,this,!0),this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_END,this.__stageMouseUpCapture,this,!0),this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.__stageMouseMoveCapture,this,!0),this._modalLayer=new t.GGraph,this._modalLayer.setSize(this.width,this.height),this._modalLayer.drawRect(0,0,0,t.UIConfig.modalLayerColor,t.UIConfig.modalLayerAlpha),this._modalLayer.addRelation(this,t.RelationType.Size),this.displayObject.stage.addEventListener(egret.Event.RESIZE,this.__winResize,this),this.__winResize(null)},i.prototype.__stageMouseDownCapture=function(t){if(i.mouseX=t.stageX,i.mouseY=t.stageY,i.touchDown=!0,this._tooltipWin&&this.hideTooltips(),this._justClosedPopups.length=0,this._popupStack.length>0){for(var e=t.target;e!=this.displayObject.stage&&e;){if(e.$owner){var n=this._popupStack.indexOf(e.$owner);if(-1!=n){for(var o=this._popupStack.length-1;o>n;o--){var r=this._popupStack.pop();this.closePopup(r),this._justClosedPopups.push(r)}return}}e=e.parent}for(o=this._popupStack.length-1;o>=0;o--)r=this._popupStack[o],this.closePopup(r),this._justClosedPopups.push(r);this._popupStack.length=0}},i.prototype.__stageMouseMoveCapture=function(t){i.mouseX=t.stageX,i.mouseY=t.stageY},i.prototype.__stageMouseUpCapture=function(t){i.touchDown=!1},i.prototype.__winResize=function(t){this.setSize(this._nativeStage.stageWidth,this._nativeStage.stageHeight)},i.prototype.updateContentScaleLevel=function(){i.contentScaleLevel=0},i.contentScaleLevel=0,i.contentScaleFactor=1,i}(t.GComponent);t.GRoot=e}(fgui||(fgui={})),function(t){var e=function(t){function e(){var e=t.call(this)||this;return e._dragOffset=new egret.Point,e._scrollPerc=0,e}return __extends(e,t),e.prototype.setScrollPane=function(t,e){this._target=t,this._vertical=e},e.prototype.setDisplayPerc=function(t){this._vertical?(this._fixedGripSize||(this._grip.height=Math.floor(t*this._bar.height)),this._grip.y=this._bar.y+(this._bar.height-this._grip.height)*this._scrollPerc):(this._fixedGripSize||(this._grip.width=Math.floor(t*this._bar.width)),this._grip.x=this._bar.x+(this._bar.width-this._grip.width)*this._scrollPerc),this._grip.visible=0!=t&&1!=t},e.prototype.setScrollPerc=function(t){this._scrollPerc=t,this._vertical?this._grip.y=this._bar.y+(this._bar.height-this._grip.height)*this._scrollPerc:this._grip.x=this._bar.x+(this._bar.width-this._grip.width)*this._scrollPerc},Object.defineProperty(e.prototype,"minSize",{get:function(){return this._vertical?(this._arrowButton1?this._arrowButton1.height:0)+(this._arrowButton2?this._arrowButton2.height:0):(this._arrowButton1?this._arrowButton1.width:0)+(this._arrowButton2?this._arrowButton2.width:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gripDragging",{get:function(){return this._gripDragging},enumerable:!0,configurable:!0}),e.prototype.constructExtension=function(t){t.seek(0,6),this._fixedGripSize=t.readBool(),this._grip=this.getChild("grip"),this._grip?(this._bar=this.getChild("bar"),this._bar?(this._arrowButton1=this.getChild("arrow1"),this._arrowButton2=this.getChild("arrow2"),this._grip.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__gripMouseDown,this),this._arrowButton1&&this._arrowButton1.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__arrowButton1Click,this),this._arrowButton2&&this._arrowButton2.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__arrowButton2Click,this),this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__barMouseDown,this)):console.error("需要定义bar")):console.error("需要定义grip")},e.prototype.__gripMouseDown=function(t){this._gripDragging=!0,this._target.updateScrollBarVisible(),t.stopPropagation(),this.globalToLocal(t.stageX,t.stageY,this._dragOffset),this._dragOffset.x-=this._grip.x,this._dragOffset.y-=this._grip.y,this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.__gripMouseMove,this),this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.__gripMouseUp,this)},e.prototype.__gripMouseMove=function(t){if(this.onStage){var e=this.globalToLocal(t.stageX,t.stageY,i);if(this._vertical){var n=e.y-this._dragOffset.y;this._target.setPercY((n-this._bar.y)/(this._bar.height-this._grip.height),!1)}else{var o=e.x-this._dragOffset.x;this._target.setPercX((o-this._bar.x)/(this._bar.width-this._grip.width),!1)}}},e.prototype.__gripMouseUp=function(t){var e=t.currentTarget;e.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.__gripMouseMove,this),e.removeEventListener(egret.TouchEvent.TOUCH_END,this.__gripMouseUp,this),this.onStage||(this._gripDragging=!1,this._target.updateScrollBarVisible())},e.prototype.__arrowButton1Click=function(t){t.stopPropagation(),this._vertical?this._target.scrollUp():this._target.scrollLeft()},e.prototype.__arrowButton2Click=function(t){t.stopPropagation(),this._vertical?this._target.scrollDown():this._target.scrollRight()},e.prototype.__barMouseDown=function(t){var e=this._grip.globalToLocal(t.stageX,t.stageY,i);this._vertical?e.y<0?this._target.scrollUp(4):this._target.scrollDown(4):e.x<0?this._target.scrollLeft(4):this._target.scrollRight(4)},e}(t.GComponent);t.GScrollBar=e;var i=new egret.Point}(fgui||(fgui={})),function(t){var e=function(e){function n(){var i=e.call(this)||this;return i._min=0,i._max=0,i._value=0,i._barMaxWidth=0,i._barMaxHeight=0,i._barMaxWidthDelta=0,i._barMaxHeightDelta=0,i._clickPercent=0,i._barStartX=0,i._barStartY=0,i.changeOnClick=!0,i.canDrag=!0,i._titleType=t.ProgressTitleType.Percent,i._value=50,i._max=100,i._clickPos=new egret.Point,i}return __extends(n,e),Object.defineProperty(n.prototype,"titleType",{get:function(){return this._titleType},set:function(t){this._titleType=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wholeNumbers",{get:function(){return this._wholeNumbers},set:function(t){this._wholeNumbers!=t&&(this._wholeNumbers=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this._min},set:function(t){this._min!=t&&(this._min=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this._max},set:function(t){this._max!=t&&(this._max=t,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this._value},set:function(t){this._value!=t&&(this._value=t,this.update())},enumerable:!0,configurable:!0}),n.prototype.update=function(){this.updateWithPercent((this._value-this._min)/(this._max-this._min))},n.prototype.updateWithPercent=function(e,i){if(e=t.ToolSet.clamp01(e),i){var n=t.ToolSet.clamp(this._min+(this._max-this._min)*e,this._min,this._max);this._wholeNumbers&&(n=Math.round(n),e=t.ToolSet.clamp01((n-this._min)/(this._max-this._min))),n!=this._value&&(this._value=n,this.dispatchEvent(new t.StateChangeEvent(t.StateChangeEvent.CHANGED)))}if(this._titleObject)switch(this._titleType){case t.ProgressTitleType.Percent:this._titleObject.text=Math.floor(100*e)+"%";break;case t.ProgressTitleType.ValueAndMax:this._titleObject.text=this._value+"/"+this._max;break;case t.ProgressTitleType.Value:this._titleObject.text=""+this._value;break;case t.ProgressTitleType.Max:this._titleObject.text=""+this._max}var o=this.width-this._barMaxWidthDelta,r=this.height-this._barMaxHeightDelta;this._reverse?(this._barObjectH&&(this._barObjectH.width=Math.round(o*e),this._barObjectH.x=this._barStartX+(o-this._barObjectH.width)),this._barObjectV&&(this._barObjectV.height=Math.round(r*e),this._barObjectV.y=this._barStartY+(r-this._barObjectV.height))):(this._barObjectH&&(this._barObjectH.width=Math.round(o*e)),this._barObjectV&&(this._barObjectV.height=Math.round(r*e)))},n.prototype.constructExtension=function(t){t.seek(0,6),this._titleType=t.readByte(),this._reverse=t.readBool(),t.version>=2&&(this._wholeNumbers=t.readBool(),this.changeOnClick=t.readBool()),this._titleObject=this.getChild("title"),this._barObjectH=this.getChild("bar"),this._barObjectV=this.getChild("bar_v"),this._gripObject=this.getChild("grip"),this._barObjectH&&(this._barMaxWidth=this._barObjectH.width,this._barMaxWidthDelta=this.width-this._barMaxWidth,this._barStartX=this._barObjectH.x),this._barObjectV&&(this._barMaxHeight=this._barObjectV.height,this._barMaxHeightDelta=this.height-this._barMaxHeight,this._barStartY=this._barObjectV.y),this._gripObject&&this._gripObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__gripMouseDown,this),this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__barMouseDown,this)},n.prototype.handleSizeChanged=function(){e.prototype.handleSizeChanged.call(this),this._barObjectH&&(this._barMaxWidth=this.width-this._barMaxWidthDelta),this._barObjectV&&(this._barMaxHeight=this.height-this._barMaxHeightDelta),this._underConstruct||this.update()},n.prototype.setup_afterAdd=function(t,i){e.prototype.setup_afterAdd.call(this,t,i),t.seek(i,6)&&t.readByte()==this.packageItem.objectType?(this._value=t.readInt(),this._max=t.readInt(),t.version>=2&&(this._min=t.readInt()),this.update()):this.update()},n.prototype.__gripMouseDown=function(e){this.canDrag=!0,e.stopPropagation(),this._clickPos=this.globalToLocal(e.stageX,e.stageY),this._clickPercent=t.ToolSet.clamp01((this._value-this._min)/(this._max-this._min)),this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.__gripMouseMove,this),this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.__gripMouseUp,this)},n.prototype.__gripMouseMove=function(t){if(this.canDrag){var e,n=this.globalToLocal(t.stageX,t.stageY,i),o=n.x-this._clickPos.x,r=n.y-this._clickPos.y;this._reverse&&(o=-o,r=-r),e=this._barObjectH?this._clickPercent+o/this._barMaxWidth:this._clickPercent+r/this._barMaxHeight,this.updateWithPercent(e,!0)}},n.prototype.__gripMouseUp=function(t){t.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.__gripMouseMove,this),t.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END,this.__gripMouseUp,this)},n.prototype.__barMouseDown=function(e){if(this.changeOnClick){var n,o=this._gripObject.globalToLocal(e.stageX,e.stageY,i),r=t.ToolSet.clamp01((this._value-this._min)/(this._max-this._min));this._barObjectH&&(n=o.x/this._barMaxWidth),this._barObjectV&&(n=o.y/this._barMaxHeight),this._reverse?r-=n:r+=n,this.updateWithPercent(r,!0)}},n}(t.GComponent);t.GSlider=e;var i=new egret.Point}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._widthAutoSize=!1,t._heightAutoSize=!1,t.displayObject.touchChildren=!0,t._textField.type=egret.TextFieldType.INPUT,t._textField.addEventListener(egret.Event.CHANGE,t.__textChanged,t),t._textField.addEventListener(egret.FocusEvent.FOCUS_IN,t.__focusIn,t),t._textField.addEventListener(egret.FocusEvent.FOCUS_OUT,t.__focusOut,t),t}return __extends(i,e),i.prototype.dispose=function(){e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"editable",{get:function(){return this._textField.type==egret.TextFieldType.INPUT},set:function(t){this._textField.type=t?egret.TextFieldType.INPUT:egret.TextFieldType.DYNAMIC},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"maxLength",{get:function(){return this._textField.maxChars},set:function(t){this._textField.maxChars=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"promptText",{get:function(){return this._promptText},set:function(t){this._promptText=t,this.updateTextFieldText()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"restrict",{get:function(){return this._textField.restrict},set:function(t){this._textField.restrict=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"password",{get:function(){return this._password},set:function(t){this._password!=t&&(this._password=t,this._textField.displayAsPassword=this._password,this._textField.inputType=t?egret.TextFieldInputType.PASSWORD:egret.TextFieldInputType.TEXT,this.render())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"verticalAlign",{get:function(){return this._verticalAlign},set:function(t){this._verticalAlign!=t&&(this._verticalAlign=t,this.updateVertAlign())},enumerable:!0,configurable:!0}),i.prototype.updateVertAlign=function(){switch(this._verticalAlign){case t.VertAlignType.Top:this._textField.verticalAlign=egret.VerticalAlign.TOP;break;case t.VertAlignType.Middle:this._textField.verticalAlign=egret.VerticalAlign.MIDDLE;break;case t.VertAlignType.Bottom:this._textField.verticalAlign=egret.VerticalAlign.BOTTOM}},i.prototype.updateTextFieldText=function(){!this._text&&this._promptText?(this._textField.displayAsPassword=!1,this._textField.textFlow=(new egret.HtmlTextParser).parser(t.UBBParser.inst.parse(this._promptText))):(this._textField.displayAsPassword=this._password,this._ubbEnabled?this._textField.textFlow=(new egret.HtmlTextParser).parser(t.UBBParser.inst.parse(t.ToolSet.encodeHTML(this._text))):this._textField.text=this._text)},i.prototype.handleSizeChanged=function(){this._updatingSize||(this._textField.width=Math.ceil(this.width),this._textField.height=Math.ceil(this.height))},i.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,4);var n=t.readS();null!=n&&(this._promptText=n),null!=(n=t.readS())&&(this._textField.restrict=n);var o=t.readInt();0!=o&&(this._textField.maxChars=o),o=t.readInt(),t.readBool()&&(this.password=!0),this.updateVertAlign()},i.prototype.setup_afterAdd=function(i,n){e.prototype.setup_afterAdd.call(this,i,n),!this._text&&this._promptText&&(this._textField.displayAsPassword=!1,this._textField.textFlow=(new egret.HtmlTextParser).parser(t.UBBParser.inst.parse(t.ToolSet.encodeHTML(this._promptText))))},i.prototype.__textChanged=function(t){this._text=this._textField.text},i.prototype.__focusIn=function(t){!this._text&&this._promptText&&(this._textField.displayAsPassword=this._password,this._textField.text="")},i.prototype.__focusOut=function(e){this._text=this._textField.text,!this._text&&this._promptText&&(this._textField.displayAsPassword=!1,this._textField.textFlow=(new egret.HtmlTextParser).parser(t.UBBParser.inst.parse(t.ToolSet.encodeHTML(this._promptText))))},i}(t.GTextField);t.GTextInput=e}(fgui||(fgui={})),function(t){var e=function(e){function n(){var i=e.call(this)||this;return i._indent=15,i._rootNode=new t.GTreeNode(!0),i._rootNode._setTree(i),i._rootNode.expanded=!0,i}return __extends(n,e),Object.defineProperty(n.prototype,"rootNode",{get:function(){return this._rootNode},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"indent",{get:function(){return this._indent},set:function(t){this._indent=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"clickToExpand",{get:function(){return this._clickToExpand},set:function(t){this._clickToExpand=t},enumerable:!0,configurable:!0}),n.prototype.getSelectedNode=function(){return-1!=this.selectedIndex?this.getChildAt(this.selectedIndex)._treeNode:null},n.prototype.getSelectedNodes=function(t){t||(t=new Array),i.length=0,e.prototype.getSelection.call(this,i);for(var n=i.length,o=new Array,r=0;r<n;r++){var s=this.getChildAt(i[r])._treeNode;o.push(s)}return o},n.prototype.selectNode=function(t,e){for(var i=t.parent;i&&i!=this._rootNode;)i.expanded=!0,i=i.parent;t._cell&&this.addSelection(this.getChildIndex(t._cell),e)},n.prototype.unselectNode=function(t){t._cell&&this.removeSelection(this.getChildIndex(t._cell))},n.prototype.expandAll=function(t){t||(t=this._rootNode),t.expanded=!0;for(var e=t.numChildren,i=0;i<e;i++){var n=t.getChildAt(i);n.isFolder&&this.expandAll(n)}},n.prototype.collapseAll=function(t){t||(t=this._rootNode),t!=this._rootNode&&(t.expanded=!1);for(var e=t.numChildren,i=0;i<e;i++){var n=t.getChildAt(i);n.isFolder&&this.collapseAll(n)}},n.prototype.createCell=function(e){var i=this.getFromPool(e._resURL?e._resURL:this.defaultItem);if(!(i instanceof t.GComponent))throw new Error("cannot create tree node object.");i._treeNode=e,e._cell=i;var n,o=i.getChild("indent");null!=o&&(o.width=(e.level-1)*this._indent),(n=i.getController("expanded"))&&(n.addEventListener(t.StateChangeEvent.CHANGED,this.__expandedStateChanged,this),n.selectedIndex=e.expanded?1:0),(n=i.getController("leaf"))&&(n.selectedIndex=e.isFolder?0:1),e.isFolder&&i.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.__cellMouseDown,this),this.treeNodeRender&&this.treeNodeRender.call(this.callbackThisObj,e,i)},n.prototype._afterInserted=function(t){t._cell||this.createCell(t);var e=this.getInsertIndexForNode(t);this.addChildAt(t._cell,e),this.treeNodeRender&&this.treeNodeRender.call(this.callbackThisObj,t,t._cell),t.isFolder&&t.expanded&&this.checkChildren(t,e)},n.prototype.getInsertIndexForNode=function(t){var e=t.getPrevSibling();null==e&&(e=t.parent);for(var i=this.getChildIndex(e._cell)+1,n=t.level,o=this.numChildren,r=i;r<o;r++){if(this.getChildAt(r)._treeNode.level<=n)break;i++}return i},n.prototype._afterRemoved=function(t){this.removeNode(t)},n.prototype._afterExpanded=function(t){if(t!=this._rootNode){if(null!=this.treeNodeWillExpand&&this.treeNodeWillExpand.call(this.callbackThisObj,t,!0),null!=t._cell){this.treeNodeRender&&this.treeNodeRender.call(this.callbackThisObj,t,t._cell);var e=t._cell.getController("expanded");e&&(e.selectedIndex=1),t._cell.parent&&this.checkChildren(t,this.getChildIndex(t._cell))}}else this.checkChildren(this._rootNode,0)},n.prototype._afterCollapsed=function(t){if(t!=this._rootNode){if(this.treeNodeWillExpand&&this.treeNodeWillExpand.call(this.callbackThisObj,t,!1),null!=t._cell){this.treeNodeRender&&this.treeNodeRender.call(this.callbackThisObj,t,t._cell);var e=t._cell.getController("expanded");e&&(e.selectedIndex=0),t._cell.parent&&this.hideFolderNode(t)}}else this.checkChildren(this._rootNode,0)},n.prototype._afterMoved=function(t){var e,i=this.getChildIndex(t._cell);e=t.isFolder?this.getFolderEndIndex(i,t.level):i+1;var n,o,r=this.getInsertIndexForNode(t),s=e-i;if(r<i)for(n=0;n<s;n++)o=this.getChildAt(i+n),this.setChildIndex(o,r+n);else for(n=0;n<s;n++)o=this.getChildAt(i),this.setChildIndex(o,r)},n.prototype.getFolderEndIndex=function(t,e){for(var i=this.numChildren,n=t+1;n<i;n++){if(this.getChildAt(n)._treeNode.level<=e)return n}return i},n.prototype.checkChildren=function(t,e){for(var i=t.numChildren,n=0;n<i;n++){e++;var o=t.getChildAt(n);null==o._cell&&this.createCell(o),o._cell.parent||this.addChildAt(o._cell,e),o.isFolder&&o.expanded&&(e=this.checkChildren(o,e))}return e},n.prototype.hideFolderNode=function(t){for(var e=t.numChildren,i=0;i<e;i++){var n=t.getChildAt(i);n._cell&&this.removeChild(n._cell),n.isFolder&&n.expanded&&this.hideFolderNode(n)}},n.prototype.removeNode=function(t){if(t._cell&&(t._cell.parent&&this.removeChild(t._cell),this.returnToPool(t._cell),t._cell._treeNode=null,t._cell=null),t.isFolder)for(var e=t.numChildren,i=0;i<e;i++){var n=t.getChildAt(i);this.removeNode(n)}},n.prototype.__cellMouseDown=function(t){var e=t.currentTarget._treeNode;this._expandedStatusInEvt=e.expanded},n.prototype.__expandedStateChanged=function(t){var e=t.currentTarget;e.parent._treeNode.expanded=1==e.selectedIndex},n.prototype.dispatchItemEvent=function(t){if(0!=this._clickToExpand){var i=t.itemObject._treeNode;i&&i.isFolder&&this._expandedStatusInEvt==i.expanded&&(2==this._clickToExpand||(i.expanded=!i.expanded))}e.prototype.dispatchItemEvent.call(this,t)},n.prototype.setup_beforeAdd=function(t,i){e.prototype.setup_beforeAdd.call(this,t,i),t.seek(i,9),this._indent=t.readInt(),this._clickToExpand=t.readByte()},n.prototype.readItems=function(e){var i,n,o,r,s,a,h,l=0;for(i=e.readShort(),n=0;n<i;n++)if(o=e.readShort(),o+=e.position,null!=(r=e.readS())||(r=this.defaultItem)){s=e.readBool(),h=e.readByte();var c=new t.GTreeNode(s,r);if(c.expanded=!0,0==n)this._rootNode.addChild(c);else if(h>l)a.addChild(c);else if(h<l){for(var u=h;u<=l;u++)a=a.parent;a.addChild(c)}else a.parent.addChild(c);a=c,l=h,this.setupItem(e,c.cell),e.position=o}else e.position=o},n}(t.GList);t.GTree=e;var i=new Array}(fgui||(fgui={})),function(t){var e=function(){function t(t,e){this._level=0,this._resURL=e,t&&(this._children=new Array)}return Object.defineProperty(t.prototype,"expanded",{get:function(){return this._expanded},set:function(t){this._children&&this._expanded!=t&&(this._expanded=t,this._tree&&(this._expanded?this._tree._afterExpanded(this):this._tree._afterCollapsed(this)))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFolder",{get:function(){return null!=this._children},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"text",{get:function(){return this._cell?this._cell.text:null},set:function(t){this._cell&&(this._cell.text=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{get:function(){return this._cell?this._cell.icon:null},set:function(t){this._cell&&(this._cell.icon=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cell",{get:function(){return this._cell},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0}),t.prototype._setLevel=function(t){this._level=t},t.prototype.addChild=function(t){return this.addChildAt(t,this._children.length),t},t.prototype.addChildAt=function(t,e){if(!t)throw new Error("child is null");var i=this._children.length;if(e>=0&&e<=i){if(t._parent==this)this.setChildIndex(t,e);else t._parent&&t._parent.removeChild(t),e==this._children.length?this._children.push(t):this._children.splice(e,0,t),t._parent=this,t._level=this._level+1,t._setTree(this._tree),(this._tree&&this==this._tree.rootNode||this._cell&&this._cell.parent&&this._expanded)&&this._tree._afterInserted(t);return t}throw new RangeError("Invalid child index")},t.prototype.removeChild=function(t){var e=this._children.indexOf(t);return-1!=e&&this.removeChildAt(e),t},t.prototype.removeChildAt=function(t){if(t>=0&&t<this.numChildren){var e=this._children[t];return this._children.splice(t,1),e._parent=null,this._tree&&(e._setTree(null),this._tree._afterRemoved(e)),e}throw"Invalid child index"},t.prototype.removeChildren=function(t,e){t=t||0,null==e&&(e=-1),(e<0||e>=this.numChildren)&&(e=this.numChildren-1);for(var i=t;i<=e;++i)this.removeChildAt(t)},t.prototype.getChildAt=function(t){if(t>=0&&t<this.numChildren)return this._children[t];throw"Invalid child index"},t.prototype.getChildIndex=function(t){return this._children.indexOf(t)},t.prototype.getPrevSibling=function(){if(null==this._parent)return null;var t=this._parent._children.indexOf(this);return t<=0?null:this._parent._children[t-1]},t.prototype.getNextSibling=function(){if(null==this._parent)return null;var t=this._parent._children.indexOf(this);return t<0||t>=this._parent._children.length-1?null:this._parent._children[t+1]},t.prototype.setChildIndex=function(t,e){var i=this._children.indexOf(t);if(-1==i)throw"Not a child of this container";var n=this._children.length;e<0?e=0:e>n&&(e=n),i!=e&&(this._children.splice(i,1),this._children.splice(e,0,t),(this._tree&&this==this._tree.rootNode||this._cell&&this._cell.parent&&this._expanded)&&this._tree._afterMoved(t))},t.prototype.swapChildren=function(t,e){var i=this._children.indexOf(t),n=this._children.indexOf(e);if(-1==i||-1==n)throw"Not a child of this container";this.swapChildrenAt(i,n)},t.prototype.swapChildrenAt=function(t,e){var i=this._children[t],n=this._children[e];this.setChildIndex(i,e),this.setChildIndex(n,t)},Object.defineProperty(t.prototype,"numChildren",{get:function(){return this._children.length},enumerable:!0,configurable:!0}),t.prototype.expandToRoot=function(){for(var t=this;t;)t.expanded=!0,t=t.parent},Object.defineProperty(t.prototype,"tree",{get:function(){return this._tree},enumerable:!0,configurable:!0}),t.prototype._setTree=function(t){if(this._tree=t,this._tree&&this._tree.treeNodeWillExpand&&this._expanded&&this._tree.treeNodeWillExpand(this,!0),this._children)for(var e=this._children.length,i=0;i<e;i++){var n=this._children[i];n._level=this._level+1,n._setTree(t)}},t}();t.GTreeNode=e}(fgui||(fgui={})),function(t){var e=function(){function t(){this.left=0,this.right=0,this.top=0,this.bottom=0}return t.prototype.copy=function(t){this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right},t}();t.Margin=e}(fgui||(fgui={})),function(t){var e=function(){function t(t,e,i){this._data=t,this.offsetX=e,this.offsetY=i,this.scaleX=1,this.scaleY=1}return t.prototype.contains=function(t,e){if(t=Math.floor((t/this.scaleX-this.offsetX)*this._data.scale),e=Math.floor((e/this.scaleY-this.offsetY)*this._data.scale),t<0||e<0||t>=this._data.pixelWidth)return!1;var i=e*this._data.pixelWidth+t,n=Math.floor(i/8),o=i%8;return n>=0&&n<this._data.pixels.length&&1==(this._data.pixels[n]>>o&1)},t}();t.PixelHitTest=e;var i=function(){function t(){}return t.prototype.load=function(t){t.readInt(),this.pixelWidth=t.readInt(),this.scale=1/t.readByte();var e=t.readInt();this.pixels=[];for(var i=0;i<e;i++){var n=t.readByte();n<0&&(n+=256),this.pixels[i]=n}},t}();t.PixelHitTestData=i}(fgui||(fgui={})),function(t){var e=function(){function e(){this.width=0,this.height=0}return e.prototype.load=function(){return this.owner.getItemAsset(this)},e.prototype.getBranch=function(){if(this.branches&&-1!=this.owner._branchIndex){var t=this.branches[this.owner._branchIndex];if(t)return this.owner.getItemById(t)}return this},e.prototype.getHighResolution=function(){if(this.highResolution&&t.GRoot.contentScaleLevel>0){var e=this.highResolution[t.GRoot.contentScaleLevel-1];if(e)return this.owner.getItemById(e)}return this},e.prototype.toString=function(){return this.name},e}();t.PackageItem=e}(fgui||(fgui={})),function(t){var e=function(){function e(e){if(!e&&!(e=t.UIConfig.popupMenu))throw"UIConfig.popupMenu not defined";this._contentPane=t.UIPackage.createObjectFromURL(e).asCom,this._contentPane.addEventListener(egret.Event.ADDED_TO_STAGE,this.__addedToStage,this),this._list=this._contentPane.getChild("list"),this._list.removeChildrenToPool(),this._list.addRelation(this._contentPane,t.RelationType.Width),this._list.removeRelation(this._contentPane,t.RelationType.Height),this._contentPane.addRelation(this._list,t.RelationType.Height),this._list.addEventListener(t.ItemEvent.CLICK,this.__clickItem,this)}return e.prototype.dispose=function(){this._contentPane.dispose()},e.prototype.addItem=function(t,e){var i=this._list.addItemFromPool().asButton;i.title=t,i.data=e,i.grayed=!1;var n=i.getController("checked");return n&&(n.selectedIndex=0),i},e.prototype.addItemAt=function(t,e,i){var n=this._list.getFromPool().asButton;this._list.addChildAt(n,e),n.title=t,n.data=i,n.grayed=!1;var o=n.getController("checked");return o&&(o.selectedIndex=0),n},e.prototype.addSeperator=function(){if(null==t.UIConfig.popupMenu_seperator)throw"UIConfig.popupMenu_seperator not defined";this.list.addItemFromPool(t.UIConfig.popupMenu_seperator)},e.prototype.getItemName=function(t){return this._list.getChildAt(t).name},e.prototype.setItemText=function(t,e){this._list.getChild(t).asButton.title=e},e.prototype.setItemVisible=function(t,e){var i=this._list.getChild(t).asButton;i.visible!=e&&(i.visible=e,this._list.setBoundsChangedFlag())},e.prototype.setItemGrayed=function(t,e){this._list.getChild(t).asButton.grayed=e},e.prototype.setItemCheckable=function(t,e){var i=this._list.getChild(t).asButton.getController("checked");i&&(e?0==i.selectedIndex&&(i.selectedIndex=1):i.selectedIndex=0)},e.prototype.setItemChecked=function(t,e){var i=this._list.getChild(t).asButton.getController("checked");i&&(i.selectedIndex=e?2:1)},e.prototype.isItemChecked=function(t){var e=this._list.getChild(t).asButton.getController("checked");return!!e&&2==e.selectedIndex},e.prototype.removeItem=function(t){var e=this._list.getChild(t);if(e){var i=this._list.getChildIndex(e);return this._list.removeChildToPoolAt(i),!0}return!1},e.prototype.clearItems=function(){this._list.removeChildrenToPool()},Object.defineProperty(e.prototype,"itemCount",{get:function(){return this._list.numChildren},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contentPane",{get:function(){return this._contentPane},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"list",{get:function(){return this._list},enumerable:!0,configurable:!0}),e.prototype.show=function(e,i){(e?e.root:t.GRoot.inst).showPopup(this.contentPane,e instanceof t.GRoot?null:e,i)},e.prototype.__clickItem=function(e){t.GTimers.inst.add(100,1,this.__clickItem2,this,e)},e.prototype.__clickItem2=function(t){var e=t.itemObject.asButton;if(null!=e)if(e.grayed)this._list.selectedIndex=-1;else{var i=e.getController("checked");i&&0!=i.selectedIndex&&(1==i.selectedIndex?i.selectedIndex=2:i.selectedIndex=1),this._contentPane.parent.hidePopup(this.contentPane),null!=e.data&&(1==e.data.length?e.data(t):e.data())}},e.prototype.__addedToStage=function(t){this._list.selectedIndex=-1,this._list.resizeToFit(1e5,10)},e}();t.PopupMenu=e}(fgui||(fgui={})),function(t){var e=function(){function e(t){this._owner=t,this._defs=new Array}return Object.defineProperty(e.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this._target},set:function(t){this._target!=t&&(this._target&&this.releaseRefTarget(this._target),this._target=t,this._target&&this.addRefTarget(this._target))},enumerable:!0,configurable:!0}),e.prototype.add=function(e,i){if(e==t.RelationType.Size)return this.add(t.RelationType.Width,i),void this.add(t.RelationType.Height,i);for(var n=this._defs.length,o=0;o<n;o++){if(this._defs[o].type==e)return}this.internalAdd(e,i)},e.prototype.internalAdd=function(e,n){if(e==t.RelationType.Size)return this.internalAdd(t.RelationType.Width,n),void this.internalAdd(t.RelationType.Height,n);var o=new i;o.percent=n,o.type=e,o.axis=e<=t.RelationType.Right_Right||e==t.RelationType.Width||e>=t.RelationType.LeftExt_Left&&e<=t.RelationType.RightExt_Right?0:1,this._defs.push(o),(n||e==t.RelationType.Left_Center||e==t.RelationType.Center_Center||e==t.RelationType.Right_Center||e==t.RelationType.Top_Middle||e==t.RelationType.Middle_Middle||e==t.RelationType.Bottom_Middle)&&(this._owner.pixelSnapping=!0)},e.prototype.remove=function(e){if(void 0===e&&(e=0),e==t.RelationType.Size)return this.remove(t.RelationType.Width),void this.remove(t.RelationType.Height);for(var i=this._defs.length,n=0;n<i;n++)if(this._defs[n].type==e){this._defs.splice(n,1);break}},e.prototype.copyFrom=function(t){this.target=t.target,this._defs.length=0;for(var e=t._defs.length,n=0;n<e;n++){var o=t._defs[n],r=new i;r.copyFrom(o),this._defs.push(r)}},e.prototype.dispose=function(){this._target&&(this.releaseRefTarget(this._target),this._target=null)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0==this._defs.length},enumerable:!0,configurable:!0}),e.prototype.applyOnSelfResized=function(e,i,n){for(var o=this._owner.x,r=this._owner.y,s=this._defs.length,a=0;a<s;a++){switch(this._defs[a].type){case t.RelationType.Center_Center:this._owner.x-=(.5-(n?this._owner.pivotX:0))*e;break;case t.RelationType.Right_Center:case t.RelationType.Right_Left:case t.RelationType.Right_Right:this._owner.x-=(1-(n?this._owner.pivotX:0))*e;break;case t.RelationType.Middle_Middle:this._owner.y-=(.5-(n?this._owner.pivotY:0))*i;break;case t.RelationType.Bottom_Middle:case t.RelationType.Bottom_Top:case t.RelationType.Bottom_Bottom:this._owner.y-=(1-(n?this._owner.pivotY:0))*i}}if((o!=this._owner.x||r!=this._owner.y)&&(o=this._owner.x-o,r=this._owner.y-r,this._owner.updateGearFromRelations(1,o,r),this._owner.parent)){var h=this._owner.parent._transitions.length;if(h>0)for(a=0;a<h;++a)this._owner.parent._transitions[a].updateFromRelations(this._owner.id,o,r)}},e.prototype.applyOnXYChanged=function(e,i,n){var o;switch(e.type){case t.RelationType.Left_Left:case t.RelationType.Left_Center:case t.RelationType.Left_Right:case t.RelationType.Center_Center:case t.RelationType.Right_Left:case t.RelationType.Right_Center:case t.RelationType.Right_Right:this._owner.x+=i;break;case t.RelationType.Top_Top:case t.RelationType.Top_Middle:case t.RelationType.Top_Bottom:case t.RelationType.Middle_Middle:case t.RelationType.Bottom_Top:case t.RelationType.Bottom_Middle:case t.RelationType.Bottom_Bottom:this._owner.y+=n;break;case t.RelationType.Width:case t.RelationType.Height:break;case t.RelationType.LeftExt_Left:case t.RelationType.LeftExt_Right:this._owner!=this._target.parent?(o=this._owner.xMin,this._owner.width=this._owner._rawWidth-i,this._owner.xMin=o+i):this._owner.width=this._owner._rawWidth-i;break;case t.RelationType.RightExt_Left:case t.RelationType.RightExt_Right:this._owner!=this._target.parent?(o=this._owner.xMin,this._owner.width=this._owner._rawWidth+i,this._owner.xMin=o):this._owner.width=this._owner._rawWidth+i;break;case t.RelationType.TopExt_Top:case t.RelationType.TopExt_Bottom:this._owner!=this._target.parent?(o=this._owner.yMin,this._owner.height=this._owner._rawHeight-n,this._owner.yMin=o+n):this._owner.height=this._owner._rawHeight-n;break;case t.RelationType.BottomExt_Top:case t.RelationType.BottomExt_Bottom:this._owner!=this._target.parent?(o=this._owner.yMin,this._owner.height=this._owner._rawHeight+n,this._owner.yMin=o):this._owner.height=this._owner._rawHeight+n}},e.prototype.applyOnSizeChanged=function(e){var i,n,o=0,r=0,s=0;switch(0==e.axis?(this._target!=this._owner.parent&&(o=this._target.x,this._target.pivotAsAnchor&&(r=this._target.pivotX)),e.percent?0!=this._targetWidth&&(s=this._target._width/this._targetWidth):s=this._target._width-this._targetWidth):(this._target!=this._owner.parent&&(o=this._target.y,this._target.pivotAsAnchor&&(r=this._target.pivotY)),e.percent?0!=this._targetHeight&&(s=this._target._height/this._targetHeight):s=this._target._height-this._targetHeight),e.type){case t.RelationType.Left_Left:e.percent?this._owner.xMin=o+(this._owner.xMin-o)*s:0!=r&&(this._owner.x+=s*-r);break;case t.RelationType.Left_Center:e.percent?this._owner.xMin=o+(this._owner.xMin-o)*s:this._owner.x+=s*(.5-r);break;case t.RelationType.Left_Right:e.percent?this._owner.xMin=o+(this._owner.xMin-o)*s:this._owner.x+=s*(1-r);break;case t.RelationType.Center_Center:e.percent?this._owner.xMin=o+(this._owner.xMin+.5*this._owner._rawWidth-o)*s-.5*this._owner._rawWidth:this._owner.x+=s*(.5-r);break;case t.RelationType.Right_Left:e.percent?this._owner.xMin=o+(this._owner.xMin+this._owner._rawWidth-o)*s-this._owner._rawWidth:0!=r&&(this._owner.x+=s*-r);break;case t.RelationType.Right_Center:e.percent?this._owner.xMin=o+(this._owner.xMin+this._owner._rawWidth-o)*s-this._owner._rawWidth:this._owner.x+=s*(.5-r);break;case t.RelationType.Right_Right:e.percent?this._owner.xMin=o+(this._owner.xMin+this._owner._rawWidth-o)*s-this._owner._rawWidth:this._owner.x+=s*(1-r);break;case t.RelationType.Top_Top:e.percent?this._owner.yMin=o+(this._owner.yMin-o)*s:0!=r&&(this._owner.y+=s*-r);break;case t.RelationType.Top_Middle:e.percent?this._owner.yMin=o+(this._owner.yMin-o)*s:this._owner.y+=s*(.5-r);break;case t.RelationType.Top_Bottom:e.percent?this._owner.yMin=o+(this._owner.yMin-o)*s:this._owner.y+=s*(1-r);break;case t.RelationType.Middle_Middle:e.percent?this._owner.yMin=o+(this._owner.yMin+.5*this._owner._rawHeight-o)*s-.5*this._owner._rawHeight:this._owner.y+=s*(.5-r);break;case t.RelationType.Bottom_Top:e.percent?this._owner.yMin=o+(this._owner.yMin+this._owner._rawHeight-o)*s-this._owner._rawHeight:0!=r&&(this._owner.y+=s*-r);break;case t.RelationType.Bottom_Middle:e.percent?this._owner.yMin=o+(this._owner.yMin+this._owner._rawHeight-o)*s-this._owner._rawHeight:this._owner.y+=s*(.5-r);break;case t.RelationType.Bottom_Bottom:e.percent?this._owner.yMin=o+(this._owner.yMin+this._owner._rawHeight-o)*s-this._owner._rawHeight:this._owner.y+=s*(1-r);break;case t.RelationType.Width:i=this._owner._underConstruct&&this._owner==this._target.parent?this._owner.sourceWidth-this._target.initWidth:this._owner._rawWidth-this._targetWidth,e.percent&&(i*=s),this._target==this._owner.parent?this._owner.pivotAsAnchor?(n=this._owner.xMin,this._owner.setSize(this._target._width+i,this._owner._rawHeight,!0),this._owner.xMin=n):this._owner.setSize(this._target._width+i,this._owner._rawHeight,!0):this._owner.width=this._target._width+i;break;case t.RelationType.Height:i=this._owner._underConstruct&&this._owner==this._target.parent?this._owner.sourceHeight-this._target.initHeight:this._owner._rawHeight-this._targetHeight,e.percent&&(i*=s),this._target==this._owner.parent?this._owner.pivotAsAnchor?(n=this._owner.yMin,this._owner.setSize(this._owner._rawWidth,this._target._height+i,!0),this._owner.yMin=n):this._owner.setSize(this._owner._rawWidth,this._target._height+i,!0):this._owner.height=this._target._height+i;break;case t.RelationType.LeftExt_Left:n=this._owner.xMin,i=e.percent?o+(n-o)*s-n:s*-r,this._owner.width=this._owner._rawWidth-i,this._owner.xMin=n+i;break;case t.RelationType.LeftExt_Right:n=this._owner.xMin,i=e.percent?o+(n-o)*s-n:s*(1-r),this._owner.width=this._owner._rawWidth-i,this._owner.xMin=n+i;break;case t.RelationType.RightExt_Left:n=this._owner.xMin,i=e.percent?o+(n+this._owner._rawWidth-o)*s-(n+this._owner._rawWidth):s*-r,this._owner.width=this._owner._rawWidth+i,this._owner.xMin=n;break;case t.RelationType.RightExt_Right:n=this._owner.xMin,e.percent?this._owner==this._target.parent?this._owner._underConstruct?this._owner.width=o+this._target._width-this._target._width*r+(this._owner.sourceWidth-o-this._target.initWidth+this._target.initWidth*r)*s:this._owner.width=o+(this._owner._rawWidth-o)*s:(i=o+(n+this._owner._rawWidth-o)*s-(n+this._owner._rawWidth),this._owner.width=this._owner._rawWidth+i,this._owner.xMin=n):this._owner==this._target.parent?this._owner._underConstruct?this._owner.width=this._owner.sourceWidth+(this._target._width-this._target.initWidth)*(1-r):this._owner.width=this._owner._rawWidth+s*(1-r):(i=s*(1-r),this._owner.width=this._owner._rawWidth+i,this._owner.xMin=n);break;case t.RelationType.TopExt_Top:n=this._owner.yMin,i=e.percent?o+(n-o)*s-n:s*-r,this._owner.height=this._owner._rawHeight-i,this._owner.yMin=n+i;break;case t.RelationType.TopExt_Bottom:n=this._owner.yMin,i=e.percent?o+(n-o)*s-n:s*(1-r),this._owner.height=this._owner._rawHeight-i,this._owner.yMin=n+i;break;case t.RelationType.BottomExt_Top:n=this._owner.yMin,i=e.percent?o+(n+this._owner._rawHeight-o)*s-(n+this._owner._rawHeight):s*-r,this._owner.height=this._owner._rawHeight+i,this._owner.yMin=n;break;case t.RelationType.BottomExt_Bottom:n=this._owner.yMin,e.percent?this._owner==this._target.parent?this._owner._underConstruct?this._owner.height=o+this._target._height-this._target._height*r+(this._owner.sourceHeight-o-this._target.initHeight+this._target.initHeight*r)*s:this._owner.height=o+(this._owner._rawHeight-o)*s:(i=o+(n+this._owner._rawHeight-o)*s-(n+this._owner._rawHeight),this._owner.height=this._owner._rawHeight+i,this._owner.yMin=n):this._owner==this._target.parent?this._owner._underConstruct?this._owner.height=this._owner.sourceHeight+(this._target._height-this._target.initHeight)*(1-r):this._owner.height=this._owner._rawHeight+s*(1-r):(i=s*(1-r),this._owner.height=this._owner._rawHeight+i,this._owner.yMin=n)}},e.prototype.addRefTarget=function(e){e!=this._owner.parent&&e.addEventListener(t.GObject.XY_CHANGED,this.__targetXYChanged,this),e.addEventListener(t.GObject.SIZE_CHANGED,this.__targetSizeChanged,this),e.addEventListener(t.GObject.SIZE_DELAY_CHANGE,this.__targetSizeWillChange,this),this._targetX=this._target.x,this._targetY=this._target.y,this._targetWidth=this._target._width,this._targetHeight=this._target._height},e.prototype.releaseRefTarget=function(e){e.removeEventListener(t.GObject.XY_CHANGED,this.__targetXYChanged,this),e.removeEventListener(t.GObject.SIZE_CHANGED,this.__targetSizeChanged,this),e.removeEventListener(t.GObject.SIZE_DELAY_CHANGE,this.__targetSizeWillChange,this)},e.prototype.__targetXYChanged=function(t){if(null!=this._owner.relations.handling||null!=this._owner.group&&this._owner.group._updating)return this._targetX=this._target.x,void(this._targetY=this._target.y);this._owner.relations.handling=this._target;for(var e=this._owner.x,i=this._owner.y,n=this._target.x-this._targetX,o=this._target.y-this._targetY,r=this._defs.length,s=0;s<r;s++){var a=this._defs[s];this.applyOnXYChanged(a,n,o)}if(this._targetX=this._target.x,this._targetY=this._target.y,(e!=this._owner.x||i!=this._owner.y)&&(e=this._owner.x-e,i=this._owner.y-i,this._owner.updateGearFromRelations(1,e,i),this._owner.parent)){var h=this._owner.parent._transitions.length;if(h>0)for(s=0;s<h;++s)this._owner.parent._transitions[s].updateFromRelations(this._owner.id,e,i)}this._owner.relations.handling=null},e.prototype.__targetSizeChanged=function(t){if(null==this._owner.relations.handling){this._owner.relations.handling=this._target;for(var e=this._owner.x,i=this._owner.y,n=this._owner._rawWidth,o=this._owner._rawHeight,r=this._defs.length,s=0;s<r;s++){var a=this._defs[s];this.applyOnSizeChanged(a)}if(this._targetWidth=this._target._width,this._targetHeight=this._target._height,(e!=this._owner.x||i!=this._owner.y)&&(e=this._owner.x-e,i=this._owner.y-i,this._owner.updateGearFromRelations(1,e,i),this._owner.parent)){var h=this._owner.parent._transitions.length;if(h>0)for(s=0;s<h;++s)this._owner.parent._transitions[s].updateFromRelations(this._owner.id,e,i)}n==this._owner._rawWidth&&o==this._owner._rawHeight||(n=this._owner._rawWidth-n,o=this._owner._rawHeight-o,this._owner.updateGearFromRelations(2,n,o)),this._owner.relations.handling=null}},e.prototype.__targetSizeWillChange=function(t){this._owner.relations.sizeDirty=!0},e}();t.RelationItem=e;var i=function(){function t(){}return t.prototype.copyFrom=function(t){this.percent=t.percent,this.type=t.type,this.axis=t.axis},t}();t.RelationDef=i}(fgui||(fgui={})),function(t){var e=function(){function e(t){this._owner=t,this._items=new Array}return e.prototype.add=function(e,i,n){for(var o=this._items.length,r=0;r<o;r++){var s=this._items[r];if(s.target==e)return void s.add(i,n)}var a=new t.RelationItem(this._owner);a.target=e,a.add(i,n),this._items.push(a)},e.prototype.remove=function(t,e){e=e||0;for(var i=this._items.length,n=0;n<i;){var o=this._items[n];o.target==t?(o.remove(e),o.isEmpty?(o.dispose(),this._items.splice(n,1),i--):n++):n++}},e.prototype.contains=function(t){for(var e=this._items.length,i=0;i<e;i++){if(this._items[i].target==t)return!0}return!1},e.prototype.clearFor=function(t){for(var e=this._items.length,i=0;i<e;){var n=this._items[i];n.target==t?(n.dispose(),this._items.splice(i,1),e--):i++}},e.prototype.clearAll=function(){for(var t=this._items.length,e=0;e<t;e++){this._items[e].dispose()}this._items.length=0},e.prototype.copyFrom=function(e){this.clearAll();for(var i=e._items,n=i.length,o=0;o<n;o++){var r=i[o],s=new t.RelationItem(this._owner);s.copyFrom(r),this._items.push(s)}},e.prototype.dispose=function(){this.clearAll()},e.prototype.onOwnerSizeChanged=function(t,e,i){if(0!=this._items.length)for(var n=this._items.length,o=0;o<n;o++){this._items[o].applyOnSelfResized(t,e,i)}},e.prototype.ensureRelationsSizeCorrect=function(){if(0!=this._items.length){this.sizeDirty=!1;for(var t=this._items.length,e=0;e<t;e++){this._items[e].target.ensureSizeCorrect()}}},Object.defineProperty(e.prototype,"empty",{get:function(){return 0==this._items.length},enumerable:!0,configurable:!0}),e.prototype.setup=function(e,i){for(var n,o=e.readByte(),r=0;r<o;r++){var s=e.readShort();n=-1==s?this._owner.parent:i?this._owner.getChildAt(s):this._owner.parent.getChildAt(s);var a=new t.RelationItem(this._owner);a.target=n,this._items.push(a);for(var h=e.readByte(),l=0;l<h;l++){var c=e.readByte(),u=e.readBool();a.internalAdd(c,u)}}},e}();t.Relations=e}(fgui||(fgui={})),function(t){var e=function(e){function c(i){var n=e.call(this)||this;return n._owner=i,n._maskContainer=new egret.DisplayObjectContainer,n._owner._rootContainer.addChild(n._maskContainer),n._container=n._owner._container,n._container.x=0,n._container.y=0,n._maskContainer.addChild(n._container),n._scrollBarMargin=new t.Margin,n._xPos=0,n._yPos=0,n._aniFlag=0,n._tweening=0,n._footerLockedSize=0,n._headerLockedSize=0,n._viewSize=new egret.Point,n._contentSize=new egret.Point,n._pageSize=new egret.Point(1,1),n._overlapSize=new egret.Point,n._tweenTime=new egret.Point,n._tweenStart=new egret.Point,n._tweenDuration=new egret.Point,n._tweenChange=new egret.Point,n._velocity=new egret.Point,n._containerPos=new egret.Point,n._beginTouchPos=new egret.Point,n._lastTouchPos=new egret.Point,n._lastTouchGlobalPos=new egret.Point,n._scrollStep=t.UIConfig.defaultScrollStep,n._decelerationRate=t.UIConfig.defaultScrollDecelerationRate,n._owner.addEventListener(egret.TouchEvent.TOUCH_BEGIN,n.__touchBegin,n),n}return __extends(c,e),c.prototype.setup=function(e){this._scrollType=e.readByte();var i=e.readByte(),n=e.readInt();e.readBool()&&(this._scrollBarMargin.top=e.readInt(),this._scrollBarMargin.bottom=e.readInt(),this._scrollBarMargin.left=e.readInt(),this._scrollBarMargin.right=e.readInt());var o=e.readS(),r=e.readS(),s=e.readS(),a=e.readS();if(0!=(1&n)&&(this._displayOnLeft=!0),0!=(2&n)&&(this._snapToItem=!0),0!=(4&n)&&(this._displayInDemand=!0),0!=(8&n)&&(this._pageMode=!0),this._touchEffect=!!(16&n)||!(32&n)&&t.UIConfig.defaultScrollTouchEffect,this._bouncebackEffect=!!(64&n)||!(128&n)&&t.UIConfig.defaultScrollBounceEffect,0!=(256&n)&&(this._inertiaDisabled=!0),0==(512&n)&&(this._maskContainer.scrollRect=new egret.Rectangle),0!=(1024&n)&&(this._floating=!0),0!=(2048&n)&&(this._dontClipMargin=!0),i==t.ScrollBarDisplayType.Default&&(i=t.UIConfig.defaultScrollBarDisplay),i!=t.ScrollBarDisplayType.Hidden){var h;if(this._scrollType==t.ScrollType.Both||this._scrollType==t.ScrollType.Vertical)if(h=o||t.UIConfig.verticalScrollBar){if(this._vtScrollBar=t.UIPackage.createObjectFromURL(h),!this._vtScrollBar)throw"cannot create scrollbar from "+h;this._vtScrollBar.setScrollPane(this,!0),this._owner._rootContainer.addChild(this._vtScrollBar.displayObject)}if(this._scrollType==t.ScrollType.Both||this._scrollType==t.ScrollType.Horizontal)if(h=r||t.UIConfig.horizontalScrollBar){if(this._hzScrollBar=t.UIPackage.createObjectFromURL(h),!this._hzScrollBar)throw"cannot create scrollbar from "+h;this._hzScrollBar.setScrollPane(this,!1),this._owner._rootContainer.addChild(this._hzScrollBar.displayObject)}i==t.ScrollBarDisplayType.Auto&&(this._scrollBarDisplayAuto=!0),this._scrollBarDisplayAuto&&(this._vtScrollBar&&(this._vtScrollBar.displayObject.visible=!1),this._hzScrollBar&&(this._hzScrollBar.displayObject.visible=!1))}if(s&&(this._header=t.UIPackage.createObjectFromURL(s),!this._header))throw"cannot create scrollPane header from "+s;if(a&&(this._footer=t.UIPackage.createObjectFromURL(a),!this._footer))throw"cannot create scrollPane footer from "+a;(this._header||this._footer)&&(this._refreshBarAxis=this._scrollType==t.ScrollType.Both||this._scrollType==t.ScrollType.Vertical?"y":"x"),this.setSize(this._owner.width,this._owner.height)},c.prototype.dispose=function(){0!=this._tweening&&t.GTimers.inst.remove(this.tweenUpdate,this),delete this._pageController,this._hzScrollBar&&this._hzScrollBar.dispose(),this._vtScrollBar&&this._vtScrollBar.dispose(),this._header&&this._header.dispose(),this._footer&&this._footer.dispose()},Object.defineProperty(c.prototype,"owner",{get:function(){return this._owner},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"hzScrollBar",{get:function(){return this._hzScrollBar},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"vtScrollBar",{get:function(){return this._vtScrollBar},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"header",{get:function(){return this._header},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"footer",{get:function(){return this._footer},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"bouncebackEffect",{get:function(){return this._bouncebackEffect},set:function(t){this._bouncebackEffect=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"touchEffect",{get:function(){return this._touchEffect},set:function(t){this._touchEffect=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scrollStep",{get:function(){return this._scrollStep},set:function(e){this._scrollStep=e,0==this._scrollStep&&(this._scrollStep=t.UIConfig.defaultScrollStep)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"decelerationRate",{get:function(){return this._decelerationRate},set:function(t){this._decelerationRate=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"snapToItem",{get:function(){return this._snapToItem},set:function(t){this._snapToItem=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isDragged",{get:function(){return this._dragged},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"percX",{get:function(){return 0==this._overlapSize.x?0:this._xPos/this._overlapSize.x},set:function(t){this.setPercX(t,!1)},enumerable:!0,configurable:!0}),c.prototype.setPercX=function(e,i){void 0===i&&(i=!1),this._owner.ensureBoundsCorrect(),this.setPosX(this._overlapSize.x*t.ToolSet.clamp01(e),i)},Object.defineProperty(c.prototype,"percY",{get:function(){return 0==this._overlapSize.y?0:this._yPos/this._overlapSize.y},set:function(t){this.setPercY(t,!1)},enumerable:!0,configurable:!0}),c.prototype.setPercY=function(e,i){void 0===i&&(i=!1),this._owner.ensureBoundsCorrect(),this.setPosY(this._overlapSize.y*t.ToolSet.clamp01(e),i)},Object.defineProperty(c.prototype,"posX",{get:function(){return this._xPos},set:function(t){this.setPosX(t,!1)},enumerable:!0,configurable:!0}),c.prototype.setPosX=function(e,i){this._owner.ensureBoundsCorrect(),1==this._loop&&(e=this.loopCheckingNewPos(e,"x")),(e=t.ToolSet.clamp(e,0,this._overlapSize.x))!=this._xPos&&(this._xPos=e,this.posChanged(i))},Object.defineProperty(c.prototype,"posY",{get:function(){return this._yPos},set:function(t){this.setPosY(t,!1)},enumerable:!0,configurable:!0}),c.prototype.setPosY=function(e,i){this._owner.ensureBoundsCorrect(),1==this._loop&&(e=this.loopCheckingNewPos(e,"y")),(e=t.ToolSet.clamp(e,0,this._overlapSize.y))!=this._yPos&&(this._yPos=e,this.posChanged(i))},Object.defineProperty(c.prototype,"contentWidth",{get:function(){return this._contentSize.x},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"contentHeight",{get:function(){return this._contentSize.y},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"viewWidth",{get:function(){return this._viewSize.x},set:function(t){t=t+this._owner.margin.left+this._owner.margin.right,this._vtScrollBar&&!this._floating&&(t+=this._vtScrollBar.width),this._owner.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"viewHeight",{get:function(){return this._viewSize.y},set:function(t){t=t+this._owner.margin.top+this._owner.margin.bottom,this._hzScrollBar&&!this._floating&&(t+=this._hzScrollBar.height),this._owner.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"currentPageX",{get:function(){if(!this._pageMode)return 0;var t=Math.floor(this._xPos/this._pageSize.x);return this._xPos-t*this._pageSize.x>.5*this._pageSize.x&&t++,t},set:function(t){this.setCurrentPageX(t,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"currentPageY",{get:function(){if(!this._pageMode)return 0;var t=Math.floor(this._yPos/this._pageSize.y);return this._yPos-t*this._pageSize.y>.5*this._pageSize.y&&t++,t},set:function(t){this.setCurrentPageY(t,!1)},enumerable:!0,configurable:!0}),c.prototype.setCurrentPageX=function(t,e){this._pageMode&&(this._owner.ensureBoundsCorrect(),this._overlapSize.x>0&&this.setPosX(t*this._pageSize.x,e))},c.prototype.setCurrentPageY=function(t,e){this._pageMode&&(this._owner.ensureBoundsCorrect(),this._overlapSize.y>0&&this.setPosY(t*this._pageSize.y,e))},Object.defineProperty(c.prototype,"isBottomMost",{get:function(){return this._yPos==this._overlapSize.y||0==this._overlapSize.y},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isRightMost",{get:function(){return this._xPos==this._overlapSize.x||0==this._overlapSize.x},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"pageController",{get:function(){return this._pageController},set:function(t){this._pageController=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scrollingPosX",{get:function(){return t.ToolSet.clamp(-this._container.x,0,this._overlapSize.x)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"scrollingPosY",{get:function(){return t.ToolSet.clamp(-this._container.y,0,this._overlapSize.y)},enumerable:!0,configurable:!0}),c.prototype.scrollTop=function(t){this.setPercY(0,t)},c.prototype.scrollBottom=function(t){this.setPercY(1,t)},c.prototype.scrollUp=function(t,e){t=t||1,this._pageMode?this.setPosY(this._yPos-this._pageSize.y*t,e):this.setPosY(this._yPos-this._scrollStep*t,e)},c.prototype.scrollDown=function(t,e){t=t||1,this._pageMode?this.setPosY(this._yPos+this._pageSize.y*t,e):this.setPosY(this._yPos+this._scrollStep*t,e)},c.prototype.scrollLeft=function(t,e){t=t||1,this._pageMode?this.setPosX(this._xPos-this._pageSize.x*t,e):this.setPosX(this._xPos-this._scrollStep*t,e)},c.prototype.scrollRight=function(t,e){t=t||1,this._pageMode?this.setPosX(this._xPos+this._pageSize.x*t,e):this.setPosX(this._xPos+this._scrollStep*t,e)},c.prototype.scrollToView=function(e,i,n){var o;if(this._owner.ensureBoundsCorrect(),this._needRefresh&&this.refresh(),e instanceof t.GObject?e.parent!=this._owner?(e.parent.localToGlobalRect(e.x,e.y,e.width,e.height,a),o=this._owner.globalToLocalRect(a.x,a.y,a.width,a.height,a)):(o=a).setTo(e.x,e.y,e.width,e.height):o=e,this._overlapSize.y>0){var r=this._yPos+this._viewSize.y;n||o.y<=this._yPos||o.height>=this._viewSize.y?this._pageMode?this.setPosY(Math.floor(o.y/this._pageSize.y)*this._pageSize.y,i):this.setPosY(o.y,i):o.y+o.height>r&&(this._pageMode?this.setPosY(Math.floor(o.y/this._pageSize.y)*this._pageSize.y,i):o.height<=this._viewSize.y/2?this.setPosY(o.y+2*o.height-this._viewSize.y,i):this.setPosY(o.y+o.height-this._viewSize.y,i))}if(this._overlapSize.x>0){var s=this._xPos+this._viewSize.x;n||o.x<=this._xPos||o.width>=this._viewSize.x?this._pageMode?this.setPosX(Math.floor(o.x/this._pageSize.x)*this._pageSize.x,i):this.setPosX(o.x,i):o.x+o.width>s&&(this._pageMode?this.setPosX(Math.floor(o.x/this._pageSize.x)*this._pageSize.x,i):o.width<=this._viewSize.x/2?this.setPosX(o.x+2*o.width-this._viewSize.x,i):this.setPosX(o.x+o.width-this._viewSize.x,i))}!i&&this._needRefresh&&this.refresh()},c.prototype.isChildInView=function(t){if(this._overlapSize.y>0){var e=t.y+this._container.y;if(e<-t.height||e>this._viewSize.y)return!1}return!(this._overlapSize.x>0&&((e=t.x+this._container.x)<-t.width||e>this._viewSize.x))},c.prototype.cancelDragging=function(){this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.__touchMove,this),this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_END,this.__touchEnd,this),this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.__touchTap,this),c.draggingPane==this&&(c.draggingPane=null),i=0,this._dragged=!1,this._maskContainer.touchChildren=!0},c.prototype.lockHeader=function(t){this._headerLockedSize!=t&&(this._headerLockedSize=t,!this._refreshEventDispatching&&this._container[this._refreshBarAxis]>=0&&(this._tweenStart.setTo(this._container.x,this._container.y),this._tweenChange.setTo(0,0),this._tweenChange[this._refreshBarAxis]=this._headerLockedSize-this._tweenStart[this._refreshBarAxis],this._tweenDuration.setTo(o,o),this.startTween(2)))},c.prototype.lockFooter=function(t){if(this._footerLockedSize!=t&&(this._footerLockedSize=t,!this._refreshEventDispatching&&this._container[this._refreshBarAxis]<=-this._overlapSize[this._refreshBarAxis])){this._tweenStart.setTo(this._container.x,this._container.y),this._tweenChange.setTo(0,0);var e=this._overlapSize[this._refreshBarAxis];0==e?e=Math.max(this._contentSize[this._refreshBarAxis]+this._footerLockedSize-this._viewSize[this._refreshBarAxis],0):e+=this._footerLockedSize,this._tweenChange[this._refreshBarAxis]=-e-this._tweenStart[this._refreshBarAxis],this._tweenDuration.setTo(o,o),this.startTween(2)}},c.prototype.onOwnerSizeChanged=function(){this.setSize(this._owner.width,this._owner.height),this.posChanged(!1)},c.prototype.handleControllerChanged=function(e){this._pageController==e&&(this._scrollType==t.ScrollType.Horizontal?this.setCurrentPageX(e.selectedIndex,!0):this.setCurrentPageY(e.selectedIndex,!0))},c.prototype.updatePageController=function(){var e;if(this._pageController&&!this._pageController.changing&&(e=this._scrollType==t.ScrollType.Horizontal?this.currentPageX:this.currentPageY)<this._pageController.pageCount){var i=this._pageController;this._pageController=null,i.selectedIndex=e,this._pageController=i}},c.prototype.adjustMaskContainer=function(){var t=0,e=0;this._dontClipMargin?this._displayOnLeft&&this._vtScrollBar&&!this._floating&&(t=this._vtScrollBar.width):(t=this._displayOnLeft&&this._vtScrollBar&&!this._floating?this._owner.margin.left+this._vtScrollBar.width:this._owner.margin.left,e=this._owner.margin.top),this._maskContainer.x=t,this._maskContainer.y=e,t=this._owner._alignOffset.x,e=this._owner._alignOffset.y,(0!=t||0!=e||this._dontClipMargin)&&(this._alignContainer||(this._alignContainer=new egret.DisplayObjectContainer,this._maskContainer.addChild(this._alignContainer),this._alignContainer.addChild(this._container))),this._alignContainer&&(this._dontClipMargin&&(t+=this._owner.margin.left,e+=this._owner.margin.top),this._alignContainer.x=t,this._alignContainer.y=e)},c.prototype.setSize=function(t,e){this.adjustMaskContainer(),this._hzScrollBar&&(this._hzScrollBar.y=e-this._hzScrollBar.height,this._vtScrollBar&&!this._vScrollNone?(this._hzScrollBar.width=t-this._vtScrollBar.width-this._scrollBarMargin.left-this._scrollBarMargin.right,this._displayOnLeft?this._hzScrollBar.x=this._scrollBarMargin.left+this._vtScrollBar.width:this._hzScrollBar.x=this._scrollBarMargin.left):(this._hzScrollBar.width=t-this._scrollBarMargin.left-this._scrollBarMargin.right,this._hzScrollBar.x=this._scrollBarMargin.left)),this._vtScrollBar&&(this._displayOnLeft||(this._vtScrollBar.x=t-this._vtScrollBar.width),this._hzScrollBar?this._vtScrollBar.height=e-this._hzScrollBar.height-this._scrollBarMargin.top-this._scrollBarMargin.bottom:this._vtScrollBar.height=e-this._scrollBarMargin.top-this._scrollBarMargin.bottom,this._vtScrollBar.y=this._scrollBarMargin.top),this._viewSize.x=t,this._viewSize.y=e,this._hzScrollBar&&!this._floating&&(this._viewSize.y-=this._hzScrollBar.height),this._vtScrollBar&&!this._floating&&(this._viewSize.x-=this._vtScrollBar.width),this._viewSize.x-=this._owner.margin.left+this._owner.margin.right,this._viewSize.y-=this._owner.margin.top+this._owner.margin.bottom,this._viewSize.x=Math.max(1,this._viewSize.x),this._viewSize.y=Math.max(1,this._viewSize.y),this._pageSize.x=this._viewSize.x,this._pageSize.y=this._viewSize.y,this.handleSizeChanged()},c.prototype.setContentSize=function(t,e){this._contentSize.x==t&&this._contentSize.y==e||(this._contentSize.x=t,this._contentSize.y=e,this.handleSizeChanged())},c.prototype.changeContentSizeOnScrolling=function(t,e,i,n){var o=this._xPos==this._overlapSize.x,r=this._yPos==this._overlapSize.y;this._contentSize.x+=t,this._contentSize.y+=e,this.handleSizeChanged(),1==this._tweening?(0!=t&&o&&this._tweenChange.x<0&&(this._xPos=this._overlapSize.x,this._tweenChange.x=-this._xPos-this._tweenStart.x),0!=e&&r&&this._tweenChange.y<0&&(this._yPos=this._overlapSize.y,this._tweenChange.y=-this._yPos-this._tweenStart.y)):2==this._tweening?(0!=i&&(this._container.x-=i,this._tweenStart.x-=i,this._xPos=-this._container.x),0!=n&&(this._container.y-=n,this._tweenStart.y-=n,this._yPos=-this._container.y)):this._dragged?(0!=i&&(this._container.x-=i,this._containerPos.x-=i,this._xPos=-this._container.x),0!=n&&(this._container.y-=n,this._containerPos.y-=n,this._yPos=-this._container.y)):(0!=t&&o&&(this._xPos=this._overlapSize.x,this._container.x=-this._xPos),0!=e&&r&&(this._yPos=this._overlapSize.y,this._container.y=-this._yPos)),this._pageMode&&this.updatePageController()},c.prototype.handleSizeChanged=function(){this._displayInDemand&&(this._vScrollNone=this._contentSize.y<=this._viewSize.y,this._hScrollNone=this._contentSize.x<=this._viewSize.x),this._vtScrollBar&&(0==this._contentSize.y?this._vtScrollBar.setDisplayPerc(0):this._vtScrollBar.setDisplayPerc(Math.min(1,this._viewSize.y/this._contentSize.y))),this._hzScrollBar&&(0==this._contentSize.x?this._hzScrollBar.setDisplayPerc(0):this._hzScrollBar.setDisplayPerc(Math.min(1,this._viewSize.x/this._contentSize.x))),this.updateScrollBarVisible();var e=this._maskContainer.scrollRect;if(e&&(e.width=this._viewSize.x,e.height=this._viewSize.y,this._vScrollNone&&this._vtScrollBar&&(e.width+=this._vtScrollBar.width),this._hScrollNone&&this._hzScrollBar&&(e.height+=this._hzScrollBar.height),this._dontClipMargin&&(e.width+=this._owner.margin.left+this._owner.margin.right,e.height+=this._owner.margin.top+this._owner.margin.bottom),this._maskContainer.scrollRect=e),this._scrollType==t.ScrollType.Horizontal||this._scrollType==t.ScrollType.Both?this._overlapSize.x=Math.ceil(Math.max(0,this._contentSize.x-this._viewSize.x)):this._overlapSize.x=0,this._scrollType==t.ScrollType.Vertical||this._scrollType==t.ScrollType.Both?this._overlapSize.y=Math.ceil(Math.max(0,this._contentSize.y-this._viewSize.y)):this._overlapSize.y=0,this._xPos=t.ToolSet.clamp(this._xPos,0,this._overlapSize.x),this._yPos=t.ToolSet.clamp(this._yPos,0,this._overlapSize.y),null!=this._refreshBarAxis){var i=this._overlapSize[this._refreshBarAxis];0==i?i=Math.max(this._contentSize[this._refreshBarAxis]+this._footerLockedSize-this._viewSize[this._refreshBarAxis],0):i+=this._footerLockedSize,"x"==this._refreshBarAxis?(this._container.x=t.ToolSet.clamp(this._container.x,-i,this._headerLockedSize),this._container.y=t.ToolSet.clamp(this._container.y,-this._overlapSize.y,0)):(this._container.x=t.ToolSet.clamp(this._container.x,-this._overlapSize.x,0),this._container.y=t.ToolSet.clamp(this._container.y,-i,this._headerLockedSize)),this._header&&("x"==this._refreshBarAxis?this._header.height=this._viewSize.y:this._header.width=this._viewSize.x),this._footer&&("y"==this._refreshBarAxis?this._footer.height=this._viewSize.y:this._footer.width=this._viewSize.x)}else this._container.x=t.ToolSet.clamp(this._container.x,-this._overlapSize.x,0),this._container.y=t.ToolSet.clamp(this._container.y,-this._overlapSize.y,0);this.updateScrollBarPos(),this._pageMode&&this.updatePageController()},c.prototype.posChanged=function(e){0==this._aniFlag?this._aniFlag=e?1:-1:1!=this._aniFlag||e||(this._aniFlag=-1),this._needRefresh=!0,t.GTimers.inst.callLater(this.refresh,this),0!=this._tweening&&this.killTween()},c.prototype.refresh=function(){this._needRefresh=!1,t.GTimers.inst.remove(this.refresh,this),(this._pageMode||this._snapToItem)&&(h.setTo(-this._xPos,-this._yPos),this.alignPosition(h,!1),this._xPos=-h.x,this._yPos=-h.y),this.refresh2(),this.dispatchEventWith(c.SCROLL),this._needRefresh&&(this._needRefresh=!1,t.GTimers.inst.remove(this.refresh,this),this.refresh2()),this.updateScrollBarPos(),this._aniFlag=0},c.prototype.refresh2=function(){var t,e;1!=this._aniFlag||this._dragged?(0!=this._tweening&&this.killTween(),this._container.x=Math.floor(-this._xPos),this._container.y=Math.floor(-this._yPos),this.loopCheckingCurrent()):(this._overlapSize.x>0?t=-Math.floor(this._xPos):(0!=this._container.x&&(this._container.x=0),t=0),this._overlapSize.y>0?e=-Math.floor(this._yPos):(0!=this._container.y&&(this._container.y=0),e=0),t!=this._container.x||e!=this._container.y?(this._tweenDuration.setTo(n,n),this._tweenStart.setTo(this._container.x,this._container.y),this._tweenChange.setTo(t-this._tweenStart.x,e-this._tweenStart.y),this.startTween(1)):0!=this._tweening&&this.killTween());this._pageMode&&this.updatePageController()},c.prototype.__touchBegin=function(t){if(this._touchEffect){0!=this._tweening?(this.killTween(),this._dragged=!0):this._dragged=!1;var e=this._owner.globalToLocal(t.stageX,t.stageY,s);this._containerPos.setTo(this._container.x,this._container.y),this._beginTouchPos.setTo(e.x,e.y),this._lastTouchPos.setTo(e.x,e.y),this._lastTouchGlobalPos.setTo(t.stageX,t.stageY),this._isHoldAreaDone=!1,this._velocity.setTo(0,0),this._velocityScale=1,this._lastMoveTime=egret.getTimer()/1e3,this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.__touchMove,this),this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.__touchEnd,this),this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_TAP,this.__touchTap,this)}},c.prototype.__touchMove=function(e){if(null!=this._owner.displayObject.stage&&this._touchEffect&&!(c.draggingPane&&c.draggingPane!=this||t.GObject.draggingObject)){var n,o,a,h=this._owner.globalToLocal(e.stageX,e.stageY,s),l=t.UIConfig.touchScrollSensitivity;if(this._scrollType==t.ScrollType.Vertical){if(!this._isHoldAreaDone){if(i|=1,(n=Math.abs(this._beginTouchPos.y-h.y))<l)return;if(0!=(2&i)&&n<Math.abs(this._beginTouchPos.x-h.x))return}o=!0}else if(this._scrollType==t.ScrollType.Horizontal){if(!this._isHoldAreaDone){if(i|=2,(n=Math.abs(this._beginTouchPos.x-h.x))<l)return;if(0!=(1&i)&&n<Math.abs(this._beginTouchPos.y-h.y))return}a=!0}else{if(i=3,!this._isHoldAreaDone&&(n=Math.abs(this._beginTouchPos.y-h.y))<l&&(n=Math.abs(this._beginTouchPos.x-h.x))<l)return;o=a=!0}var u=Math.floor(this._containerPos.x+h.x-this._beginTouchPos.x),_=Math.floor(this._containerPos.y+h.y-this._beginTouchPos.y);o&&(_>0?this._bouncebackEffect?this._header&&0!=this._header.maxHeight?this._container.y=Math.floor(Math.min(.5*_,this._header.maxHeight)):this._container.y=Math.floor(Math.min(.5*_,this._viewSize.y*r)):this._container.y=0:_<-this._overlapSize.y?this._bouncebackEffect?this._footer&&this._footer.maxHeight>0?this._container.y=Math.floor(Math.max(.5*(_+this._overlapSize.y),-this._footer.maxHeight)-this._overlapSize.y):this._container.y=Math.floor(Math.max(.5*(_+this._overlapSize.y),-this._viewSize.y*r)-this._overlapSize.y):this._container.y=-this._overlapSize.y:this._container.y=_),a&&(u>0?this._bouncebackEffect?this._header&&0!=this._header.maxWidth?this._container.x=Math.floor(Math.min(.5*u,this._header.maxWidth)):this._container.x=Math.floor(Math.min(.5*u,this._viewSize.x*r)):this._container.x=0:u<0-this._overlapSize.x?this._bouncebackEffect?this._footer&&this._footer.maxWidth>0?this._container.x=Math.floor(Math.max(.5*(u+this._overlapSize.x),-this._footer.maxWidth)-this._overlapSize.x):this._container.x=Math.floor(Math.max(.5*(u+this._overlapSize.x),-this._viewSize.x*r)-this._overlapSize.x):this._container.x=-this._overlapSize.x:this._container.x=u);var p=egret.getTimer()/1e3,d=Math.max(p-this._lastMoveTime,1/60),g=h.x-this._lastTouchPos.x,f=h.y-this._lastTouchPos.y;if(a||(g=0),o||(f=0),0!=d){var y=this._owner.displayObject.stage.frameRate,m=d*y-1;if(m>1){var b=Math.pow(.833,m);this._velocity.x=this._velocity.x*b,this._velocity.y=this._velocity.y*b}this._velocity.x=t.ToolSet.lerp(this._velocity.x,60*g/y/d,10*d),this._velocity.y=t.ToolSet.lerp(this._velocity.y,60*f/y/d,10*d)}var v=this._lastTouchGlobalPos.x-e.stageX,w=this._lastTouchGlobalPos.y-e.stageY;0!=g?this._velocityScale=Math.abs(v/g):0!=f&&(this._velocityScale=Math.abs(w/f)),this._lastTouchPos.setTo(h.x,h.y),this._lastTouchGlobalPos.setTo(e.stageX,e.stageY),this._lastMoveTime=p,this._overlapSize.x>0&&(this._xPos=t.ToolSet.clamp(-this._container.x,0,this._overlapSize.x)),this._overlapSize.y>0&&(this._yPos=t.ToolSet.clamp(-this._container.y,0,this._overlapSize.y)),0!=this._loop&&(u=this._container.x,_=this._container.y,this.loopCheckingCurrent()&&(this._containerPos.x+=this._container.x-u,this._containerPos.y+=this._container.y-_)),c.draggingPane=this,this._isHoldAreaDone=!0,this._dragged=!0,this._maskContainer.touchChildren=!1,this.updateScrollBarPos(),this.updateScrollBarVisible(),this._pageMode&&this.updatePageController(),this.dispatchEventWith(c.SCROLL)}},c.prototype.__touchEnd=function(e){if(e.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.__touchMove,this),e.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END,this.__touchEnd,this),e.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_TAP,this.__touchTap,this),c.draggingPane==this&&(c.draggingPane=null),i=0,!this._dragged||!this._touchEffect||null==this._owner.displayObject.stage)return this._dragged=!1,void(this._maskContainer.touchChildren=!0);this._dragged=!1,this._maskContainer.touchChildren=!0,this._tweenStart.setTo(this._container.x,this._container.y),h.setTo(this._tweenStart.x,this._tweenStart.y);var n=!1;if(this._container.x>0?(h.x=0,n=!0):this._container.x<-this._overlapSize.x&&(h.x=-this._overlapSize.x,n=!0),this._container.y>0?(h.y=0,n=!0):this._container.y<-this._overlapSize.y&&(h.y=-this._overlapSize.y,n=!0),n){if(this._tweenChange.setTo(h.x-this._tweenStart.x,h.y-this._tweenStart.y),this._tweenChange.x<-t.UIConfig.touchDragSensitivity||this._tweenChange.y<-t.UIConfig.touchDragSensitivity?(this._refreshEventDispatching=!0,this.dispatchEventWith(c.PULL_DOWN_RELEASE),this._refreshEventDispatching=!1):(this._tweenChange.x>t.UIConfig.touchDragSensitivity||this._tweenChange.y>t.UIConfig.touchDragSensitivity)&&(this._refreshEventDispatching=!0,this.dispatchEventWith(c.PULL_UP_RELEASE),this._refreshEventDispatching=!1),this._headerLockedSize>0&&0==h[this._refreshBarAxis])h[this._refreshBarAxis]=this._headerLockedSize,this._tweenChange.x=h.x-this._tweenStart.x,this._tweenChange.y=h.y-this._tweenStart.y;else if(this._footerLockedSize>0&&h[this._refreshBarAxis]==-this._overlapSize[this._refreshBarAxis]){var r=this._overlapSize[this._refreshBarAxis];0==r?r=Math.max(this._contentSize[this._refreshBarAxis]+this._footerLockedSize-this._viewSize[this._refreshBarAxis],0):r+=this._footerLockedSize,h[this._refreshBarAxis]=-r,this._tweenChange.x=h.x-this._tweenStart.x,this._tweenChange.y=h.y-this._tweenStart.y}this._tweenDuration.setTo(o,o)}else{if(this._inertiaDisabled)this._tweenDuration.setTo(o,o);else{var s=this._owner.displayObject.stage.frameRate,a=(egret.getTimer()/1e3-this._lastMoveTime)*s-1;if(a>1){var u=Math.pow(.833,a);this._velocity.x=this._velocity.x*u,this._velocity.y=this._velocity.y*u}this.updateTargetAndDuration(this._tweenStart,h)}if(l.setTo(h.x-this._tweenStart.x,h.y-this._tweenStart.y),this.loopCheckingTarget(h),(this._pageMode||this._snapToItem)&&this.alignPosition(h,!0),this._tweenChange.x=h.x-this._tweenStart.x,this._tweenChange.y=h.y-this._tweenStart.y,0==this._tweenChange.x&&0==this._tweenChange.y)return void this.updateScrollBarVisible();(this._pageMode||this._snapToItem)&&(this.fixDuration("x",l.x),this.fixDuration("y",l.y))}this.startTween(2)},c.prototype.__touchTap=function(t){this._dragged=!1},c.prototype.updateScrollBarPos=function(){this._vtScrollBar&&this._vtScrollBar.setScrollPerc(0==this._overlapSize.y?0:t.ToolSet.clamp(-this._container.y,0,this._overlapSize.y)/this._overlapSize.y),this._hzScrollBar&&this._hzScrollBar.setScrollPerc(0==this._overlapSize.x?0:t.ToolSet.clamp(-this._container.x,0,this._overlapSize.x)/this._overlapSize.x),this.checkRefreshBar()},c.prototype.updateScrollBarVisible=function(){this._vtScrollBar&&(this._viewSize.y<=this._vtScrollBar.minSize||this._vScrollNone?this._vtScrollBar.displayObject.visible=!1:this.updateScrollBarVisible2(this._vtScrollBar)),this._hzScrollBar&&(this._viewSize.x<=this._hzScrollBar.minSize||this._hScrollNone?this._hzScrollBar.displayObject.visible=!1:this.updateScrollBarVisible2(this._hzScrollBar))},c.prototype.updateScrollBarVisible2=function(e){this._scrollBarDisplayAuto&&t.GTween.kill(e,!1,"alpha"),!this._scrollBarDisplayAuto||0!=this._tweening||this._dragged||e.gripDragging?(e.alpha=1,e.displayObject.visible=!0):e.displayObject.visible&&t.GTween.to(1,0,.5).setDelay(.5).onComplete(this.__barTweenComplete,this).setTarget(e,"alpha")},c.prototype.__barTweenComplete=function(t){var e=t.target;e.alpha=1,e.displayObject.visible=!1},c.prototype.getLoopPartSize=function(t,e){return(this._contentSize[e]+("x"==e?this._owner.columnGap:this._owner.lineGap))/t},c.prototype.loopCheckingCurrent=function(){var t=!1;return 1==this._loop&&this._overlapSize.x>0?this._xPos<.001?(this._xPos+=this.getLoopPartSize(2,"x"),t=!0):this._xPos>=this._overlapSize.x&&(this._xPos-=this.getLoopPartSize(2,"x"),t=!0):2==this._loop&&this._overlapSize.y>0&&(this._yPos<.001?(this._yPos+=this.getLoopPartSize(2,"y"),t=!0):this._yPos>=this._overlapSize.y&&(this._yPos-=this.getLoopPartSize(2,"y"),t=!0)),t&&(this._container.x=Math.floor(-this._xPos),this._container.y=Math.floor(-this._yPos)),t},c.prototype.loopCheckingTarget=function(t){1==this._loop&&this.loopCheckingTarget2(t,"x"),2==this._loop&&this.loopCheckingTarget2(t,"y")},c.prototype.loopCheckingTarget2=function(t,e){var i,n;t[e]>0?(i=this.getLoopPartSize(2,e),(n=this._tweenStart[e]-i)<=0&&n>=-this._overlapSize[e]&&(t[e]-=i,this._tweenStart[e]=n)):t[e]<-this._overlapSize[e]&&(i=this.getLoopPartSize(2,e),(n=this._tweenStart[e]+i)<=0&&n>=-this._overlapSize[e]&&(t[e]+=i,this._tweenStart[e]=n))},c.prototype.loopCheckingNewPos=function(e,i){if(0==this._overlapSize[i])return e;var n,o="x"==i?this._xPos:this._yPos,r=!1;return e<.001?(e+=this.getLoopPartSize(2,i))>o&&(n=this.getLoopPartSize(6,i),n=Math.ceil((e-o)/n)*n,o=t.ToolSet.clamp(o+n,0,this._overlapSize[i]),r=!0):e>=this._overlapSize[i]&&(e-=this.getLoopPartSize(2,i))<o&&(n=this.getLoopPartSize(6,i),n=Math.ceil((o-e)/n)*n,o=t.ToolSet.clamp(o-n,0,this._overlapSize[i]),r=!0),r&&("x"==i?this._container.x=-Math.floor(o):this._container.y=-Math.floor(o)),e},c.prototype.alignPosition=function(t,e){if(this._pageMode)t.x=this.alignByPage(t.x,"x",e),t.y=this.alignByPage(t.y,"y",e);else if(this._snapToItem){var i=this._owner.getSnappingPosition(-t.x,-t.y,s);t.x<0&&t.x>-this._overlapSize.x&&(t.x=-i.x),t.y<0&&t.y>-this._overlapSize.y&&(t.y=-i.y)}},c.prototype.alignByPage=function(t,e,i){var n;if(t>0)n=0;else if(t<-this._overlapSize[e])n=Math.ceil(this._contentSize[e]/this._pageSize[e])-1;else{n=Math.floor(-t/this._pageSize[e]);var o=i?t-this._containerPos[e]:t-this._container[e],r=Math.min(this._pageSize[e],this._contentSize[e]-(n+1)*this._pageSize[e]),s=-t-n*this._pageSize[e];Math.abs(o)>this._pageSize[e]?s>.5*r&&n++:s>r*(o<0?.3:.7)&&n++,(t=-n*this._pageSize[e])<-this._overlapSize[e]&&(t=-this._overlapSize[e])}if(i){var a,h=this._tweenStart[e];a=h>0?0:h<-this._overlapSize[e]?Math.ceil(this._contentSize[e]/this._pageSize[e])-1:Math.floor(-h/this._pageSize[e]);var l=Math.floor(-this._containerPos[e]/this._pageSize[e]);Math.abs(n-l)>1&&Math.abs(a-l)<=1&&(t=-(n=n>l?l+1:l-1)*this._pageSize[e])}return t},c.prototype.updateTargetAndDuration=function(t,e){e.x=this.updateTargetAndDuration2(t.x,"x"),e.y=this.updateTargetAndDuration2(t.y,"y")},c.prototype.updateTargetAndDuration2=function(t,e){var i=this._velocity[e],n=0;if(t>0)t=0;else if(t<-this._overlapSize[e])t=-this._overlapSize[e];else{var r=egret.Capabilities.isMobile,s=Math.abs(i)*this._velocityScale;r&&(s*=1136/Math.max(this._owner.displayObject.stage.stageWidth,this._owner.displayObject.stage.stageHeight));var a=0;if(this._pageMode||!r?s>500&&(a=Math.pow((s-500)/500,2)):s>1e3&&(a=Math.pow((s-1e3)/1e3,2)),0!=a)a>1&&(a=1),s*=a,i*=a,this._velocity[e]=i,n=Math.log(60/s)/Math.log(this._decelerationRate)/60,t+=Math.floor(i*n*.4)}return n<o&&(n=o),this._tweenDuration[e]=n,t},c.prototype.fixDuration=function(t,e){if(!(0==this._tweenChange[t]||Math.abs(this._tweenChange[t])>=Math.abs(e))){var i=Math.abs(this._tweenChange[t]/e)*this._tweenDuration[t];i<o&&(i=o),this._tweenDuration[t]=i}},c.prototype.startTween=function(e){this._tweenTime.setTo(0,0),this._tweening=e,t.GTimers.inst.add(1,0,this.tweenUpdate,this),this.updateScrollBarVisible()},c.prototype.killTween=function(){1==this._tweening&&(this._container.x=this._tweenStart.x+this._tweenChange.x,this._container.y=this._tweenStart.y+this._tweenChange.y,this.dispatchEventWith(c.SCROLL)),this._tweening=0,t.GTimers.inst.remove(this.tweenUpdate,this),this.updateScrollBarVisible(),this.dispatchEventWith(c.SCROLL_END)},c.prototype.checkRefreshBar=function(){if(null!=this._header||null!=this._footer){var t=this._container[this._refreshBarAxis];if(this._header)if(t>0){null==this._header.displayObject.parent&&this._maskContainer.addChildAt(this._header.displayObject,0);var e=s;e.setTo(this._header.width,this._header.height),e[this._refreshBarAxis]=t,this._header.setSize(e.x,e.y)}else this._header.displayObject.parent&&this._maskContainer.removeChild(this._header.displayObject);if(this._footer){var i=this._overlapSize[this._refreshBarAxis];t<-i||0==i&&this._footerLockedSize>0?(null==this._footer.displayObject.parent&&this._maskContainer.addChildAt(this._footer.displayObject,0),(e=s).setTo(this._footer.x,this._footer.y),e[this._refreshBarAxis]=i>0?t+this._contentSize[this._refreshBarAxis]:Math.max(Math.min(t+this._viewSize[this._refreshBarAxis],this._viewSize[this._refreshBarAxis]-this._footerLockedSize),this._viewSize[this._refreshBarAxis]-this._contentSize[this._refreshBarAxis]),this._footer.setXY(e.x,e.y),e.setTo(this._footer.width,this._footer.height),e[this._refreshBarAxis]=i>0?-i-t:this._viewSize[this._refreshBarAxis]-this._footer[this._refreshBarAxis],this._footer.setSize(e.x,e.y)):this._footer.displayObject.parent&&this._maskContainer.removeChild(this._footer.displayObject)}}},c.prototype.tweenUpdate=function(e){var i=this.runTween("x"),n=this.runTween("y");return this._container.x=i,this._container.y=n,2==this._tweening&&(this._overlapSize.x>0&&(this._xPos=t.ToolSet.clamp(-i,0,this._overlapSize.x)),this._overlapSize.y>0&&(this._yPos=t.ToolSet.clamp(-n,0,this._overlapSize.y)),this._pageMode&&this.updatePageController()),0==this._tweenChange.x&&0==this._tweenChange.y?(this._tweening=0,t.GTimers.inst.remove(this.tweenUpdate,this),this.loopCheckingCurrent(),this.updateScrollBarPos(),this.updateScrollBarVisible(),this.dispatchEventWith(c.SCROLL),this.dispatchEventWith(c.SCROLL_END)):(this.updateScrollBarPos(),this.dispatchEventWith(c.SCROLL)),!0},c.prototype.runTween=function(e){var i,n,r;if(0!=this._tweenChange[e]){if(this._tweenTime[e]+=t.GTimers.deltaTime/1e3,this._tweenTime[e]>=this._tweenDuration[e])i=this._tweenStart[e]+this._tweenChange[e],this._tweenChange[e]=0;else{var s=(n=this._tweenTime[e],r=this._tweenDuration[e],(n=n/r-1)*n*n+1);i=this._tweenStart[e]+Math.floor(this._tweenChange[e]*s)}var a=0,h=-this._overlapSize[e];if(this._headerLockedSize>0&&this._refreshBarAxis==e&&(a=this._headerLockedSize),this._footerLockedSize>0&&this._refreshBarAxis==e){var l=this._overlapSize[this._refreshBarAxis];0==l?l=Math.max(this._contentSize[this._refreshBarAxis]+this._footerLockedSize-this._viewSize[this._refreshBarAxis],0):l+=this._footerLockedSize,h=-l}2==this._tweening&&this._bouncebackEffect?i>20+a&&this._tweenChange[e]>0||i>a&&0==this._tweenChange[e]?(this._tweenTime[e]=0,this._tweenDuration[e]=o,this._tweenChange[e]=-i+a,this._tweenStart[e]=i):(i<h-20&&this._tweenChange[e]<0||i<h&&0==this._tweenChange[e])&&(this._tweenTime[e]=0,this._tweenDuration[e]=o,this._tweenChange[e]=h-i,this._tweenStart[e]=i):i>a?(i=a,this._tweenChange[e]=0):i<h&&(i=h,this._tweenChange[e]=0)}else i=this._container[e];return i},c.SCROLL="__scroll",c.SCROLL_END="__scrollEnd",c.PULL_DOWN_RELEASE="pullDownRelease",c.PULL_UP_RELEASE="pullUpRelease",c}(egret.EventDispatcher);t.ScrollPane=e;var i=0,n=.5,o=.3,r=.5,s=new egret.Point,a=new egret.Rectangle,h=new egret.Point,l=new egret.Point}(fgui||(fgui={})),function(t){var e=function(){function e(t){this._ownerBaseX=0,this._ownerBaseY=0,this._totalTimes=0,this._totalTasks=0,this._options=0,this._totalDuration=0,this._autoPlayTimes=1,this._autoPlayDelay=0,this._timeScale=1,this._startTime=0,this._endTime=0,this._owner=t,this._items=new Array}return e.prototype.play=function(t,e,i,n,o,r,s){this._play(t,e,i,n,o,r,s,!1)},e.prototype.playReverse=function(t,e,i,n,o){this._play(t,e,i,n,o,0,-1,!0)},e.prototype.changePlayTimes=function(t){this._totalTimes=t},e.prototype.setAutoPlay=function(t,e,i){null==e&&(e=-1),null==i&&(i=0),this._autoPlay!=t&&(this._autoPlay=t,this._autoPlayTimes=e,this._autoPlayDelay=i,this._autoPlay?this._owner.onStage&&this.play(null,null,this._autoPlayTimes,this._autoPlayDelay):this._owner.onStage||this.stop(!1,!0))},e.prototype._play=function(e,i,n,o,s,a,h,l){null==o&&(o=1),null==s&&(s=0),null==a&&(a=0),null==h&&(h=-1),this.stop(!0,!0),this._totalTimes=o,this._reversed=l,this._startTime=a,this._endTime=h,this._playing=!0,this._paused=!1,this._onComplete=e,this._onCompleteParam=n,this._onCompleteCaller=i;for(var c=this._items.length,u=0;u<c;u++){var _=this._items[u];if(_.target?_.target!=this._owner&&_.target.parent!=this._owner&&(_.target=null):_.targetId?_.target=this._owner.getChildById(_.targetId):_.target=this._owner,_.target&&_.type==r.Transition){var p=_.target.getTransition(_.value.transName);if(p==this&&(p=null),p)if(0==_.value.playTimes){var d;for(d=u-1;d>=0;d--){var g=this._items[d];if(g.type==r.Transition&&g.value.trans==p){g.value.stopTime=_.time-g.time;break}}d<0?_.value.stopTime=0:p=null}else _.value.stopTime=-1;_.value.trans=p}}0==s?this.onDelayedPlay():t.GTween.delayedCall(s).onComplete(this.onDelayedPlay,this)},e.prototype.stop=function(e,i){if(null==e&&(e=!0),this._playing){this._playing=!1,this._totalTasks=0,this._totalTimes=0;var n=this._onComplete,o=this._onCompleteParam,r=this._onCompleteCaller;this._onComplete=null,this._onCompleteParam=null,this._onCompleteCaller=null,t.GTween.kill(this);var s=this._items.length;if(this._reversed)for(var a=s-1;a>=0;a--){var h=this._items[a];h.target&&this.stopItem(h,e)}else for(a=0;a<s;a++)(h=this._items[a]).target&&this.stopItem(h,e);i&&null!=n&&n.call(r,o)}},e.prototype.stopItem=function(t,e){if(0!=t.displayLockToken&&(t.target.releaseDisplayLock(t.displayLockToken),t.displayLockToken=0),t.tweener&&(t.tweener.kill(e),t.tweener=null,t.type!=r.Shake||e||(t.target._gearLocked=!0,t.target.setXY(t.target.x-t.value.lastOffsetX,t.target.y-t.value.lastOffsetY),t.target._gearLocked=!1)),t.type==r.Transition){var i=t.value.trans;i&&i.stop(e,!1)}},e.prototype.setPaused=function(e){if(this._playing&&this._paused!=e){this._paused=e;var i=t.GTween.getTween(this);i&&i.setPaused(e);for(var n=this._items.length,o=0;o<n;o++){var s=this._items[o];s.target&&(s.type==r.Transition?s.value.trans&&s.value.trans.setPaused(e):s.type==r.Animation&&(e?(s.value.flag=s.target.getProp(t.ObjectPropID.Playing),s.target.setProp(t.ObjectPropID.Playing,!1)):s.target.setProp(t.ObjectPropID.Playing,s.value.flag)),s.tweener&&s.tweener.setPaused(e))}}},e.prototype.dispose=function(){this._playing&&t.GTween.kill(this);for(var e=this._items.length,i=0;i<e;i++){var n=this._items[i];n.tweener&&(n.tweener.kill(),n.tweener=null),n.target=null,n.hook=null,n.tweenConfig&&(n.tweenConfig.endHook=null)}this._items.length=0,this._playing=!1,this._onComplete=null,this._onCompleteCaller=null,this._onCompleteParam=null},Object.defineProperty(e.prototype,"playing",{get:function(){return this._playing},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n,o=this._items.length,s=0;s<o;s++){var a=this._items[s];if(a.label==t)n=a.tweenConfig?a.tweenConfig.startValue:a.value;else{if(!a.tweenConfig||a.tweenConfig.endLabel!=t)continue;n=a.tweenConfig.endValue}switch(a.type){case r.XY:case r.Size:case r.Pivot:case r.Scale:case r.Skew:n.b1=!0,n.b2=!0,n.f1=parseFloat(e[0]),n.f2=parseFloat(e[1]);break;case r.Alpha:case r.Rotation:case r.Color:n.f1=parseFloat(e[0]);break;case r.Animation:n.frame=parseInt(e[0]),e.length>1&&(n.playing=e[1]);break;case r.Visible:n.visible=e[0];break;case r.Sound:n.sound=e[0],e.length>1&&(n.volume=parseFloat(e[1]));break;case r.Transition:n.transName=e[0],e.length>1&&(n.playTimes=parseInt(e[1]));break;case r.Shake:n.amplitude=parseFloat(e[0]),e.length>1&&(n.duration=parseFloat(e[1]));break;case r.ColorFilter:n.f1=parseFloat(e[0]),n.f2=parseFloat(e[1]),n.f3=parseFloat(e[2]),n.f4=parseFloat(e[3]);break;case r.Text:case r.Icon:n.text=e[0]}}},e.prototype.setHook=function(t,e,i){for(var n=this._items.length,o=0;o<n;o++){var r=this._items[o];if(r.label==t){r.hook=e,r.hookCaller=i;break}if(r.tweenConfig&&r.tweenConfig.endLabel==t){r.tweenConfig.endHook=e,r.tweenConfig.endHookCaller=i;break}}},e.prototype.clearHooks=function(){for(var t=this._items.length,e=0;e<t;e++){var i=this._items[e];i.hook=null,i.hookCaller=null,i.tweenConfig&&(i.tweenConfig.endHook=null,i.tweenConfig.endHookCaller=null)}},e.prototype.setTarget=function(t,e){for(var i=this._items.length,n=0;n<i;n++){var o=this._items[n];o.label==t&&(o.targetId=e!=this._owner&&e?e.id:"",this._playing?o.targetId.length>0?o.target=this._owner.getChildById(o.targetId):o.target=this._owner:o.target=null)}},e.prototype.setDuration=function(t,e){for(var i=this._items.length,n=0;n<i;n++){var o=this._items[n];o.tweenConfig&&o.label==t&&(o.tweenConfig.duration=e)}},e.prototype.getLabelTime=function(t){for(var e=this._items.length,i=0;i<e;i++){var n=this._items[i];if(n.label==t)return n.time;if(n.tweenConfig&&n.tweenConfig.endLabel==t)return n.time+n.tweenConfig.duration}return Number.NaN},Object.defineProperty(e.prototype,"timeScale",{get:function(){return this._timeScale},set:function(e){if(this._timeScale!=e&&(this._timeScale=e,this._playing))for(var i=this._items.length,n=0;n<i;n++){var o=this._items[n];o.tweener?o.tweener.setTimeScale(e):o.type==r.Transition?o.value.trans&&(o.value.trans.timeScale=e):o.type==r.Animation&&o.target&&o.target.setProp(t.ObjectPropID.TimeScale,e)}},enumerable:!0,configurable:!0}),e.prototype.updateFromRelations=function(t,e,i){var n=this._items.length;if(0!=n)for(var o=0;o<n;o++){var s=this._items[o];s.type==r.XY&&s.targetId==t&&(s.tweenConfig?(s.tweenConfig.startValue.f1+=e,s.tweenConfig.startValue.f2+=i,s.tweenConfig.endValue.f1+=e,s.tweenConfig.endValue.f2+=i):(s.value.f1+=e,s.value.f2+=i))}},e.prototype.onOwnerAddedToStage=function(){this._autoPlay&&!this._playing&&this.play(null,null,null,this._autoPlayTimes,this._autoPlayDelay)},e.prototype.onOwnerRemovedFromStage=function(){0==(this._options&n)&&this.stop(0!=(this._options&o),!1)},e.prototype.onDelayedPlay=function(){if(this.internalPlay(),this._playing=this._totalTasks>0,this._playing){if(0!=(this._options&i))for(var t=this._items.length,e=0;e<t;e++){var n=this._items[e];n.target&&n.target!=this._owner&&(n.displayLockToken=n.target.addDisplayLock())}}else if(null!=this._onComplete){var o=this._onComplete,r=this._onCompleteParam,s=this._onCompleteCaller;this._onComplete=null,this._onCompleteParam=null,this._onCompleteCaller=null,o.call(s,r)}},e.prototype.internalPlay=function(){this._ownerBaseX=this._owner.x,this._ownerBaseY=this._owner.y,this._totalTasks=0;var t,e,i=this._items.length,n=!1;if(this._reversed)for(e=i-1;e>=0;e--)(t=this._items[e]).target&&this.playItem(t);else for(e=0;e<i;e++)(t=this._items[e]).target&&(t.type==r.Animation&&0!=this._startTime&&t.time<=this._startTime?(n=!0,t.value.flag=!1):this.playItem(t));n&&this.skipAnimations()},e.prototype.playItem=function(e){var i;if(e.tweenConfig){if(i=this._reversed?this._totalDuration-e.time-e.tweenConfig.duration:e.time,-1==this._endTime||i<=this._endTime){var n,o;switch(this._reversed?(n=e.tweenConfig.endValue,o=e.tweenConfig.startValue):(n=e.tweenConfig.startValue,o=e.tweenConfig.endValue),e.value.b1=n.b1||o.b1,e.value.b2=n.b2||o.b2,e.type){case r.XY:case r.Size:case r.Scale:case r.Skew:e.tweener=t.GTween.to2(n.f1,n.f2,o.f1,o.f2,e.tweenConfig.duration);break;case r.Alpha:case r.Rotation:e.tweener=t.GTween.to(n.f1,o.f1,e.tweenConfig.duration);break;case r.Color:e.tweener=t.GTween.toColor(n.f1,o.f1,e.tweenConfig.duration);break;case r.ColorFilter:e.tweener=t.GTween.to4(n.f1,n.f2,n.f3,n.f4,o.f1,o.f2,o.f3,o.f4,e.tweenConfig.duration)}e.tweener.setDelay(i).setEase(e.tweenConfig.easeType).setRepeat(e.tweenConfig.repeat,e.tweenConfig.yoyo).setTimeScale(this._timeScale).setTarget(e).onStart(this.onTweenStart,this).onUpdate(this.onTweenUpdate,this).onComplete(this.onTweenComplete,this),this._endTime>=0&&e.tweener.setBreakpoint(this._endTime-i),this._totalTasks++}}else e.type==r.Shake?(i=this._reversed?this._totalDuration-e.time-e.value.duration:e.time,e.value.offsetX=e.value.offsetY=0,e.value.lastOffsetX=e.value.lastOffsetY=0,e.tweener=t.GTween.shake(0,0,e.value.amplitude,e.value.duration).setDelay(i).setTimeScale(this._timeScale).setTarget(e).onUpdate(this.onTweenUpdate,this).onComplete(this.onTweenComplete,this),this._endTime>=0&&e.tweener.setBreakpoint(this._endTime-e.time),this._totalTasks++):(i=this._reversed?this._totalDuration-e.time:e.time)<=this._startTime?(this.applyValue(e),this.callHook(e,!1)):(-1==this._endTime||i<=this._endTime)&&(this._totalTasks++,e.tweener=t.GTween.delayedCall(i).setTimeScale(this._timeScale).setTarget(e).onComplete(this.onDelayedPlayItem,this));null!=e.tweener&&e.tweener.seek(this._startTime)},e.prototype.skipAnimations=function(){for(var e,i,n,o,s,a,h=this._items.length,l=0;l<h;l++)if(!((a=this._items[l]).type!=r.Animation||a.time>this._startTime||(o=a.value).flag)){e=(s=a.target).getProp(t.ObjectPropID.Frame),i=s.getProp(t.ObjectPropID.Playing)?0:-1,n=0;for(var c=l;c<h;c++)(a=this._items[c]).type!=r.Animation||a.target!=s||a.time>this._startTime||((o=a.value).flag=!0,-1!=o.frame?(e=o.frame,i=o.playing?a.time:-1,n=0):o.playing?i<0&&(i=a.time):(i>=0&&(n+=a.time-i),i=-1),this.callHook(a,!1));i>=0&&(n+=this._startTime-i),s.setProp(t.ObjectPropID.Playing,i>=0),s.setProp(t.ObjectPropID.Frame,e),n>0&&s.setProp(t.ObjectPropID.DeltaTime,1e3*n)}},e.prototype.onDelayedPlayItem=function(t){var e=t.target;e.tweener=null,this._totalTasks--,this.applyValue(e),this.callHook(e,!1),this.checkAllComplete()},e.prototype.onTweenStart=function(t){var e,i,n=t.target;n.type!=r.XY&&n.type!=r.Size||(this._reversed?(e=n.tweenConfig.endValue,i=n.tweenConfig.startValue):(e=n.tweenConfig.startValue,i=n.tweenConfig.endValue),n.type==r.XY?n.target!=this._owner?(e.b1?e.b3&&(t.startValue.x=e.f1*this._owner.width):t.startValue.x=n.target.x,e.b2?e.b3&&(t.startValue.y=e.f2*this._owner.height):t.startValue.y=n.target.y,i.b1?i.b3&&(t.endValue.x=i.f1*this._owner.width):t.endValue.x=t.startValue.x,i.b2?i.b3&&(t.endValue.y=i.f2*this._owner.height):t.endValue.y=t.startValue.y):(e.b1||(t.startValue.x=n.target.x-this._ownerBaseX),e.b2||(t.startValue.y=n.target.y-this._ownerBaseY),i.b1||(t.endValue.x=t.startValue.x),i.b2||(t.endValue.y=t.startValue.y)):(e.b1||(t.startValue.x=n.target.width),e.b2||(t.startValue.y=n.target.height),i.b1||(t.endValue.x=t.startValue.x),i.b2||(t.endValue.y=t.startValue.y)),n.tweenConfig.path&&(n.value.b1=n.value.b2=!0,t.setPath(n.tweenConfig.path)));this.callHook(n,!1)},e.prototype.onTweenUpdate=function(t){var e=t.target;switch(e.type){case r.XY:case r.Size:case r.Scale:case r.Skew:e.value.f1=t.value.x,e.value.f2=t.value.y,e.tweenConfig.path&&(e.value.f1+=t.startValue.x,e.value.f2+=t.startValue.y);break;case r.Alpha:case r.Rotation:e.value.f1=t.value.x;break;case r.Color:e.value.f1=t.value.color;break;case r.ColorFilter:e.value.f1=t.value.x,e.value.f2=t.value.y,e.value.f3=t.value.z,e.value.f4=t.value.w;break;case r.Shake:e.value.offsetX=t.deltaValue.x,e.value.offsetY=t.deltaValue.y}this.applyValue(e)},e.prototype.onTweenComplete=function(t){var e=t.target;e.tweener=null,this._totalTasks--,t.allCompleted&&this.callHook(e,!0),this.checkAllComplete()},e.prototype.onPlayTransCompleted=function(t){this._totalTasks--,this.checkAllComplete()},e.prototype.callHook=function(t,e){e?t.tweenConfig&&t.tweenConfig.endHook&&t.tweenConfig.endHook.call(t.tweenConfig.endHookCaller):t.time>=this._startTime&&null!=t.hook&&t.hook.call(t.hookCaller)},e.prototype.checkAllComplete=function(){if(this._playing&&0==this._totalTasks)if(this._totalTimes<0)this.internalPlay();else if(this._totalTimes--,this._totalTimes>0)this.internalPlay();else{this._playing=!1;for(var t=this._items.length,e=0;e<t;e++){var i=this._items[e];i.target&&0!=i.displayLockToken&&(i.target.releaseDisplayLock(i.displayLockToken),i.displayLockToken=0)}if(null!=this._onComplete){var n=this._onComplete,o=this._onCompleteParam,r=this._onCompleteCaller;this._onComplete=null,this._onCompleteParam=null,this._onCompleteCaller=null,n.call(r,o)}}},e.prototype.applyValue=function(e){e.target._gearLocked=!0;var i=e.value;switch(e.type){case r.XY:e.target==this._owner?i.b1&&i.b2?e.target.setXY(i.f1+this._ownerBaseX,i.f2+this._ownerBaseY):i.b1?e.target.x=i.f1+this._ownerBaseX:e.target.y=i.f2+this._ownerBaseY:i.b3?i.b1&&i.b2?e.target.setXY(i.f1*this._owner.width,i.f2*this._owner.height):i.b1?e.target.x=i.f1*this._owner.width:i.b2&&(e.target.y=i.f2*this._owner.height):i.b1&&i.b2?e.target.setXY(i.f1,i.f2):i.b1?e.target.x=i.f1:i.b2&&(e.target.y=i.f2);break;case r.Size:i.b1||(i.f1=e.target.width),i.b2||(i.f2=e.target.height),e.target.setSize(i.f1,i.f2);break;case r.Pivot:e.target.setPivot(i.f1,i.f2,e.target.pivotAsAnchor);break;case r.Alpha:e.target.alpha=i.f1;break;case r.Rotation:e.target.rotation=i.f1;break;case r.Scale:e.target.setScale(i.f1,i.f2);break;case r.Skew:e.target.setSkew(i.f1,i.f2);break;case r.Color:e.target.setProp(t.ObjectPropID.Color,i.f1);break;case r.Animation:i.frame>=0&&e.target.setProp(t.ObjectPropID.Frame,i.frame),e.target.setProp(t.ObjectPropID.Playing,i.playing),e.target.setProp(t.ObjectPropID.TimeScale,this._timeScale);break;case r.Visible:e.target.visible=i.visible;break;case r.Transition:if(this._playing){var n=i.trans;if(n){this._totalTasks++;var o=this._startTime>e.time?this._startTime-e.time:0,s=this._endTime>=0?this._endTime-e.time:-1;i.stopTime>=0&&(s<0||s>i.stopTime)&&(s=i.stopTime),n.timeScale=this._timeScale,n._play(this.onPlayTransCompleted,this,e,i.playTimes,0,o,s,this._reversed)}}break;case r.Sound:if(this._playing&&e.time>=this._startTime){if(!i.audioClip){var a=t.UIPackage.getItemByURL(i.sound);a&&(i.audioClip=a.owner.getItemAsset(a))}i.audioClip&&t.GRoot.inst.playOneShotSound(i.audioClip,i.volume)}break;case r.Shake:e.target.setXY(e.target.x-i.lastOffsetX+i.offsetX,e.target.y-i.lastOffsetY+i.offsetY),i.lastOffsetX=i.offsetX,i.lastOffsetY=i.offsetY;break;case r.ColorFilter:t.ToolSet.setColorFilter(e.target.displayObject,[i.f1,i.f2,i.f3,i.f4]);break;case r.Text:e.target.text=i.text;break;case r.Icon:e.target.icon=i.text}e.target._gearLocked=!1},e.prototype.setup=function(e){this.name=e.readS(),this._options=e.readInt(),this._autoPlay=e.readBool(),this._autoPlayTimes=e.readInt(),this._autoPlayDelay=e.readFloat();for(var i=e.readShort(),n=0;n<i;n++){var o=e.readShort(),r=e.position;e.seek(r,0);var h=new s(e.readByte());this._items[n]=h,h.time=e.readFloat();var l=e.readShort();if(h.targetId=l<0?"":this._owner.getChildAt(l).id,h.label=e.readS(),e.readBool()){if(e.seek(r,1),h.tweenConfig=new a,h.tweenConfig.duration=e.readFloat(),h.time+h.tweenConfig.duration>this._totalDuration&&(this._totalDuration=h.time+h.tweenConfig.duration),h.tweenConfig.easeType=e.readByte(),h.tweenConfig.repeat=e.readInt(),h.tweenConfig.yoyo=e.readBool(),h.tweenConfig.endLabel=e.readS(),e.seek(r,2),this.decodeValue(h,e,h.tweenConfig.startValue),e.seek(r,3),this.decodeValue(h,e,h.tweenConfig.endValue),e.version>=2){var c=e.readInt();if(c>0){h.tweenConfig.path=new t.GPath;for(var u=new Array,_=0;_<c;_++){var p=e.readByte();switch(p){case t.CurveType.Bezier:u.push(t.GPathPoint.newBezierPoint(e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat()));break;case t.CurveType.CubicBezier:u.push(t.GPathPoint.newCubicBezierPoint(e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat(),e.readFloat()));break;default:u.push(t.GPathPoint.newPoint(e.readFloat(),e.readFloat(),p))}}h.tweenConfig.path.create(u)}}}else h.time>this._totalDuration&&(this._totalDuration=h.time),e.seek(r,2),this.decodeValue(h,e,h.value);e.position=r+o}},e.prototype.decodeValue=function(t,e,i){switch(t.type){case r.XY:case r.Size:case r.Pivot:case r.Skew:i.b1=e.readBool(),i.b2=e.readBool(),i.f1=e.readFloat(),i.f2=e.readFloat(),e.version>=2&&t.type==r.XY&&(i.b3=e.readBool());break;case r.Alpha:case r.Rotation:i.f1=e.readFloat();break;case r.Scale:i.f1=e.readFloat(),i.f2=e.readFloat();break;case r.Color:i.f1=e.readColor();break;case r.Animation:i.playing=e.readBool(),i.frame=e.readInt();break;case r.Visible:i.visible=e.readBool();break;case r.Sound:i.sound=e.readS(),i.volume=e.readFloat();break;case r.Transition:i.transName=e.readS(),i.playTimes=e.readInt();break;case r.Shake:i.amplitude=e.readFloat(),i.duration=e.readFloat();break;case r.ColorFilter:i.f1=e.readFloat(),i.f2=e.readFloat(),i.f3=e.readFloat(),i.f4=e.readFloat();break;case r.Text:case r.Icon:i.text=e.readS()}},e}();t.Transition=e;var i=1,n=2,o=4,r=function(){function t(){}return t.XY=0,t.Size=1,t.Scale=2,t.Pivot=3,t.Alpha=4,t.Rotation=5,t.Color=6,t.Animation=7,t.Visible=8,t.Sound=9,t.Transition=10,t.Shake=11,t.ColorFilter=12,t.Skew=13,t.Text=14,t.Icon=15,t.Unknown=16,t}(),s=function(){return function(t){this.type=t,this.value={},this.displayLockToken=0}}(),a=function(){return function(){this.duration=0,this.repeat=0,this.easeType=t.EaseType.QuadOut,this.startValue={b1:!0,b2:!0},this.endValue={b1:!0,b2:!0}}}()}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.loadFromXML=function(t){var i={};e.strings=i;for(var n=egret.XML.parse(t).children,o=n.length,r=0;r<o;r++){var s=n[r];if("string"==s.name){var a=s.attributes.name,h=s.children.length>0?s.children[0].text:"",l=a.indexOf("-");if(-1==l)continue;var c=a.substr(0,l),u=a.substr(l+1),_=i[c];_||(_={},i[c]=_),_[u]=h}}},e.translateComponent=function(i){if(null!=e.strings){var n=e.strings[i.owner.id+i.id];if(null!=n){var o,r,s,a,h,l,c,u,_,p=i.rawData;p.seek(0,2);var d=p.readShort();for(h=0;h<d;h++){c=p.readShort(),u=p.position,p.seek(u,0);var g=p.readByte(),f=g;p.skip(4),o=p.readS(),f==t.ObjectType.Component&&p.seek(u,6)&&(f=p.readByte()),p.seek(u,1),null!=(r=n[o+"-tips"])&&p.writeS(r),p.seek(u,2);var y=p.readShort();for(l=0;l<y;l++){if(s=p.readShort(),s+=p.position,6==p.readByte()){for(p.skip(2),_=p.readShort(),b=0;b<_;b++)null!=p.readS()&&(null!=(r=n[o+"-texts_"+b])?p.writeS(r):p.skip(2));p.readBool()&&null!=(r=n[o+"-texts_def"])&&p.writeS(r)}if(g==t.ObjectType.Component&&p.version>=2){p.seek(u,4),p.skip(2),p.skip(4*p.readShort());for(var m=p.readShort(),b=0;b<m;b++){var v=p.readS();0==p.readShort()&&null!=(r=n[o+"-cp-"+v])?p.writeS(r):p.skip(2)}}p.position=s}switch(f){case t.ObjectType.Text:case t.ObjectType.RichText:case t.ObjectType.InputText:null!=(r=n[o])&&(p.seek(u,6),p.writeS(r)),null!=(r=n[o+"-prompt"])&&(p.seek(u,4),p.writeS(r));break;case t.ObjectType.List:case t.ObjectType.Tree:for(p.seek(u,8),p.skip(2),a=p.readShort(),l=0;l<a;l++){if(s=p.readShort(),s+=p.position,p.skip(2),f==t.ObjectType.Tree&&p.skip(2),null!=(r=n[o+"-"+l])?p.writeS(r):p.skip(2),null!=(r=n[o+"-"+l+"-0"])?p.writeS(r):p.skip(2),p.version>=2){p.skip(6),p.skip(4*p.readUnsignedShort());for(m=p.readUnsignedShort(),b=0;b<m;b++){v=p.readS();0==p.readUnsignedShort()&&null!=(r=n[o+"-"+l+"-"+v])?p.writeS(r):p.skip(2)}}p.position=s}break;case t.ObjectType.Label:p.seek(u,6)&&p.readByte()==f&&(null!=(r=n[o])?p.writeS(r):p.skip(2),p.skip(2),p.readBool()&&p.skip(4),p.skip(4),p.readBool()&&null!=(r=n[o+"-prompt"])&&p.writeS(r));break;case t.ObjectType.Button:p.seek(u,6)&&p.readByte()==f&&(null!=(r=n[o])?p.writeS(r):p.skip(2),null!=(r=n[o+"-0"])&&p.writeS(r));break;case t.ObjectType.ComboBox:if(p.seek(u,6)&&p.readByte()==f){for(a=p.readShort(),l=0;l<a;l++)s=p.readShort(),s+=p.position,null!=(r=n[o+"-"+l])&&p.writeS(r),p.position=s;null!=(r=n[o])&&p.writeS(r)}}p.position=u+c}}}},e}();t.TranslationHelper=e}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.defaultFont="SimSun",e.modalLayerColor=3355443,e.modalLayerAlpha=.2,e.buttonSoundVolumeScale=1,e.defaultScrollStep=25,e.defaultScrollDecelerationRate=.967,e.defaultScrollBarDisplay=t.ScrollBarDisplayType.Visible,e.defaultScrollTouchEffect=!0,e.defaultScrollBounceEffect=!0,e.defaultComboBoxVisibleItemCount=10,e.touchScrollSensitivity=20,e.touchDragSensitivity=10,e.clickDragSensitivity=2,e.bringWindowToFrontOnClick=!0,e.frameTimeForAsyncUIConstruction=2,e}();t.UIConfig=e}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.setExtension=function(i,n){if(null==i)throw"Invaild url: "+i;var o=t.UIPackage.getItemByURL(i);o&&(o.extensionType=n),e.extensions[i]=n},e.setPackageItemExtension=function(t,i){e.setExtension(t,i)},e.setLoaderExtension=function(t){e.loaderType=t},e.resolvePackageItemExtension=function(t){var i=e.extensions["ui://"+t.owner.id+t.id];i||(i=e.extensions["ui://"+t.owner.name+"/"+t.name]),i&&(t.extensionType=i)},e.newObject=function(i,n){var o;if("number"==typeof i)switch(i){case t.ObjectType.Image:return new t.GImage;case t.ObjectType.MovieClip:return new t.GMovieClip;case t.ObjectType.Component:return new t.GComponent;case t.ObjectType.Text:return new t.GTextField;case t.ObjectType.RichText:return new t.GRichTextField;case t.ObjectType.InputText:return new t.GTextInput;case t.ObjectType.Group:return new t.GGroup;case t.ObjectType.List:return new t.GList;case t.ObjectType.Graph:return new t.GGraph;case t.ObjectType.Loader:return e.loaderType?new e.loaderType:new t.GLoader;case t.ObjectType.Button:return new t.GButton;case t.ObjectType.Label:return new t.GLabel;case t.ObjectType.ProgressBar:return new t.GProgressBar;case t.ObjectType.Slider:return new t.GSlider;case t.ObjectType.ScrollBar:return new t.GScrollBar;case t.ObjectType.ComboBox:return new t.GComboBox;case t.ObjectType.Tree:return new t.GTree;case t.ObjectType.Loader3D:return new t.GLoader3D;default:return null}else(o=i.type==t.PackageItemType.Component?n?new n:i.extensionType?new i.extensionType:e.newObject(i.objectType):e.newObject(i.objectType))&&(o.packageItem=i);return o},e.extensions={},e}();t.UIObjectFactory=e}(fgui||(fgui={})),function(t){var e=function(){function e(){this._items=[],this._itemsById={},this._itemsByName={},this._sprites={},this._dependencies=[],this._branches=[],this._branchIndex=-1}return Object.defineProperty(e,"branch",{get:function(){return e._branch},set:function(t){for(var i in e._branch=t,e._instById){var n=e._instById[i];n._branches&&(n._branchIndex=n._branches.indexOf(t))}},enumerable:!0,configurable:!0}),e.getVar=function(t){return e._vars[t]},e.setVar=function(t,i){e._vars[t]=i},e.getById=function(t){return e._instById[t]},e.getByName=function(t){return e._instByName[t]},e.loadPackage=function(n){return __awaiter(this,void 0,void 0,function(){var o=this;return __generator(this,function(r){return[2,new Promise(function(r){return __awaiter(o,void 0,void 0,function(){var o,s,a,h,l,c;return __generator(this,function(u){switch(u.label){case 0:return(o=e._instById[n])?(r(o),[2]):[4,RES.getResAsync(i(n,"fui"))];case 1:for(s=u.sent(),(o=new e)._resKey=n,o.loadPackage(new t.ByteBuffer(s)),a=o._items.length,h=[],l=0;l<a;l++)(c=o._items[l]).type!=t.PackageItemType.Atlas&&c.type!=t.PackageItemType.Sound||h.push(RES.getResAsync(c.file));return h.length>0?[4,Promise.all(h)]:[3,3];case 2:u.sent(),u.label=3;case 3:return e._instById[o.id]=o,e._instByName[o.name]=o,e._instById[o._resKey]=o,r(o),[2]}})})})]})})},e.addPackage=function(i,n){if(!n&&!(n=RES.getRes(i)))throw"Resource '"+i+"' not found, please check default.res.json!";var o=new e;return o._resKey=i,o.loadPackage(new t.ByteBuffer(n)),e._instById[o.id]=o,e._instByName[o.name]=o,e._instById[i]=o,o},e.removePackage=function(t){var i=e._instById[t];if(i||(i=e._instByName[t]),!i)throw new Error("unknown package: "+t);i.dispose(),delete e._instById[i.id],delete e._instByName[i.name],delete e._instById[i._resKey],null!=i._customId&&delete e._instById[i._customId]},e.createObject=function(t,i,n){var o=e.getByName(t);return o?o.createObject(i,n):null},e.createObjectFromURL=function(t,i){var n=e.getItemByURL(t);return n?n.owner.internalCreateObject(n,i):null},e.getItemURL=function(t,i){var n=e.getByName(t);if(!n)return null;var o=n._itemsByName[i];return o?"ui://"+n.id+o.id:null},e.getItemByURL=function(t){var i=t.indexOf("//");if(-1==i)return null;var n=t.indexOf("/",i+2);if(-1==n){if(t.length>13){var o=t.substr(5,8),r=e.getById(o);if(null!=r){var s=t.substr(13);return r.getItemById(s)}}}else{var a=t.substr(i+2,n-i-2);if(null!=(r=e.getByName(a))){var h=t.substr(n+1);return r.getItemByName(h)}}return null},e.normalizeURL=function(t){if(null==t)return null;var i=t.indexOf("//");if(-1==i)return null;var n=t.indexOf("/",i+2);if(-1==n)return t;var o=t.substr(i+2,n-i-2),r=t.substr(n+1);return e.getItemURL(o,r)},e.setStringsSource=function(e){t.TranslationHelper.loadFromXML(e)},e.prototype.loadPackage=function(n){if(1179080009!=n.readUnsignedInt())throw"FairyGUI: old package format found in '"+this._resKey+"'";n.version=n.readInt();var o=n.readBool();if(this._id=n.readUTF(),this._name=n.readUTF(),n.skip(20),o){var r=new Uint8Array(n.buffer,n.position,n.length-n.position),s=new Zlib.RawInflate(r),a=new t.ByteBuffer(s.decompress());a.version=n.version,n=a}var h,l,c,u,_,p=n.version>=2,d=n.position;n.seek(d,4),h=n.readInt();var g,f=new Array(h);for(f.reduceRight,l=0;l<h;l++)f[l]=n.readUTF();for(n.stringTable=f,n.seek(d,0),h=n.readShort(),l=0;l<h;l++)this._dependencies.push({id:n.readS(),name:n.readS()});p&&((h=n.readShort())>0&&(this._branches=n.readSArray(h),e._branch&&(this._branchIndex=this._branches.indexOf(e._branch))),_=h>0),n.seek(d,1);var y=this._resKey,m=y.lastIndexOf("/"),b=-1==m?"":y.substr(0,m+1);for(y+="_",h=n.readShort(),l=0;l<h;l++){switch(c=n.readInt(),c+=n.position,(g=new t.PackageItem).owner=this,g.type=n.readByte(),g.id=n.readS(),g.name=n.readS(),n.readS(),g.file=n.readS(),n.readBool(),g.width=n.readInt(),g.height=n.readInt(),g.type){case t.PackageItemType.Image:g.objectType=t.ObjectType.Image;var v=n.readByte();1==v?(g.scale9Grid=new egret.Rectangle,g.scale9Grid.x=n.readInt(),g.scale9Grid.y=n.readInt(),g.scale9Grid.width=n.readInt(),g.scale9Grid.height=n.readInt(),g.tileGridIndice=n.readInt()):2==v&&(g.scaleByTile=!0),g.smoothing=n.readBool();break;case t.PackageItemType.MovieClip:g.smoothing=n.readBool(),g.objectType=t.ObjectType.MovieClip,g.rawData=n.readBuffer();break;case t.PackageItemType.Font:g.rawData=n.readBuffer();break;case t.PackageItemType.Component:var w=n.readByte();g.objectType=w>0?w:t.ObjectType.Component,g.rawData=n.readBuffer(),t.UIObjectFactory.resolvePackageItemExtension(g);break;case t.PackageItemType.Atlas:case t.PackageItemType.Sound:case t.PackageItemType.Misc:var C=g.file.lastIndexOf(".");g.file=y+(-1==C?g.file:i(g.file.substring(0,C),g.file.substring(C+1)));break;case t.PackageItemType.Spine:case t.PackageItemType.DragonBones:var S=g.file.lastIndexOf(".");g.file=b+(-1==S?g.file:g.file.substring(0,S)),g.skeletonAnchor=new egret.Point,g.skeletonAnchor.x=n.readFloat(),g.skeletonAnchor.y=n.readFloat()}if(p){(u=n.readS())&&(g.name=u+"/"+g.name);var x=n.readUnsignedByte();x>0&&(_?g.branches=n.readSArray(x):this._itemsById[n.readS()]=g);var T=n.readUnsignedByte();T>0&&(g.highResolution=n.readSArray(T))}this._items.push(g),this._itemsById[g.id]=g,null!=g.name&&(this._itemsByName[g.name]=g),n.position=c}for(n.seek(d,2),h=n.readShort(),l=0;l<h;l++){c=n.readShort(),c+=n.position;var I=n.readS(),P={atlas:g=this._itemsById[n.readS()],rect:new egret.Rectangle,offset:new egret.Point,originalSize:new egret.Point};P.rect.x=n.readInt(),P.rect.y=n.readInt(),P.rect.width=n.readInt(),P.rect.height=n.readInt(),P.rotated=n.readBool(),p&&n.readBool()?(P.offset.x=n.readInt(),P.offset.y=n.readInt(),P.originalSize.x=n.readInt(),P.originalSize.y=n.readInt()):(P.originalSize.x=P.rect.width,P.originalSize.y=P.rect.height),this._sprites[I]=P,n.position=c}if(n.seek(d,3))for(h=n.readShort(),l=0;l<h;l++)c=n.readInt(),c+=n.position,(g=this._itemsById[n.readS()])&&g.type==t.PackageItemType.Image&&(g.pixelHitTestData=new t.PixelHitTestData,g.pixelHitTestData.load(n)),n.position=c},e.prototype.dispose=function(){for(var e=this._items.length,i=0;i<e;i++){var n=this._items[i];n.type==t.PackageItemType.Atlas?RES.destroyRes(n.file,!1):(n.type,t.PackageItemType.Sound)}},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"customId",{get:function(){return this._customId},set:function(t){null!=this._customId&&delete e._instById[this._customId],this._customId=t,null!=this._customId&&(e._instById[this._customId]=this)},enumerable:!0,configurable:!0}),e.prototype.createObject=function(t,e){var i=this._itemsByName[t];return i?this.internalCreateObject(i,e):null},e.prototype.internalCreateObject=function(i,n){var o=t.UIObjectFactory.newObject(i,n);return null==o?null:(e._constructing++,o.constructFromResource(),e._constructing--,o)},e.prototype.getItemById=function(t){return this._itemsById[t]},e.prototype.getItemByName=function(t){return this._itemsByName[t]},e.prototype.getItemAssetByName=function(t){var e=this._itemsByName[t];if(null==e)throw"Resource not found -"+t;return this.getItemAsset(e)},e.prototype.getItemAsset=function(e){switch(e.type){case t.PackageItemType.Image:if(!e.decoded){e.decoded=!0;var i=this._sprites[e.id];if(i){var n=this.getItemAsset(i.atlas);e.asset=new egret.Texture,e.asset.bitmapData=n.bitmapData,e.asset.$initData(n.$bitmapX+i.rect.x,n.$bitmapY+i.rect.y,i.rect.width,i.rect.height,i.offset.x,i.offset.y,i.originalSize.x,i.originalSize.y,n.$sourceWidth,n.$sourceHeight,i.rotated)}}return e.asset;case t.PackageItemType.Atlas:case t.PackageItemType.Sound:return e.decoded||(e.decoded=!0,e.asset=RES.getRes(e.file),e.asset||console.log("Resource '"+e.file+"' not found, please check default.res.json!")),e.asset;case t.PackageItemType.Font:return e.decoded||(e.decoded=!0,this.loadFont(e)),e.bitmapFont;case t.PackageItemType.MovieClip:return e.decoded||(e.decoded=!0,this.loadMovieClip(e)),e.frames;case t.PackageItemType.Misc:return e.file?RES.getRes(e.file):null;default:return null}},e.prototype.getItemAssetAsync=function(e,i){if(e.decoded)i(null,e);else if(e.loading)e.loading.push(i);else switch(e.type){case t.PackageItemType.DragonBones:e.loading=[i],this.loadDragonBones(e);break;default:this.getItemAsset(e),i(null,e)}},e.prototype.loadMovieClip=function(t){var e=t.rawData;e.seek(0,0),t.interval=e.readInt(),t.swing=e.readBool(),t.repeatDelay=e.readInt(),e.seek(0,1);var i,n,o,r,s=e.readShort();t.frames=Array(s);for(var a=0;a<s;a++){var h=e.readShort();h+=e.position;var l={};if(o=e.readInt(),r=e.readInt(),e.readInt(),e.readInt(),l.addDelay=e.readInt(),null!=(i=e.readS())&&null!=(n=this._sprites[i])){var c=this.getItemAsset(n.atlas);l.texture=new egret.Texture,l.texture.bitmapData=c.bitmapData,l.texture.$initData(c.$bitmapX+n.rect.x,c.$bitmapY+n.rect.y,n.rect.width,n.rect.height,o,r,t.width,t.height,c.$sourceWidth,c.$sourceHeight,n.rotated)}t.frames[a]=l,e.position=h}},e.prototype.loadFont=function(e){var i=new t.BitmapFont;e.bitmapFont=i;var n=e.rawData;n.seek(0,0),i.ttf=n.readBool(),i.tint=n.readBool(),i.resizable=n.readBool(),n.readBool(),i.size=n.readInt();var o,r,s=n.readInt(),a=n.readInt(),h=this._sprites[e.id];h&&(o=this.getItemAsset(h.atlas)),n.seek(0,1);for(var l=n.readInt(),c=0;c<l;c++){var u=n.readShort();u+=n.position,r={};var _=n.readChar();i.glyphs[_]=r;var p=n.readS(),d=n.readInt(),g=n.readInt();if(r.x=n.readInt(),r.y=n.readInt(),r.width=n.readInt(),r.height=n.readInt(),r.advance=n.readInt(),r.channel=n.readByte(),1==r.channel?r.channel=3:2==r.channel?r.channel=2:3==r.channel&&(r.channel=1),i.ttf)r.texture=new egret.Texture,r.texture.bitmapData=o.bitmapData,r.texture.$initData(o.$bitmapX+d+h.rect.x,o.$bitmapY+g+h.rect.y,r.width,r.height,h.offset.x,h.offset.y,h.originalSize.x,h.originalSize.y,o.$sourceWidth,o.$sourceHeight,h.rotated),r.lineHeight=a;else{var f=this._itemsById[p];f&&(this.getItemAsset(f),r.width=f.width,r.height=f.height,r.texture=f.asset),0==r.advance&&(r.advance=0==s?r.x+r.width:s),r.lineHeight=r.y<0?r.height:r.y+r.height,r.lineHeight<i.size&&(r.lineHeight=i.size)}n.position=u}},e.prototype.loadDragonBones=function(t){var e=i(t.file,["json","dbbin"]),n=t.file.replace("_ske","_tex"),o=i(n,"json"),r=i(n,"png"),s=RES.getResAsync(e),a=RES.getResAsync(o),h=RES.getResAsync(r);Promise.all([s,a,h]).then(function(e){var i=dragonBones.EgretFactory.factory;t.asset=i.parseDragonBonesData(e[0]),t.atlasAsset=i.parseTextureAtlasData(e[1],e[2]),t.armatureName=t.asset.armatureNames[0];var n=t.loading;delete t.loading,n.forEach(function(e){return e(null,t)})}).catch(function(e){var i=t.loading;delete t.loading,i.forEach(function(i){return i(e,t)})})},e._constructing=0,e._instById={},e._instByName={},e._branch="",e._vars={},e}();function i(t,e){if(Array.isArray(e)){for(var i=0;i<e.length;i++){var n=t+"_"+e[i];if(RES.hasRes(n))return n}return t}n=t+"_"+e;return RES.hasRes(n)?n:t}t.UIPackage=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var i=e.call(this)||this;return i._requestingCmd=0,i._uiSources=new Array,i.bringToFontOnClick=t.UIConfig.bringWindowToFrontOnClick,i.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE,i.__onShown,i),i.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE,i.__onHidden,i),i.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN,i.__mouseDown,i,!0),i}return __extends(i,e),i.prototype.addUISource=function(t){this._uiSources.push(t)},Object.defineProperty(i.prototype,"contentPane",{get:function(){return this._contentPane},set:function(e){this._contentPane!=e&&(this._contentPane&&this.removeChild(this._contentPane),this._contentPane=e,this._contentPane&&(this.addChild(this._contentPane),this.setSize(this._contentPane.width,this._contentPane.height),this._contentPane.addRelation(this,t.RelationType.Size),this._frame=this._contentPane.getChild("frame"),this._frame&&(this.closeButton=this._frame.getChild("closeButton"),this.dragArea=this._frame.getChild("dragArea"),this.contentArea=this._frame.getChild("contentArea"))))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"frame",{get:function(){return this._frame},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"closeButton",{get:function(){return this._closeButton},set:function(t){this._closeButton&&this._closeButton.removeClickListener(this.closeEventHandler,this),this._closeButton=t,this._closeButton&&this._closeButton.addClickListener(this.closeEventHandler,this)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"dragArea",{get:function(){return this._dragArea},set:function(e){this._dragArea!=e&&(this._dragArea&&(this._dragArea.draggable=!1,this._dragArea.removeEventListener(t.DragEvent.DRAG_START,this.__dragStart,this)),this._dragArea=e,this._dragArea&&(this._dragArea instanceof t.GGraph&&null==this._dragArea.displayObject&&this._dragArea.asGraph.drawRect(0,0,0,0,0),this._dragArea.draggable=!0,this._dragArea.addEventListener(t.DragEvent.DRAG_START,this.__dragStart,this)))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"contentArea",{get:function(){return this._contentArea},set:function(t){this._contentArea=t},enumerable:!0,configurable:!0}),i.prototype.show=function(){t.GRoot.inst.showWindow(this)},i.prototype.showOn=function(t){t.showWindow(this)},i.prototype.hide=function(){this.isShowing&&this.doHideAnimation()},i.prototype.hideImmediately=function(){var e=this.parent instanceof t.GRoot?this.parent:null;e||(e=t.GRoot.inst),e.hideWindowImmediately(this)},i.prototype.centerOn=function(e,i){this.setXY(Math.round((e.width-this.width)/2),Math.round((e.height-this.height)/2)),i&&(this.addRelation(e,t.RelationType.Center_Center),this.addRelation(e,t.RelationType.Middle_Middle))},i.prototype.toggleStatus=function(){this.isTop?this.hide():this.show()},Object.defineProperty(i.prototype,"isShowing",{get:function(){return null!=this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isTop",{get:function(){return null!=this.parent&&this.parent.getChildIndex(this)==this.parent.numChildren-1},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"modal",{get:function(){return this._modal},set:function(t){this._modal=t},enumerable:!0,configurable:!0}),i.prototype.bringToFront=function(){this.root.bringToFront(this)},i.prototype.showModalWait=function(e){null!=e&&(this._requestingCmd=e),t.UIConfig.windowModalWaiting&&(this._modalWaitPane||(this._modalWaitPane=t.UIPackage.createObjectFromURL(t.UIConfig.windowModalWaiting)),this.layoutModalWaitPane(),this.addChild(this._modalWaitPane))},i.prototype.layoutModalWaitPane=function(){if(this._contentArea){var t=this._frame.localToGlobal();t=this.globalToLocal(t.x,t.y,t),this._modalWaitPane.setXY(t.x+this._contentArea.x,t.y+this._contentArea.y),this._modalWaitPane.setSize(this._contentArea.width,this._contentArea.height)}else this._modalWaitPane.setSize(this.width,this.height)},i.prototype.closeModalWait=function(t){return(null==t||0==t||this._requestingCmd==t)&&(this._requestingCmd=0,this._modalWaitPane&&null!=this._modalWaitPane.parent&&this.removeChild(this._modalWaitPane),!0)},Object.defineProperty(i.prototype,"modalWaiting",{get:function(){return this._modalWaitPane&&null!=this._modalWaitPane.parent},enumerable:!0,configurable:!0}),i.prototype.init=function(){if(!this._inited&&!this._loading)if(this._uiSources.length>0){this._loading=!1;for(var t=this._uiSources.length,e=0;e<t;e++){var i=this._uiSources[e];i.loaded||(i.load(this.__uiLoadComplete,this),this._loading=!0)}this._loading||this._init()}else this._init()},i.prototype.onInit=function(){},i.prototype.onShown=function(){},i.prototype.onHide=function(){},i.prototype.doShowAnimation=function(){this.onShown()},i.prototype.doHideAnimation=function(){this.hideImmediately()},i.prototype.__uiLoadComplete=function(){for(var t=this._uiSources.length,e=0;e<t;e++){if(!this._uiSources[e].loaded)return}this._loading=!1,this._init()},i.prototype._init=function(){this._inited=!0,this.onInit(),this.isShowing&&this.doShowAnimation()},i.prototype.dispose=function(){this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE,this.__onShown,this),this.displayObject.removeEventListener(egret.Event.REMOVED_FROM_STAGE,this.__onHidden,this),this.parent&&this.hideImmediately(),e.prototype.dispose.call(this)},i.prototype.closeEventHandler=function(t){this.hide()},i.prototype.__onShown=function(t){this._inited?this.doShowAnimation():this.init()},i.prototype.__onHidden=function(t){this.closeModalWait(),this.onHide()},i.prototype.__mouseDown=function(t){this.isShowing&&this.bringToFontOnClick&&this.bringToFront()},i.prototype.__dragStart=function(t){t.preventDefault(),this.startDrag(t.touchPointID,t.stageX,t.stageY)},i}(t.GComponent);t.Window=e}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.createAction=function(e){switch(e){case 0:return new t.PlayTransitionAction;case 1:return new t.ChangePageAction}return null},e.prototype.run=function(t,e,i){null!=this.fromPage&&0!=this.fromPage.length&&-1==this.fromPage.indexOf(e)||null!=this.toPage&&0!=this.toPage.length&&-1==this.toPage.indexOf(i)?this.leave(t):this.enter(t)},e.prototype.enter=function(t){},e.prototype.leave=function(t){},e.prototype.setup=function(t){var e,i;for(e=t.readShort(),this.fromPage=[],i=0;i<e;i++)this.fromPage[i]=t.readS();for(e=t.readShort(),this.toPage=[],i=0;i<e;i++)this.toPage[i]=t.readS()},e}();t.ControllerAction=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){return e.call(this)||this}return __extends(i,e),i.prototype.enter=function(e){if(this.controllerName){var i;if(this.objectId){var n=e.parent.getChildById(this.objectId);if(!(n instanceof t.GComponent))return;i=n}else i=e.parent;if(i){var o=i.getController(this.controllerName);o&&o!=e&&!o.changing&&("~1"==this.targetPage?e.selectedIndex<o.pageCount&&(o.selectedIndex=e.selectedIndex):"~2"==this.targetPage?o.selectedPage=e.selectedPage:o.selectedPageId=this.targetPage)}}},i.prototype.setup=function(t){e.prototype.setup.call(this,t),this.objectId=t.readS(),this.controllerName=t.readS(),this.targetPage=t.readS()},i}(t.ControllerAction);t.ChangePageAction=e}(fgui||(fgui={})),function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.playTimes=1,e.delay=0,e.stopOnExit=!1,e}return __extends(e,t),e.prototype.enter=function(t){var e=t.parent.getTransition(this.transitionName);e&&(this._currentTransition&&this._currentTransition.playing?e.changePlayTimes(this.playTimes):e.play(null,null,null,this.playTimes,this.delay),this._currentTransition=e)},e.prototype.leave=function(t){this.stopOnExit&&this._currentTransition&&(this._currentTransition.stop(),this._currentTransition=null)},e.prototype.setup=function(e){t.prototype.setup.call(this,e),this.transitionName=e.readS(),this.playTimes=e.readInt(),this.delay=e.readFloat(),this.stopOnExit=e.readBool()},e}(t.ControllerAction);t.PlayTransitionAction=e}(fgui||(fgui={})),function(t){var e=function(){return function(){this.size=0,this.glyphs={}}}();t.BitmapFont=e}(fgui||(fgui={})),function(t){function e(e,i,n,o,r){var s,a,h;switch((!o||n!=t.FillOrigin.TopRight&&n!=t.FillOrigin.BottomLeft)&&(o||n!=t.FillOrigin.TopLeft&&n!=t.FillOrigin.BottomRight)||(r=1-r),s=((a=e*Math.tan(Math.PI/2*r))-i)/a,n){case t.FillOrigin.TopLeft:h=o?a<=i?[0,0,e,a,e,0]:[0,0,e*(1-s),i,e,i,e,0]:a<=i?[0,0,e,a,e,i,0,i]:[0,0,e*(1-s),i,0,i];break;case t.FillOrigin.TopRight:h=o?a<=i?[e,0,0,a,0,i,e,i]:[e,0,e*s,i,e,i]:a<=i?[e,0,0,a,0,0]:[e,0,e*s,i,0,i,0,0];break;case t.FillOrigin.BottomLeft:h=o?a<=i?[0,i,e,i-a,e,0,0,0]:[0,i,e*(1-s),0,0,0]:a<=i?[0,i,e,i-a,e,i]:[0,i,e*(1-s),0,e,0,e,i];break;case t.FillOrigin.BottomRight:h=o?a<=i?[e,i,0,i-a,0,i]:[e,i,e*s,0,0,0,0,i]:a<=i?[e,i,0,i-a,0,0,e,0]:[e,i,e*s,0,e,0]}return h}function i(t,e,i){for(var n=t.length,o=0;o<n;o+=2)t[o]+=e,t[o+1]+=i}function n(n,o,r,s,a){var h;switch(r){case t.FillOrigin.Top:a<=.5?(a/=.5,h=e(n/2,o,s?t.FillOrigin.TopLeft:t.FillOrigin.TopRight,s,a),s&&i(h,n/2,0)):(a=(a-.5)/.5,h=e(n/2,o,s?t.FillOrigin.TopRight:t.FillOrigin.TopLeft,s,a),s?h.push(n,o,n,0):(i(h,n/2,0),h.push(0,o,0,0)));break;case t.FillOrigin.Bottom:a<=.5?(a/=.5,h=e(n/2,o,s?t.FillOrigin.BottomRight:t.FillOrigin.BottomLeft,s,a),s||i(h,n/2,0)):(a=(a-.5)/.5,h=e(n/2,o,s?t.FillOrigin.BottomLeft:t.FillOrigin.BottomRight,s,a),s?(i(h,n/2,0),h.push(0,0,0,o)):h.push(n,0,n,o));break;case t.FillOrigin.Left:a<=.5?(a/=.5,h=e(n,o/2,s?t.FillOrigin.BottomLeft:t.FillOrigin.TopLeft,s,a),s||i(h,0,o/2)):(a=(a-.5)/.5,h=e(n,o/2,s?t.FillOrigin.TopLeft:t.FillOrigin.BottomLeft,s,a),s?(i(h,0,o/2),h.push(n,0,0,0)):h.push(n,o,0,o));break;case t.FillOrigin.Right:a<=.5?(a/=.5,h=e(n,o/2,s?t.FillOrigin.TopRight:t.FillOrigin.BottomRight,s,a),s&&i(h,0,o/2)):(a=(a-.5)/.5,h=e(n,o/2,s?t.FillOrigin.BottomRight:t.FillOrigin.TopRight,s,a),s?h.push(0,o,n,o):(i(h,0,o/2),h.push(0,0,n,0)))}return h}t.fillImage=function(o,r,s,a,h,l){if(l<=0)return null;if(l>=.9999)return[0,0,o,0,o,r,0,r];var c;switch(s){case t.FillMethod.Horizontal:c=function(e,i,n,o){var r=e*o;return n==t.FillOrigin.Left||n==t.FillOrigin.Top?[0,0,r,0,r,i,0,i]:[e,0,e,i,e-r,i,e-r,0]}(o,r,a,l);break;case t.FillMethod.Vertical:c=function(e,i,n,o){var r=i*o;return n==t.FillOrigin.Left||n==t.FillOrigin.Top?[0,0,0,r,e,r,e,0]:[0,i,e,i,e,i-r,0,i-r]}(o,r,a,l);break;case t.FillMethod.Radial90:c=e(o,r,a,h,l);break;case t.FillMethod.Radial180:c=n(o,r,a,h,l);break;case t.FillMethod.Radial360:c=function(e,o,r,s,a){var h;switch(r){case t.FillOrigin.Top:a<=.5?(a/=.5,h=n(e/2,o,s?t.FillOrigin.Left:t.FillOrigin.Right,s,a),s&&i(h,e/2,0)):(a=(a-.5)/.5,h=n(e/2,o,s?t.FillOrigin.Right:t.FillOrigin.Left,s,a),s?h.push(e,o,e,0,e/2,0):(i(h,e/2,0),h.push(0,o,0,0,e/2,0)));break;case t.FillOrigin.Bottom:a<=.5?(a/=.5,h=n(e/2,o,s?t.FillOrigin.Right:t.FillOrigin.Left,s,a),s||i(h,e/2,0)):(a=(a-.5)/.5,h=n(e/2,o,s?t.FillOrigin.Left:t.FillOrigin.Right,s,a),s?(i(h,e/2,0),h.push(0,0,0,o,e/2,o)):h.push(e,0,e,o,e/2,o));break;case t.FillOrigin.Left:a<=.5?(a/=.5,h=n(e,o/2,s?t.FillOrigin.Bottom:t.FillOrigin.Top,s,a),s||i(h,0,o/2)):(a=(a-.5)/.5,h=n(e,o/2,s?t.FillOrigin.Top:t.FillOrigin.Bottom,s,a),s?(i(h,0,o/2),h.push(e,0,0,0,0,o/2)):h.push(e,o,0,o,0,o/2));break;case t.FillOrigin.Right:a<=.5?(a/=.5,h=n(e,o/2,s?t.FillOrigin.Top:t.FillOrigin.Bottom,s,a),s&&i(h,0,o/2)):(a=(a-.5)/.5,h=n(e,o/2,s?t.FillOrigin.Bottom:t.FillOrigin.Top,s,a),s?h.push(0,o,e,o,e,o/2):(i(h,0,o/2),h.push(0,0,e,0,e,o/2)))}return h}(o,r,a,h,l)}return c}}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return t._fillMethod=0,t._fillOrigin=0,t._fillAmount=0,t._color=16777215,t}return __extends(i,e),Object.defineProperty(i.prototype,"color",{get:function(){return this._color},set:function(e){this._color!=e&&(this._color=e,null==this.tint?t.ToolSet.setColorFilter(this,e):this.tint=e)},enumerable:!0,configurable:!0}),i.prototype.$setX=function(t){return this.mask&&(this.mask.x=t),e.prototype.$setX.call(this,t)},i.prototype.$setY=function(t){return this.mask&&(this.mask.y=t),e.prototype.$setY.call(this,t)},Object.defineProperty(i.prototype,"fillMethod",{get:function(){return this._fillMethod},set:function(t){this._fillMethod!=t&&(this._fillMethod=t,0!=this._fillMethod?(this._mask||(this._mask=new egret.Shape,this._mask.touchEnabled=!1),this.mask=this._mask,this._mask.x=this.x,this._mask.y=this.y,this.addEventListener(egret.Event.RESIZE,this.markChanged,this),this.markChanged()):this.mask&&(this._mask.graphics.clear(),this.mask=null,this.removeEventListener(egret.Event.RESIZE,this.markChanged,this)))},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillOrigin",{get:function(){return this._fillOrigin},set:function(t){this._fillOrigin!=t&&(this._fillOrigin=t,0!=this._fillMethod&&this.markChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillClockwise",{get:function(){return this._fillClockwise},set:function(t){this._fillClockwise!=t&&(this._fillClockwise=t,0!=this._fillMethod&&this.markChanged())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fillAmount",{get:function(){return this._fillAmount},set:function(t){this._fillAmount!=t&&(this._fillAmount=t,0!=this._fillMethod&&this.markChanged())},enumerable:!0,configurable:!0}),i.prototype.markChanged=function(){this._maskDirtyFlag||(this._maskDirtyFlag=!0,t.GTimers.inst.callLater(this.doFill,this))},i.prototype.doFill=function(){this._maskDirtyFlag=!1,!this._mask.parent&&this.parent&&this.parent.addChild(this._mask);var e=this.width,i=this.height,n=this._mask.graphics;if(n.clear(),0!=e&&0!=i){var o=t.fillImage(e,i,this._fillMethod,this._fillOrigin,this._fillClockwise,this._fillAmount);o&&(n.beginFill(0,1),t.ToolSet.fillPath(n,o,0,0),n.endFill())}},i}(egret.Bitmap);t.Image=e}(fgui||(fgui={})),function(t){var e=function(e){function i(){var t=e.call(this)||this;return t.interval=0,t.repeatDelay=0,t.timeScale=1,t._playing=!0,t._frameCount=0,t._frame=0,t._start=0,t._end=0,t._times=0,t._endAt=0,t._status=0,t._frameElapsed=0,t._reversed=!1,t._repeatedCount=0,t.touchEnabled=!1,t.setPlaySettings(),t}return __extends(i,e),Object.defineProperty(i.prototype,"frames",{get:function(){return this._frames},set:function(t){this._frames=t,this.scale9Grid=null,this.fillMode=egret.BitmapFillMode.SCALE,this._frames?this._frameCount=this._frames.length:this._frameCount=0,(-1==this._end||this._end>this._frameCount-1)&&(this._end=this._frameCount-1),(-1==this._endAt||this._endAt>this._frameCount-1)&&(this._endAt=this._frameCount-1),(this._frame<0||this._frame>this._frameCount-1)&&(this._frame=this._frameCount-1),this.drawFrame(),this._frameElapsed=0,this._repeatedCount=0,this._reversed=!1,this.checkTimer()},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"frameCount",{get:function(){return this._frameCount},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"frame",{get:function(){return this._frame},set:function(t){this._frame!=t&&(this._frames&&t>=this._frameCount&&(t=this._frameCount-1),this._frame=t,this._frameElapsed=0,this.drawFrame())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"playing",{get:function(){return this._playing},set:function(t){this._playing!=t&&(this._playing=t,this.checkTimer())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"smoothing",{get:function(){return this._smoothing},set:function(t){this._smoothing=t},enumerable:!0,configurable:!0}),i.prototype.rewind=function(){this._frame=0,this._frameElapsed=0,this._reversed=!1,this._repeatedCount=0,this.drawFrame()},i.prototype.syncStatus=function(t){this._frame=t._frame,this._frameElapsed=t._frameElapsed,this._reversed=t._reversed,this._repeatedCount=t._repeatedCount,this.drawFrame()},i.prototype.advance=function(t){for(var e=this._frame,i=this._reversed,n=t;;){var o=this.interval+this._frames[this._frame].addDelay;if(0==this._frame&&this._repeatedCount>0&&(o+=this.repeatDelay),t<o){this._frameElapsed=0;break}if(t-=o,this.swing?this._reversed?(this._frame--,this._frame<=0&&(this._frame=0,this._repeatedCount++,this._reversed=!this._reversed)):(this._frame++,this._frame>this._frameCount-1&&(this._frame=Math.max(0,this._frameCount-2),this._repeatedCount++,this._reversed=!this._reversed)):(this._frame++,this._frame>this._frameCount-1&&(this._frame=0,this._repeatedCount++)),this._frame==e&&this._reversed==i){var r=n-t;t-=Math.floor(t/r)*r}}this.drawFrame()},i.prototype.setPlaySettings=function(t,e,i,n,o,r){null==t&&(t=0),null==e&&(e=-1),null==i&&(i=0),null==n&&(n=-1),this._start=t,this._end=e,(-1==this._end||this._end>this._frameCount-1)&&(this._end=this._frameCount-1),this._times=i,this._endAt=n,-1==this._endAt&&(this._endAt=this._end),this._status=0,this._callback=o,this._callbackObj=r,this.frame=t},i.prototype.update=function(){if(this._playing&&0!=this._frameCount&&3!=this._status){var e=t.GTimers.deltaTime;1!=this.timeScale&&(e*=this.timeScale),this._frameElapsed+=e;var i=this.interval+this._frames[this._frame].addDelay;if(0==this._frame&&this._repeatedCount>0&&(i+=this.repeatDelay),!(this._frameElapsed<i)){if(this._frameElapsed-=i,this._frameElapsed>this.interval&&(this._frameElapsed=this.interval),this.swing?this._reversed?(this._frame--,this._frame<=0&&(this._frame=0,this._repeatedCount++,this._reversed=!this._reversed)):(this._frame++,this._frame>this._frameCount-1&&(this._frame=Math.max(0,this._frameCount-2),this._repeatedCount++,this._reversed=!this._reversed)):(this._frame++,this._frame>this._frameCount-1&&(this._frame=0,this._repeatedCount++)),1==this._status)this._frame=this._start,this._frameElapsed=0,this._status=0;else if(2==this._status){if(this._frame=this._endAt,this._frameElapsed=0,this._status=3,null!=this._callback){var n=this._callback,o=this._callbackObj;this._callback=null,this._callbackObj=null,n.call(o)}}else this._frame==this._end&&(this._times>0?(this._times--,0==this._times?this._status=2:this._status=1):0!=this._start&&(this._status=1));this.drawFrame()}}},i.prototype.drawFrame=function(){if(this._frameCount>0&&this._frame<this._frames.length){var t=this._frames[this._frame];this.texture=t.texture}else this.texture=null},i.prototype.checkTimer=function(){this._playing&&this._frameCount>0&&null!=this.stage?t.GTimers.inst.add(1,0,this.update,this):t.GTimers.inst.remove(this.update,this)},i.prototype.$onAddToStage=function(i,n){e.prototype.$onAddToStage.call(this,i,n),this._playing&&this._frameCount>0&&t.GTimers.inst.add(1,0,this.update,this)},i.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),t.GTimers.inst.remove(this.update,this)},i}(t.Image);t.MovieClip=e}(fgui||(fgui={})),function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.touchEnabled=!0,e.touchChildren=!0,e}return __extends(e,t),e.prototype.cacheHitArea=function(t){this._cachedHitArea=t,t&&(this._cachedMatrix||(this._cachedMatrix=new egret.Matrix),this._cachedMatrix.copyFrom(this.$getInvertedConcatenatedMatrix()))},Object.defineProperty(e.prototype,"hitArea",{get:function(){return this._hitArea},set:function(t){this._hitArea=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"opaque",{get:function(){return this._opaque},set:function(t){this._opaque=t},enumerable:!0,configurable:!0}),e.prototype.$hitTest=function(e,i){if(!this.$visible)return null;if(this._hitArea){if(!this.touchEnabled)return null;if(this._hitArea.$graphics){if(!this._hitArea.$graphics.$hitTest(e,i))return null}else{var n=(s=this._cachedHitArea?this._cachedMatrix:this.$getInvertedConcatenatedMatrix()).a*e+s.c*i+s.tx,o=s.b*e+s.d*i+s.ty;if(!this._hitArea.contains(n,o))return null}return this}var r=t.prototype.$hitTest.call(this,e,i);if(r==this&&!this.touchEnabled)return null;if(null==r&&this._opaque){var s;n=(s=this._cachedHitArea?this._cachedMatrix:this.$getInvertedConcatenatedMatrix()).a*e+s.c*i+s.tx,o=s.b*e+s.d*i+s.ty;return n>=0&&o>=0&&n<=this.$explicitWidth&&o<=this.$explicitHeight?this:null}return r!=this||this._opaque?r:null},e}(egret.DisplayObjectContainer);t.UIContainer=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e,i,n,o){void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=-1);var r=t.call(this,e,!1)||this;return r.touchPointID=0,r.stageX=i,r.stageY=n,r.touchPointID=o,r}return __extends(e,t),e.prototype.preventDefault=function(){this._prevented=!0},e.prototype.isDefaultPrevented=function(){return this._prevented},e.DRAG_START="__dragStart",e.DRAG_END="__dragEnd",e.DRAG_MOVING="__dragMoving",e}(egret.Event);t.DragEvent=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e,i){var n=t.call(this,e,!1)||this;return n.source=i,n}return __extends(e,t),e.DROP="__drop",e}(egret.Event);t.DropEvent=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e,i,n,o){void 0===i&&(i=null),void 0===n&&(n=0),void 0===o&&(o=0);var r=t.call(this,e,!1)||this;return r.itemObject=i,r.stageX=n,r.stageY=o,r}return __extends(e,t),e.CLICK="___itemClick",e}(egret.Event);t.ItemEvent=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e){return t.call(this,e,!1)||this}return __extends(e,t),e.CHANGED="___stateChanged",e}(egret.Event);t.StateChangeEvent=e}(fgui||(fgui={})),function(t){var e,i=function(){function i(t){this._owner=t}return i.create=function(i,n){return e||(e=[t.GearDisplay,t.GearXY,t.GearSize,t.GearLook,t.GearColor,t.GearAnimation,t.GearText,t.GearIcon,t.GearDisplay2,t.GearFontSize]),new e[n](i)},i.prototype.dispose=function(){this._tweenConfig&&this._tweenConfig._tweener&&(this._tweenConfig._tweener.kill(),this._tweenConfig._tweener=null)},Object.defineProperty(i.prototype,"controller",{get:function(){return this._controller},set:function(t){t!=this._controller&&(this._controller=t,this._controller&&this.init())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"tweenConfig",{get:function(){return this._tweenConfig||(this._tweenConfig=new n),this._tweenConfig},enumerable:!0,configurable:!0}),i.prototype.setup=function(e){var i,o;this._controller=this._owner.parent.getControllerAt(e.readShort()),this.init();var r=e.readShort();if(this instanceof t.GearDisplay)this.pages=e.readSArray(r);else if(this instanceof t.GearDisplay2)this.pages=e.readSArray(r);else{for(i=0;i<r;i++)null!=(o=e.readS())&&this.addStatus(o,e);e.readBool()&&this.addStatus(null,e)}if(e.readBool()&&(this._tweenConfig=new n,this._tweenConfig.easeType=e.readByte(),this._tweenConfig.duration=e.readFloat(),this._tweenConfig.delay=e.readFloat()),e.version>=2)if(this instanceof t.GearXY){if(e.readBool()){for(this.positionsInPercent=!0,i=0;i<r;i++)null!=(o=e.readS())&&this.addExtStatus(o,e);e.readBool()&&this.addExtStatus(null,e)}}else this instanceof t.GearDisplay2&&(this.condition=e.readByte())},i.prototype.updateFromRelations=function(t,e){},i.prototype.addStatus=function(t,e){},i.prototype.init=function(){},i.prototype.apply=function(){},i.prototype.updateState=function(){},i}();t.GearBase=i;var n=function(){return function(){this.tween=!0,this.easeType=t.EaseType.QuadOut,this.duration=.3,this.delay=0}}();t.GearTweenConfig=n}(fgui||(fgui={})),function(t){var e=function(e){function i(t){return e.call(this,t)||this}return __extends(i,e),i.prototype.init=function(){this._default={playing:this._owner.getProp(t.ObjectPropID.Playing),frame:this._owner.getProp(t.ObjectPropID.Frame)},this._storage={}},i.prototype.addStatus=function(t,e){var i;null==t?i=this._default:this._storage[t]=i={},i.playing=e.readBool(),i.frame=e.readInt()},i.prototype.apply=function(){this._owner._gearLocked=!0;var e=this._storage[this._controller.selectedPageId];e||(e=this._default),this._owner.setProp(t.ObjectPropID.Playing,e.playing),this._owner.setProp(t.ObjectPropID.Frame,e.frame),this._owner._gearLocked=!1},i.prototype.updateState=function(){var e=this._storage[this._controller.selectedPageId];e||(this._storage[this._controller.selectedPageId]=e={}),e.playing=this._owner.getProp(t.ObjectPropID.Playing),e.frame=this._owner.getProp(t.ObjectPropID.Frame)},i}(t.GearBase);t.GearAnimation=e}(fgui||(fgui={})),function(t){var e=function(e){function i(t){return e.call(this,t)||this}return __extends(i,e),i.prototype.init=function(){this._default={color:this._owner.getProp(t.ObjectPropID.Color),strokeColor:this._owner.getProp(t.ObjectPropID.OutlineColor)},this._storage={}},i.prototype.addStatus=function(t,e){var i;null==t?i=this._default:this._storage[t]=i={},i.color=e.readColor(),i.strokeColor=e.readColor()},i.prototype.apply=function(){this._owner._gearLocked=!0;var e=this._storage[this._controller.selectedPageId];e||(e=this._default),this._owner.setProp(t.ObjectPropID.Color,e.color),this._owner.setProp(t.ObjectPropID.OutlineColor,e.strokeColor),this._owner._gearLocked=!1},i.prototype.updateState=function(){var e=this._storage[this._controller.selectedPageId];e||(this._storage[this._controller.selectedPageId]=e={}),e.color=this._owner.getProp(t.ObjectPropID.Color),e.strokeColor=this._owner.getProp(t.ObjectPropID.OutlineColor)},i}(t.GearBase);t.GearColor=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e){var i=t.call(this,e)||this;return i._displayLockToken=1,i._visible=0,i}return __extends(e,t),e.prototype.init=function(){this.pages=null},e.prototype.apply=function(){this._displayLockToken++,0==this._displayLockToken&&(this._displayLockToken=1),null==this.pages||0==this.pages.length||-1!=this.pages.indexOf(this._controller.selectedPageId)?this._visible=1:this._visible=0},e.prototype.addLock=function(){return this._visible++,this._displayLockToken},e.prototype.releaseLock=function(t){t==this._displayLockToken&&this._visible--},Object.defineProperty(e.prototype,"connected",{get:function(){return null==this._controller||this._visible>0},enumerable:!0,configurable:!0}),e}(t.GearBase);t.GearDisplay=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e){var i=t.call(this,e)||this;return i._visible=0,i}return __extends(e,t),e.prototype.init=function(){this.pages=null},e.prototype.apply=function(){null==this.pages||0==this.pages.length||-1!=this.pages.indexOf(this._controller.selectedPageId)?this._visible=1:this._visible=0},e.prototype.evaluate=function(t){var e=null==this._controller||this._visible>0;return e=0==this.condition?e&&t:e||t},e}(t.GearBase);t.GearDisplay2=e}(fgui||(fgui={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i._default=0,i}return __extends(i,e),i.prototype.init=function(){this._default=this._owner.getProp(t.ObjectPropID.FontSize),this._storage={}},i.prototype.addStatus=function(t,e){null==t?this._default=e.readInt():this._storage[t]=e.readInt()},i.prototype.apply=function(){this._owner._gearLocked=!0;var e=this._storage[this._controller.selectedPageId];null!=e?this._owner.setProp(t.ObjectPropID.FontSize,e):this._owner.setProp(t.ObjectPropID.FontSize,this._default),this._owner._gearLocked=!1},i.prototype.updateState=function(){this._storage[this._controller.selectedPageId]=this._owner.getProp(t.ObjectPropID.FontSize)},i}(t.GearBase);t.GearFontSize=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.init=function(){this._default=this._owner.icon,this._storage={}},e.prototype.addStatus=function(t,e){null==t?this._default=e.readS():this._storage[t]=e.readS()},e.prototype.apply=function(){this._owner._gearLocked=!0;var t=this._storage[this._controller.selectedPageId];this._owner.icon=void 0!==t?t:this._default,this._owner._gearLocked=!1},e.prototype.updateState=function(){this._storage[this._controller.selectedPageId]=this._owner.icon},e}(t.GearBase);t.GearIcon=e}(fgui||(fgui={})),function(t){var e=function(e){function i(t){return e.call(this,t)||this}return __extends(i,e),i.prototype.init=function(){this._default={alpha:this._owner.alpha,rotation:this._owner.rotation,grayed:this._owner.grayed,touchable:this._owner.touchable},this._storage={}},i.prototype.addStatus=function(t,e){var i;null==t?i=this._default:this._storage[t]=i={},i.alpha=e.readFloat(),i.rotation=e.readFloat(),i.grayed=e.readBool(),i.touchable=e.readBool()},i.prototype.apply=function(){var e=this._storage[this._controller.selectedPageId];if(e||(e=this._default),this._tweenConfig&&this._tweenConfig.tween&&!t.UIPackage._constructing&&!t.GearBase.disableAllTweenEffect){if(this._owner._gearLocked=!0,this._owner.grayed=e.grayed,this._owner.touchable=e.touchable,this._owner._gearLocked=!1,this._tweenConfig._tweener){if(this._tweenConfig._tweener.endValue.x==e.alpha&&this._tweenConfig._tweener.endValue.y==e.rotation)return;this._tweenConfig._tweener.kill(!0),this._tweenConfig._tweener=null}var i=e.alpha!=this._owner.alpha,n=e.rotation!=this._owner.rotation;(i||n)&&(this._owner.checkGearController(0,this._controller)&&(this._tweenConfig._displayLockToken=this._owner.addDisplayLock()),this._tweenConfig._tweener=t.GTween.to2(this._owner.alpha,this._owner.rotation,e.alpha,e.rotation,this._tweenConfig.duration).setDelay(this._tweenConfig.delay).setEase(this._tweenConfig.easeType).setUserData((i?1:0)+(n?2:0)).setTarget(this).onUpdate(this.__tweenUpdate,this).onComplete(this.__tweenComplete,this))}else this._owner._gearLocked=!0,this._owner.grayed=e.grayed,this._owner.touchable=e.touchable,this._owner.alpha=e.alpha,this._owner.rotation=e.rotation,this._owner._gearLocked=!1},i.prototype.__tweenUpdate=function(t){var e=t.userData;this._owner._gearLocked=!0,0!=(1&e)&&(this._owner.alpha=t.value.x),0!=(2&e)&&(this._owner.rotation=t.value.y),this._owner._gearLocked=!1},i.prototype.__tweenComplete=function(){0!=this._tweenConfig._displayLockToken&&(this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken),this._tweenConfig._displayLockToken=0),this._tweenConfig._tweener=null},i.prototype.updateState=function(){var t=this._storage[this._controller.selectedPageId];t||(this._storage[this._controller.selectedPageId]=t={}),t.alpha=this._owner.alpha,t.rotation=this._owner.rotation,t.grayed=this._owner.grayed,t.touchable=this._owner.touchable},i}(t.GearBase);t.GearLook=e}(fgui||(fgui={})),function(t){var e=function(e){function i(t){return e.call(this,t)||this}return __extends(i,e),i.prototype.init=function(){this._default={width:this._owner.width,height:this._owner.height,scaleX:this._owner.scaleX,scaleY:this._owner.scaleY},this._storage={}},i.prototype.addStatus=function(t,e){var i;null==t?i=this._default:this._storage[t]=i={},i.width=e.readInt(),i.height=e.readInt(),i.scaleX=e.readFloat(),i.scaleY=e.readFloat()},i.prototype.apply=function(){var e=this._storage[this._controller.selectedPageId];if(e||(e=this._default),this._tweenConfig&&this._tweenConfig.tween&&!t.UIPackage._constructing&&!t.GearBase.disableAllTweenEffect){if(this._tweenConfig._tweener){if(this._tweenConfig._tweener.endValue.x==e.width&&this._tweenConfig._tweener.endValue.y==e.height&&this._tweenConfig._tweener.endValue.z==e.scaleX&&this._tweenConfig._tweener.endValue.w==e.scaleY)return;this._tweenConfig._tweener.kill(!0),this._tweenConfig._tweener=null}var i=e.width!=this._owner.width||e.height!=this._owner.height,n=e.scaleX!=this._owner.scaleX||e.scaleY!=this._owner.scaleY;(i||n)&&(this._owner.checkGearController(0,this._controller)&&(this._tweenConfig._displayLockToken=this._owner.addDisplayLock()),this._tweenConfig._tweener=t.GTween.to4(this._owner.width,this._owner.height,this._owner.scaleX,this._owner.scaleY,e.width,e.height,e.scaleX,e.scaleY,this._tweenConfig.duration).setDelay(this._tweenConfig.delay).setEase(this._tweenConfig.easeType).setUserData((i?1:0)+(n?2:0)).setTarget(this).onUpdate(this.__tweenUpdate,this).onComplete(this.__tweenComplete,this))}else this._owner._gearLocked=!0,this._owner.setSize(e.width,e.height,this._owner.gearXY.controller==this._controller),this._owner.setScale(e.scaleX,e.scaleY),this._owner._gearLocked=!1},i.prototype.__tweenUpdate=function(t){var e=t.userData;this._owner._gearLocked=!0,0!=(1&e)&&this._owner.setSize(t.value.x,t.value.y,this._owner.checkGearController(1,this._controller)),0!=(2&e)&&this._owner.setScale(t.value.z,t.value.w),this._owner._gearLocked=!1},i.prototype.__tweenComplete=function(){0!=this._tweenConfig._displayLockToken&&(this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken),this._tweenConfig._displayLockToken=0),this._tweenConfig._tweener=null},i.prototype.updateState=function(){var t=this._storage[this._controller.selectedPageId];t||(this._storage[this._controller.selectedPageId]=t={}),t.width=this._owner.width,t.height=this._owner.height,t.scaleX=this._owner.scaleX,t.scaleY=this._owner.scaleY},i.prototype.updateFromRelations=function(t,e){if(null!=this._controller&&null!=this._storage){for(var i in this._storage){var n=this._storage[i];n.width+=t,n.height+=e}this._default.width+=t,this._default.height+=e,this.updateState()}},i}(t.GearBase);t.GearSize=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e){return t.call(this,e)||this}return __extends(e,t),e.prototype.init=function(){this._default=this._owner.text,this._storage={}},e.prototype.addStatus=function(t,e){null==t?this._default=e.readS():this._storage[t]=e.readS()},e.prototype.apply=function(){this._owner._gearLocked=!0;var t=this._storage[this._controller.selectedPageId];this._owner.text=void 0!==t?t:this._default,this._owner._gearLocked=!1},e.prototype.updateState=function(){this._storage[this._controller.selectedPageId]=this._owner.text},e}(t.GearBase);t.GearText=e}(fgui||(fgui={})),function(t){var e=function(e){function i(t){return e.call(this,t)||this}return __extends(i,e),i.prototype.init=function(){this._default={x:this._owner.x,y:this._owner.y,px:this._owner.x/this._owner.parent.width,py:this._owner.y/this._owner.parent.height},this._storage={}},i.prototype.addStatus=function(t,e){var i;null==t?i=this._default:this._storage[t]=i={},i.x=e.readInt(),i.y=e.readInt()},i.prototype.addExtStatus=function(t,e){var i;(i=null==t?this._default:this._storage[t]).px=e.readFloat(),i.py=e.readFloat()},i.prototype.apply=function(){var e,i,n=this._storage[this._controller.selectedPageId];if(n||(n=this._default),this.positionsInPercent&&this._owner.parent?(e=n.px*this._owner.parent.width,i=n.py*this._owner.parent.height):(e=n.x,i=n.y),this._tweenConfig&&this._tweenConfig.tween&&!t.UIPackage._constructing&&!t.GearBase.disableAllTweenEffect){if(this._tweenConfig._tweener){if(this._tweenConfig._tweener.endValue.x==e&&this._tweenConfig._tweener.endValue.y==i)return;this._tweenConfig._tweener.kill(!0),this._tweenConfig._tweener=null}var o=this._owner.x,r=this._owner.y;o==e&&r==i||(this._owner.checkGearController(0,this._controller)&&(this._tweenConfig._displayLockToken=this._owner.addDisplayLock()),this._tweenConfig._tweener=t.GTween.to2(o,r,e,i,this._tweenConfig.duration).setDelay(this._tweenConfig.delay).setEase(this._tweenConfig.easeType).setTarget(this).onUpdate(this.__tweenUpdate,this).onComplete(this.__tweenComplete,this))}else this._owner._gearLocked=!0,this._owner.setXY(e,i),this._owner._gearLocked=!1},i.prototype.__tweenUpdate=function(t){this._owner._gearLocked=!0,this._owner.setXY(t.value.x,t.value.y),this._owner._gearLocked=!1},i.prototype.__tweenComplete=function(){0!=this._tweenConfig._displayLockToken&&(this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken),this._tweenConfig._displayLockToken=0),this._tweenConfig._tweener=null},i.prototype.updateState=function(){var t=this._storage[this._controller.selectedPageId];t||(this._storage[this._controller.selectedPageId]=t={}),t.x=this._owner.x,t.y=this._owner.y,t.px=this._owner.x/this._owner.parent.width,t.py=this._owner.y/this._owner.parent.height},i.prototype.updateFromRelations=function(t,e){if(null!=this._controller&&null!=this._storage&&!this.positionsInPercent){for(var i in this._storage){var n=this._storage[i];n.x+=t,n.y+=e}this._default.x+=t,this._default.y+=e,this.updateState()}},i}(t.GearBase);t.GearXY=e}(fgui||(fgui={})),function(t){var e=.5*Math.PI,i=2*Math.PI;function n(t,e){return 1-o(e-t,e)}function o(t,e){return(t/=e)<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}t.evaluateEase=function(r,s,a,h,l){switch(r){case t.EaseType.Linear:return s/a;case t.EaseType.SineIn:return 1-Math.cos(s/a*e);case t.EaseType.SineOut:return Math.sin(s/a*e);case t.EaseType.SineInOut:return-.5*(Math.cos(Math.PI*s/a)-1);case t.EaseType.QuadIn:return(s/=a)*s;case t.EaseType.QuadOut:return-(s/=a)*(s-2);case t.EaseType.QuadInOut:return(s/=.5*a)<1?.5*s*s:-.5*(--s*(s-2)-1);case t.EaseType.CubicIn:return(s/=a)*s*s;case t.EaseType.CubicOut:return(s=s/a-1)*s*s+1;case t.EaseType.CubicInOut:return(s/=.5*a)<1?.5*s*s*s:.5*((s-=2)*s*s+2);case t.EaseType.QuartIn:return(s/=a)*s*s*s;case t.EaseType.QuartOut:return-((s=s/a-1)*s*s*s-1);case t.EaseType.QuartInOut:return(s/=.5*a)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2);case t.EaseType.QuintIn:return(s/=a)*s*s*s*s;case t.EaseType.QuintOut:return(s=s/a-1)*s*s*s*s+1;case t.EaseType.QuintInOut:return(s/=.5*a)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2);case t.EaseType.ExpoIn:return 0==s?0:Math.pow(2,10*(s/a-1));case t.EaseType.ExpoOut:return s==a?1:1-Math.pow(2,-10*s/a);case t.EaseType.ExpoInOut:return 0==s?0:s==a?1:(s/=.5*a)<1?.5*Math.pow(2,10*(s-1)):.5*(2-Math.pow(2,-10*--s));case t.EaseType.CircIn:return-(Math.sqrt(1-(s/=a)*s)-1);case t.EaseType.CircOut:return Math.sqrt(1-(s=s/a-1)*s);case t.EaseType.CircInOut:return(s/=.5*a)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1);case t.EaseType.ElasticIn:var c;return 0==s?0:1==(s/=a)?1:(0==l&&(l=.3*a),h<1?(h=1,c=l/4):c=l/i*Math.asin(1/h),-h*Math.pow(2,10*(s-=1))*Math.sin((s*a-c)*i/l));case t.EaseType.ElasticOut:var u;return 0==s?0:1==(s/=a)?1:(0==l&&(l=.3*a),h<1?(h=1,u=l/4):u=l/i*Math.asin(1/h),h*Math.pow(2,-10*s)*Math.sin((s*a-u)*i/l)+1);case t.EaseType.ElasticInOut:var _;return 0==s?0:2==(s/=.5*a)?1:(0==l&&(l=a*(.3*1.5)),h<1?(h=1,_=l/4):_=l/i*Math.asin(1/h),s<1?h*Math.pow(2,10*(s-=1))*Math.sin((s*a-_)*i/l)*-.5:h*Math.pow(2,-10*(s-=1))*Math.sin((s*a-_)*i/l)*.5+1);case t.EaseType.BackIn:return(s/=a)*s*((h+1)*s-h);case t.EaseType.BackOut:return(s=s/a-1)*s*((h+1)*s+h)+1;case t.EaseType.BackInOut:return(s/=.5*a)<1?s*s*((1+(h*=1.525))*s-h)*.5:.5*((s-=2)*s*((1+(h*=1.525))*s+h)+2);case t.EaseType.BounceIn:return n(s,a);case t.EaseType.BounceOut:return o(s,a);case t.EaseType.BounceInOut:return function(t,e){return t<.5*e?.5*n(2*t,e):.5*o(2*t-e,e)+.5}(s,a);default:return-(s/=a)*(s-2)}}}(fgui||(fgui={})),function(t){var e=function(){function t(){}return t.Linear=0,t.SineIn=1,t.SineOut=2,t.SineInOut=3,t.QuadIn=4,t.QuadOut=5,t.QuadInOut=6,t.CubicIn=7,t.CubicOut=8,t.CubicInOut=9,t.QuartIn=10,t.QuartOut=11,t.QuartInOut=12,t.QuintIn=13,t.QuintOut=14,t.QuintInOut=15,t.ExpoIn=16,t.ExpoOut=17,t.ExpoInOut=18,t.CircIn=19,t.CircOut=20,t.CircInOut=21,t.ElasticIn=22,t.ElasticOut=23,t.ElasticInOut=24,t.BackIn=25,t.BackOut=26,t.BackInOut=27,t.BounceIn=28,t.BounceOut=29,t.BounceInOut=30,t.Custom=31,t}();t.EaseType=e}(fgui||(fgui={})),function(t){var e=function(){function e(){this._segments=new Array,this._points=new Array}return Object.defineProperty(e.prototype,"length",{get:function(){return this._fullLength},enumerable:!0,configurable:!0}),e.prototype.create=function(e,n,o,r){var s;Array.isArray(e)?s=e:((s=new Array).push(e),s.push(n),o&&s.push(o),r&&s.push(r)),this._segments.length=0,this._points.length=0,this._fullLength=0;var a=s.length;if(0!=a){var h=i;h.length=0;var l=s[0];l.curveType==t.CurveType.CRSpline&&h.push(new egret.Point(l.x,l.y));for(var c=1;c<a;c++){var u=s[c];if(l.curveType!=t.CurveType.CRSpline){var _={};_.type=l.curveType,_.ptStart=this._points.length,l.curveType==t.CurveType.Straight?(_.ptCount=2,this._points.push(new egret.Point(l.x,l.y)),this._points.push(new egret.Point(u.x,u.y))):l.curveType==t.CurveType.Bezier?(_.ptCount=3,this._points.push(new egret.Point(l.x,l.y)),this._points.push(new egret.Point(u.x,u.y)),this._points.push(new egret.Point(l.control1_x,l.control1_y))):l.curveType==t.CurveType.CubicBezier&&(_.ptCount=4,this._points.push(new egret.Point(l.x,l.y)),this._points.push(new egret.Point(u.x,u.y)),this._points.push(new egret.Point(l.control1_x,l.control1_y)),this._points.push(new egret.Point(l.control2_x,l.control2_y))),_.length=t.ToolSet.distance(l.x,l.y,u.x,u.y),this._fullLength+=_.length,this._segments.push(_)}u.curveType!=t.CurveType.CRSpline?h.length>0&&(h.push(new egret.Point(u.x,u.y)),this.createSplineSegment()):h.push(new egret.Point(u.x,u.y)),l=u}h.length>1&&this.createSplineSegment()}},e.prototype.createSplineSegment=function(){var e=i,n=e.length;e.splice(0,0,e[0]),e.push(e[n]),e.push(e[n]),n+=3;var o={};o.type=t.CurveType.CRSpline,o.ptStart=this._points.length,o.ptCount=n,this._points=this._points.concat(e),o.length=0;for(var r=1;r<n;r++)o.length+=t.ToolSet.distance(e[r-1].x,e[r-1].y,e[r].x,e[r].y);this._fullLength+=o.length,this._segments.push(o),e.length=0},e.prototype.clear=function(){this._segments.length=0,this._points.length=0},e.prototype.getPointAt=function(e,i){i?i.x=i.y=0:i=new egret.Point,e=t.ToolSet.clamp01(e);var n,o=this._segments.length;if(0==o)return i;if(1==e)return(n=this._segments[o-1]).type==t.CurveType.Straight?(i.x=t.ToolSet.lerp(this._points[n.ptStart].x,this._points[n.ptStart+1].x,e),i.y=t.ToolSet.lerp(this._points[n.ptStart].y,this._points[n.ptStart+1].y,e),i):n.type==t.CurveType.Bezier||n.type==t.CurveType.CubicBezier?this.onBezierCurve(n.ptStart,n.ptCount,e,i):this.onCRSplineCurve(n.ptStart,n.ptCount,e,i);for(var r=e*this._fullLength,s=0;s<o;s++)if((r-=(n=this._segments[s]).length)<0){e=1+r/n.length,n.type==t.CurveType.Straight?(i.x=t.ToolSet.lerp(this._points[n.ptStart].x,this._points[n.ptStart+1].x,e),i.y=t.ToolSet.lerp(this._points[n.ptStart].y,this._points[n.ptStart+1].y,e)):i=n.type==t.CurveType.Bezier||n.type==t.CurveType.CubicBezier?this.onBezierCurve(n.ptStart,n.ptCount,e,i):this.onCRSplineCurve(n.ptStart,n.ptCount,e,i);break}return i},Object.defineProperty(e.prototype,"segmentCount",{get:function(){return this._segments.length},enumerable:!0,configurable:!0}),e.prototype.getAnchorsInSegment=function(t,e){null==e&&(e=new Array);for(var i=this._segments[t],n=0;n<i.ptCount;n++)e.push(new egret.Point(this._points[i.ptStart+n].x,this._points[i.ptStart+n].y));return e},e.prototype.getPointsInSegment=function(e,i,n,o,r,s){null==o&&(o=new Array),s&&!isNaN(s)||(s=.1),r&&r.push(i);var a=this._segments[e];if(a.type==t.CurveType.Straight)o.push(new egret.Point(t.ToolSet.lerp(this._points[a.ptStart].x,this._points[a.ptStart+1].x,i),t.ToolSet.lerp(this._points[a.ptStart].y,this._points[a.ptStart+1].y,i))),o.push(new egret.Point(t.ToolSet.lerp(this._points[a.ptStart].x,this._points[a.ptStart+1].x,n),t.ToolSet.lerp(this._points[a.ptStart].y,this._points[a.ptStart+1].y,n)));else{var h;h=a.type==t.CurveType.Bezier||a.type==t.CurveType.CubicBezier?this.onBezierCurve:this.onCRSplineCurve,o.push(h.call(this,a.ptStart,a.ptCount,i,new egret.Point));for(var l=Math.min(a.length*s,50),c=0;c<=l;c++){var u=c/l;u>i&&u<n&&(o.push(h.call(this,a.ptStart,a.ptCount,u,new egret.Point)),null!=r&&r.push(u))}o.push(h.call(this,a.ptStart,a.ptCount,n,new egret.Point))}return null!=r&&r.push(n),o},e.prototype.getAllPoints=function(t,e,i){null==t&&(t=new Array),i&&!isNaN(i)||(i=.1);for(var n=this._segments.length,o=0;o<n;o++)this.getPointsInSegment(o,0,1,t,e,i);return t},e.prototype.onCRSplineCurve=function(e,i,n,o){var r=Math.floor(n*(i-4))+e,s=this._points[r].x,a=this._points[r].y,h=this._points[r+1].x,l=this._points[r+1].y,c=this._points[r+2].x,u=this._points[r+2].y,_=this._points[r+3].x,p=this._points[r+3].y,d=1==n?1:t.ToolSet.repeat(n*(i-4),1),g=((2-d)*d-1)*d*.5,f=.5*((3*d-5)*d*d+2),y=((-3*d+4)*d+1)*d*.5,m=(d-1)*d*d*.5;return o.x=s*g+h*f+c*y+_*m,o.y=a*g+l*f+u*y+p*m,o},e.prototype.onBezierCurve=function(t,e,i,n){var o=1-i,r=this._points[t].x,s=this._points[t].y,a=this._points[t+1].x,h=this._points[t+1].y,l=this._points[t+2].x,c=this._points[t+2].y;if(4==e){var u=this._points[t+3].x,_=this._points[t+3].y;n.x=o*o*o*r+3*o*o*i*l+3*o*i*i*u+i*i*i*a,n.y=o*o*o*s+3*o*o*i*c+3*o*i*i*_+i*i*i*h}else n.x=o*o*r+2*o*i*l+i*i*a,n.y=o*o*s+2*o*i*c+i*i*h;return n},e}();t.GPath=e;var i=new Array}(fgui||(fgui={})),function(t){var e;!function(t){t[t.CRSpline=0]="CRSpline",t[t.Bezier=1]="Bezier",t[t.CubicBezier=2]="CubicBezier",t[t.Straight=3]="Straight"}(e=t.CurveType||(t.CurveType={}));var i=function(){function t(){this.x=0,this.y=0,this.control1_x=0,this.control1_y=0,this.control2_x=0,this.control2_y=0,this.curveType=0}return t.newPoint=function(e,i,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0);var o=new t;return o.x=e,o.y=i,o.control1_x=0,o.control1_y=0,o.control2_x=0,o.control2_y=0,o.curveType=n,o},t.newBezierPoint=function(i,n,o,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===r&&(r=0);var s=new t;return s.x=i,s.y=n,s.control1_x=o,s.control1_y=r,s.control2_x=0,s.control2_y=0,s.curveType=e.Bezier,s},t.newCubicBezierPoint=function(i,n,o,r,s,a){void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===a&&(a=0);var h=new t;return h.x=i,h.y=n,h.control1_x=o,h.control1_y=r,h.control2_x=s,h.control2_y=a,h.curveType=e.CubicBezier,h},t.prototype.clone=function(){var e=new t;return e.x=this.x,e.y=this.y,e.control1_x=this.control1_x,e.control1_y=this.control1_y,e.control2_x=this.control2_x,e.control2_y=this.control2_y,e.curveType=this.curveType,e},t}();t.GPathPoint=i}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.to=function(e,i,n){return t.TweenManager.createTween()._to(e,i,n)},e.to2=function(e,i,n,o,r){return t.TweenManager.createTween()._to2(e,i,n,o,r)},e.to3=function(e,i,n,o,r,s,a){return t.TweenManager.createTween()._to3(e,i,n,o,r,s,a)},e.to4=function(e,i,n,o,r,s,a,h,l){return t.TweenManager.createTween()._to4(e,i,n,o,r,s,a,h,l)},e.toColor=function(e,i,n){return t.TweenManager.createTween()._toColor(e,i,n)},e.delayedCall=function(e){return t.TweenManager.createTween().setDelay(e)},e.shake=function(e,i,n,o){return t.TweenManager.createTween()._shake(e,i,n,o)},e.isTweening=function(e,i){return t.TweenManager.isTweening(e,i)},e.kill=function(e,i,n){t.TweenManager.killTweens(e,i,n)},e.getTween=function(e,i){return t.TweenManager.getTween(e,i)},e.catchCallbackExceptions=!0,e}();t.GTween=e}(fgui||(fgui={})),function(t){var e=function(){function e(){this._startValue=new t.TweenValue,this._endValue=new t.TweenValue,this._value=new t.TweenValue,this._deltaValue=new t.TweenValue,this._reset()}return e.prototype.setDelay=function(t){return this._delay=t,this},Object.defineProperty(e.prototype,"delay",{get:function(){return this._delay},enumerable:!0,configurable:!0}),e.prototype.setDuration=function(t){return this._duration=t,this},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!0,configurable:!0}),e.prototype.setBreakpoint=function(t){return this._breakpoint=t,this},e.prototype.setEase=function(t){return this._easeType=t,this},e.prototype.setEasePeriod=function(t){return this._easePeriod=t,this},e.prototype.setEaseOvershootOrAmplitude=function(t){return this._easeOvershootOrAmplitude=t,this},e.prototype.setRepeat=function(t,e){return this._repeat=t,this._yoyo=e,this},Object.defineProperty(e.prototype,"repeat",{get:function(){return this._repeat},enumerable:!0,configurable:!0}),e.prototype.setTimeScale=function(t){return this._timeScale=t,this},e.prototype.setSnapping=function(t){return this._snapping=t,this},e.prototype.setTarget=function(t,e){return this._target=t,this._propType=e,this},Object.defineProperty(e.prototype,"target",{get:function(){return this._target},enumerable:!0,configurable:!0}),e.prototype.setUserData=function(t){return this._userData=t,this},Object.defineProperty(e.prototype,"userData",{get:function(){return this._userData},enumerable:!0,configurable:!0}),e.prototype.setPath=function(t){return this._path=t,this},e.prototype.onUpdate=function(t,e){return this._onUpdate=t,this._onUpdateCaller=e,this},e.prototype.onStart=function(t,e){return this._onStart=t,this._onStartCaller=e,this},e.prototype.onComplete=function(t,e){return this._onComplete=t,this._onCompleteCaller=e,this},Object.defineProperty(e.prototype,"startValue",{get:function(){return this._startValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endValue",{get:function(){return this._endValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deltaValue",{get:function(){return this._deltaValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"normalizedTime",{get:function(){return this._normalizedTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"completed",{get:function(){return 0!=this._ended},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allCompleted",{get:function(){return 1==this._ended},enumerable:!0,configurable:!0}),e.prototype.setPaused=function(t){return this._paused=t,this},e.prototype.seek=function(t){if(!this._killed){if(this._elapsedTime=t,this._elapsedTime<this._delay){if(!this._started)return;this._elapsedTime=this._delay}this.update()}},e.prototype.kill=function(t){this._killed||(t&&(0==this._ended&&(this._breakpoint>=0?this._elapsedTime=this._delay+this._breakpoint:this._repeat>=0?this._elapsedTime=this._delay+this._duration*(this._repeat+1):this._elapsedTime=this._delay+2*this._duration,this.update()),this.callCompleteCallback()),this._killed=!0)},e.prototype._to=function(t,e,i){return this._valueSize=1,this._startValue.x=t,this._endValue.x=e,this._value.x=t,this._duration=i,this},e.prototype._to2=function(t,e,i,n,o){return this._valueSize=2,this._startValue.x=t,this._endValue.x=i,this._startValue.y=e,this._endValue.y=n,this._value.x=t,this._value.y=e,this._duration=o,this},e.prototype._to3=function(t,e,i,n,o,r,s){return this._valueSize=3,this._startValue.x=t,this._endValue.x=n,this._startValue.y=e,this._endValue.y=o,this._startValue.z=i,this._endValue.z=r,this._value.x=t,this._value.y=e,this._value.z=i,this._duration=s,this},e.prototype._to4=function(t,e,i,n,o,r,s,a,h){return this._valueSize=4,this._startValue.x=t,this._endValue.x=o,this._startValue.y=e,this._endValue.y=r,this._startValue.z=i,this._endValue.z=s,this._startValue.w=n,this._endValue.w=a,this._value.x=t,this._value.y=e,this._value.z=i,this._value.w=n,this._duration=h,this},e.prototype._toColor=function(t,e,i){return this._valueSize=4,this._startValue.color=t,this._endValue.color=e,this._value.color=t,this._duration=i,this},e.prototype._shake=function(t,e,i,n){return this._valueSize=5,this._startValue.x=t,this._startValue.y=e,this._startValue.w=i,this._duration=n,this},e.prototype._init=function(){this._delay=0,this._duration=0,this._breakpoint=-1,this._easeType=t.EaseType.QuadOut,this._timeScale=1,this._easePeriod=0,this._easeOvershootOrAmplitude=1.70158,this._snapping=!1,this._repeat=0,this._yoyo=!1,this._valueSize=0,this._started=!1,this._paused=!1,this._killed=!1,this._elapsedTime=0,this._normalizedTime=0,this._ended=0},e.prototype._reset=function(){this._target=null,this._propType=null,this._userData=null,this._path=null,this._onStart=this._onUpdate=this._onComplete=null,this._onStartCaller=this._onUpdateCaller=this._onCompleteCaller=null},e.prototype._update=function(t){if(1!=this._timeScale&&(t*=this._timeScale),0!=t){if(0!=this._ended)return this.callCompleteCallback(),void(this._killed=!0);this._elapsedTime+=t,this.update(),0!=this._ended&&(this._killed||(this.callCompleteCallback(),this._killed=!0))}},e.prototype.update=function(){if(this._ended=0,0!=this._valueSize){if(!this._started){if(this._elapsedTime<this._delay)return;if(this._started=!0,this.callStartCallback(),this._killed)return}var e=!1,n=this._elapsedTime-this._delay;if(this._breakpoint>=0&&n>=this._breakpoint&&(n=this._breakpoint,this._ended=2),0!=this._repeat){var o=Math.floor(n/this._duration);n-=this._duration*o,this._yoyo&&(e=o%2==1),this._repeat>0&&this._repeat-o<0&&(this._yoyo&&(e=this._repeat%2==1),n=this._duration,this._ended=1)}else n>=this._duration&&(n=this._duration,this._ended=1);if(this._normalizedTime=t.evaluateEase(this._easeType,e?this._duration-n:n,this._duration,this._easeOvershootOrAmplitude,this._easePeriod),this._value.setZero(),this._deltaValue.setZero(),5==this._valueSize)if(0==this._ended){var r=this._startValue.w*(1-this._normalizedTime),s=r*(Math.random()>.5?1:-1),a=r*(Math.random()>.5?1:-1);this._deltaValue.x=s,this._deltaValue.y=a,this._value.x=this._startValue.x+s,this._value.y=this._startValue.y+a}else this._value.x=this._startValue.x,this._value.y=this._startValue.y;else if(this._path){var h=i;this._path.getPointAt(this._normalizedTime,h),this._snapping&&(h.x=Math.round(h.x),h.y=Math.round(h.y)),this._deltaValue.x=h.x-this._value.x,this._deltaValue.y=h.y-this._value.y,this._value.x=h.x,this._value.y=h.y}else for(var l=0;l<this._valueSize;l++){var c=this._startValue.getField(l),u=c+(this._endValue.getField(l)-c)*this._normalizedTime;this._snapping&&(u=Math.round(u)),this._deltaValue.setField(l,u-this._value.getField(l)),this._value.setField(l,u)}if(null!=this._target&&null!=this._propType)if(this._propType instanceof Function)switch(this._valueSize){case 1:this._propType.call(this._target,this._value.x);break;case 2:this._propType.call(this._target,this._value.x,this._value.y);break;case 3:this._propType.call(this._target,this._value.x,this._value.y,this._value.z);break;case 4:this._propType.call(this._target,this._value.x,this._value.y,this._value.z,this._value.w);break;case 5:this._propType.call(this._target,this._value.color);break;case 6:this._propType.call(this._target,this._value.x,this._value.y)}else 5==this._valueSize?this._target[this._propType]=this._value.color:this._target[this._propType]=this._value.x;this.callUpdateCallback()}else this._elapsedTime>=this._delay+this._duration&&(this._ended=1)},e.prototype.callStartCallback=function(){if(null!=this._onStart)try{this._onStart.call(this._onStartCaller,this)}catch(t){console.log("FairyGUI: error in start callback > "+t)}},e.prototype.callUpdateCallback=function(){if(null!=this._onUpdate)try{this._onUpdate.call(this._onUpdateCaller,this)}catch(t){console.log("FairyGUI: error in update callback > "+t)}},e.prototype.callCompleteCallback=function(){if(null!=this._onComplete)try{this._onComplete.call(this._onCompleteCaller,this)}catch(t){console.log("FairyGUI: error in complete callback > "+t)}},e}();t.GTweener=e;var i=new egret.Point}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.createTween=function(){var a;return i||(egret.startTick(e.update,null),i=!0,s=egret.getTimer()),(a=o.length>0?o.pop():new t.GTweener)._init(),n[r++]=a,r==n.length&&(n.length=n.length+Math.ceil(.5*n.length)),a},e.isTweening=function(t,e){if(null==t)return!1;for(var i=null==e,o=0;o<r;o++){var s=n[o];if(null!=s&&s.target==t&&!s._killed&&(i||s._propType==e))return!0}return!1},e.killTweens=function(t,e,i){if(null==t)return!1;for(var o=!1,s=r,a=null==i,h=0;h<s;h++){var l=n[h];null==l||l.target!=t||l._killed||!a&&l._propType!=i||(l.kill(e),o=!0)}return o},e.getTween=function(t,e){if(null==t)return null;for(var i=r,o=null==e,s=0;s<i;s++){var a=n[s];if(null!=a&&a.target==t&&!a._killed&&(o||a._propType==e))return a}return null},e.update=function(e){var i=e-s;s=e,i/=1e3;for(var a=r,h=-1,l=0;l<a;l++){var c=n[l];null==c?(-1==h&&(h=l),0):c._killed?(c._reset(),o.push(c),n[l]=null,-1==h&&(h=l),0):(c._target instanceof t.GObject&&c._target.isDisposed?c._killed=!0:c._paused||c._update(i),-1!=h&&(n[h]=c,n[l]=null,h++))}if(h>=0){if(r!=a){var u=a;for(a=r-a,l=0;l<a;l++)n[h++]=n[u++]}r=h}return!1},e}();t.TweenManager=e;var i,n=new Array(30),o=new Array,r=0,s=0}(fgui||(fgui={})),function(t){var e=function(){function t(){this.x=this.y=this.z=this.w=0}return Object.defineProperty(t.prototype,"color",{get:function(){return(this.w<<24)+(this.x<<16)+(this.y<<8)+this.z},set:function(t){this.x=(16711680&t)>>16,this.y=(65280&t)>>8,this.z=255&t,this.w=(4278190080&t)>>24},enumerable:!0,configurable:!0}),t.prototype.getField=function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("Index out of bounds: "+t)}},t.prototype.setField=function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("Index out of bounds: "+t)}},t.prototype.setZero=function(){this.x=this.y=this.z=this.w=0},t}();t.TweenValue=e}(fgui||(fgui={})),function(t){var e=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n.version=0,n}return __extends(e,t),e.prototype.skip=function(t){this.position+=t},e.prototype.readBool=function(){return 1==this.readByte()},e.prototype.readS=function(){var t=this.readUnsignedShort();return 65534==t?null:65533==t?"":this.stringTable[t]},e.prototype.readSArray=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=this.readS();return e},e.prototype.writeS=function(t){var e=this.readUnsignedShort();65534!=e&&65533!=e&&(this.stringTable[e]=t)},e.prototype.readColor=function(t){var e=this.readUnsignedByte(),i=this.readUnsignedByte(),n=this.readUnsignedByte(),o=this.readUnsignedByte();return(t?o<<24:0)+(e<<16)+(i<<8)+n},e.prototype.readChar=function(){var t=this.readUnsignedShort();return String.fromCharCode(t)},e.prototype.readBuffer=function(){var t=this.readUnsignedInt(),i=new e(new Uint8Array(this.buffer,this.position,t));return i.stringTable=this.stringTable,i.version=this.version,this.position+=t,i},e.prototype.seek=function(t,e){var i,n=this.position;return this.position=t,e<this.readByte()?(1==this.readByte()?(this.position+=2*e,i=this.readUnsignedShort()):(this.position+=4*e,i=this.readUnsignedInt()),i>0?(this.position=t+i,!0):(this.position=n,!1)):(this.position=n,!1)},e}(egret.ByteArray);t.ByteBuffer=e}(fgui||(fgui={})),function(t){var e=function(){function t(t,e,i,o){this.matrix=new Array(n),this.reset(),void 0===t&&void 0===e&&void 0===i&&void 0===o||this.adjustColor(t,e,i,o)}return t.prototype.reset=function(){for(var t=0;t<n;t++)this.matrix[t]=i[t]},t.prototype.invert=function(){this.multiplyMatrix([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0])},t.prototype.adjustColor=function(t,e,i,n){this.adjustHue(n||0),this.adjustContrast(e||0),this.adjustBrightness(t||0),this.adjustSaturation(i||0)},t.prototype.adjustBrightness=function(t){t=255*this.cleanValue(t,1),this.multiplyMatrix([1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0])},t.prototype.adjustContrast=function(t){var e=(t=this.cleanValue(t,1))+1,i=128*(1-e);this.multiplyMatrix([e,0,0,0,i,0,e,0,0,i,0,0,e,0,i,0,0,0,1,0])},t.prototype.adjustSaturation=function(t){t=this.cleanValue(t,1);var e=1-(t+=1),i=e*o,n=e*r,a=e*s;this.multiplyMatrix([i+t,n,a,0,0,i,n+t,a,0,0,i,n,a+t,0,0,0,0,0,1,0])},t.prototype.adjustHue=function(t){t=this.cleanValue(t,1),t*=Math.PI;var e=Math.cos(t),i=Math.sin(t);this.multiplyMatrix([o+e*(1-o)+i*-o,r+e*-r+i*-r,s+e*-s+i*(1-s),0,0,o+e*-o+.143*i,r+e*(1-r)+.14*i,s+e*-s+-.283*i,0,0,o+e*-o+i*-(1-o),r+e*-r+i*r,s+e*(1-s)+i*s,0,0,0,0,0,1,0])},t.prototype.concat=function(t){t.length==n&&this.multiplyMatrix(t)},t.prototype.clone=function(){var e=new t;return e.copyMatrix(this.matrix),e},t.prototype.copyMatrix=function(t){for(var e=n,i=0;i<e;i++)this.matrix[i]=t[i]},t.prototype.multiplyMatrix=function(t){for(var e=[],i=0,n=0;n<4;++n){for(var o=0;o<5;++o)e[i+o]=t[i]*this.matrix[o]+t[i+1]*this.matrix[o+5]+t[i+2]*this.matrix[o+10]+t[i+3]*this.matrix[o+15]+(4==o?t[i+4]:0);i+=5}this.copyMatrix(e)},t.prototype.cleanValue=function(t,e){return Math.min(e,Math.max(-e,t))},t}();t.ColorMatrix=e;var i=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],n=i.length,o=.299,r=.587,s=.114}(fgui||(fgui={})),function(t){var e=function(){function t(){this._enumI=0,this._enumCount=0,this._lastTime=0,this._items=new Array,this._itemPool=new Array,this._lastTime=egret.getTimer(),t.time=this._lastTime,egret.startTick(this.__timer,this)}return t.prototype.getItem=function(){return this._itemPool.length?this._itemPool.pop():new i},t.prototype.findItem=function(t,e){for(var i=this._items.length,n=0;n<i;n++){var o=this._items[n];if(o.callback==t&&o.thisObj==e)return o}return null},t.prototype.add=function(t,e,i,n,o){var r=this.findItem(i,n);r||((r=this.getItem()).callback=i,r.hasParam=1==i.length,r.thisObj=n,this._items.push(r)),r.delay=t,r.counter=0,r.repeat=e,r.param=o,r.end=!1},t.prototype.callLater=function(t,e,i){this.add(1,1,t,e,i)},t.prototype.callDelay=function(t,e,i,n){this.add(t,1,e,i,n)},t.prototype.exists=function(t,e){return null!=this.findItem(t,e)},t.prototype.remove=function(t,e){var i=this.findItem(t,e);if(i){var n=this._items.indexOf(i);this._items.splice(n,1),n<this._enumI&&this._enumI--,this._enumCount--,i.reset(),this._itemPool.push(i)}},t.prototype.__timer=function(e){for(t.time=e,t.deltaTime=e-this._lastTime,this._lastTime=e,this._enumI=0,this._enumCount=this._items.length;this._enumI<this._enumCount;){var i=this._items[this._enumI];this._enumI++,i.advance(t.deltaTime)&&(i.end&&(this._enumI--,this._enumCount--,this._items.splice(this._enumI,1)),i.hasParam?i.callback.call(i.thisObj,i.param):i.callback.call(i.thisObj),i.end&&(i.reset(),this._itemPool.push(i)))}return!1},t.deltaTime=0,t.time=0,t.inst=new t,t}();t.GTimers=e;var i=function(){function t(){this.delay=0,this.counter=0,this.repeat=0}return t.prototype.advance=function(t){return this.counter+=t,this.counter>=this.delay&&(this.counter-=this.delay,this.counter>this.delay&&(this.counter=this.delay),this.repeat>0&&(this.repeat--,0==this.repeat&&(this.end=!0)),!0)},t.prototype.reset=function(){this.callback=null,this.thisObj=null,this.param=null},t}()}(fgui||(fgui={})),function(t){var e=function(){function t(){this._readPos=0,this.smallFontSize=12,this.normalFontSize=14,this.largeFontSize=16,this.defaultImgWidth=0,this.defaultImgHeight=0,this._handlers={},this._handlers.url=this.onTag_URL,this._handlers.img=this.onTag_IMG,this._handlers.b=this.onTag_Simple,this._handlers.i=this.onTag_Simple,this._handlers.u=this.onTag_Simple,this._handlers.sup=this.onTag_Simple,this._handlers.sub=this.onTag_Simple,this._handlers.color=this.onTag_COLOR,this._handlers.font=this.onTag_FONT,this._handlers.size=this.onTag_SIZE}return t.prototype.onTag_URL=function(t,e,i){return e?"</a>":null!=i?'<a href="'+i+'" target="_blank">':'<a href="'+this.getTagText()+'" target="_blank">'},t.prototype.onTag_IMG=function(t,e,i){if(e)return null;var n=this.getTagText(!0);return n?this.defaultImgWidth?'<img src="'+n+'" width="'+this.defaultImgWidth+'" height="'+this.defaultImgHeight+'"/>':'<img src="'+n+'"/>':null},t.prototype.onTag_Simple=function(t,e,i){return e?"</"+t+">":"<"+t+">"},t.prototype.onTag_COLOR=function(t,e,i){return e?"</font>":'<font color="'+i+'">'},t.prototype.onTag_FONT=function(t,e,i){return e?"</font>":'<font face="'+i+'">'},t.prototype.onTag_SIZE=function(t,e,i){return e?"</font>":("normal"==i?i=""+this.normalFontSize:"small"==i?i=""+this.smallFontSize:"large"==i?i=""+this.largeFontSize:i.length&&"+"==i.charAt(0)?i=""+(this.smallFontSize+parseInt(i.substr(1))):i.length&&"-"==i.charAt(0)&&(i=""+(this.smallFontSize-parseInt(i.substr(1)))),'<font size="'+i+'">')},t.prototype.getTagText=function(t){void 0===t&&(t=!1);for(var e,i=this._readPos,n="";-1!=(e=this._text.indexOf("[",i));){if(92!=this._text.charCodeAt(e-1)){n+=this._text.substring(i,e);break}n+=this._text.substring(i,e-1),n+="[",i=e+1}return-1==e?null:(t&&(this._readPos=e),n)},t.prototype.parse=function(t,e){this._text=t;for(var i,n,o,r,s,a,h,l=0,c="";-1!=(i=this._text.indexOf("[",l));)if(i>0&&92==this._text.charCodeAt(i-1))c+=this._text.substring(l,i-1),c+="[",l=i+1;else{if(c+=this._text.substring(l,i),l=i,-1==(i=this._text.indexOf("]",l)))break;o="/"==this._text.charAt(l+1),r=this._text.substring(o?l+2:l+1,i),this._readPos=i+1,s=null,a=null,-1!=(n=r.indexOf("="))&&(s=r.substring(n+1),r=r.substring(0,n)),r=r.toLowerCase(),null!=(h=this._handlers[r])?e||null!=(a=h.call(this,r,o,s))&&(c+=a):c+=this._text.substring(l,this._readPos),l=this._readPos}return l<this._text.length&&(c+=this._text.substr(l)),this._text=null,c},t.inst=new t,t}();t.UBBParser=e}(fgui||(fgui={})),function(t){var e=function(){function e(){}return e.startsWith=function(t,e,i){return!!t&&(!(t.length<e.length)&&(t=t.substring(0,e.length),i?t.toLowerCase()==e.toLowerCase():t==e))},e.trimRight=function(t){for(var e="",i=t.length-1;i>=0&&(" "==(e=t.charAt(i))||"\n"==e||"\r"==e);i--);return t.substring(0,i+1)},e.convertToHtmlColor=function(t,e){var i;i=e?(t>>24&255).toString(16):"";var n=(t>>16&255).toString(16),o=(t>>8&255).toString(16),r=(255&t).toString(16);return 1==i.length&&(i="0"+i),1==n.length&&(n="0"+n),1==o.length&&(o="0"+o),1==r.length&&(r="0"+r),"#"+i+n+o+r},e.convertFromHtmlColor=function(t,e){return t.length<1?0:("#"==t.charAt(0)&&(t=t.substr(1)),8==t.length?(parseInt(t.substr(0,2),16)<<24)+parseInt(t.substr(2),16):e?4278190080+parseInt(t,16):parseInt(t,16))},e.displayObjectToGObject=function(e){for(;e&&!(e instanceof egret.Stage);){if(e.$owner)return t.GObject.cast(e);e=e.parent}return null},e.encodeHTML=function(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""):""},e.clamp=function(t,e,i){return t<e?t=e:t>i&&(t=i),t},e.clamp01=function(t){return t>1?t=1:t<0&&(t=0),t},e.lerp=function(t,e,i){return t+i*(e-t)},e.repeat=function(t,e){return t-Math.floor(t/e)*e},e.distance=function(t,e,i,n){return Math.sqrt(Math.pow(t-i,2)+Math.pow(e-n,2))},e.fillPath=function(t,e,i,n){var o=e.length;t.moveTo(e[0]+i,e[1]+n);for(var r=2;r<o;r+=2)t.lineTo(e[r]+i,e[r+1]+n);t.lineTo(e[0]+i,e[1]+n)},e.setColorFilter=function(e,o){var r,s,a=e.$_colorFilter_,h=e.filters;if("boolean"==typeof o?(r=a?a.$_color_:null,s=o):(r=16777215==o?null:o,s=!!a&&a.$_grayed_),r||0===r||s){if(a||(a=new egret.ColorMatrixFilter,e.$_colorFilter_=a),h)-1==h.indexOf(a)&&h.push(a);else h=[a];e.filters=h,a.$_color_=r,a.$_grayed_=s;var l=a.matrix;if(s)for(var c=0;c<20;c++)l[c]=i[c];else if(r instanceof Array)!function(e,i,o,r,s){s||(s=new Array(t.ColorMatrix.length));n.reset(),n.adjustColor(e,i,o,r),n.matrix.forEach(function(t,e){return s[e]=t})}(r[0],r[1],r[2],r[3],l);else{for(var u=0;u<20;u++)l[u]=0==u||6==u||12==u||18==u?1:0;l[0]=(o>>16&255)/255,l[6]=(o>>8&255)/255,l[12]=(255&o)/255}a.matrix=l}else if(h&&a){var _=h.indexOf(a);-1!=_&&(h.splice(_,1),h.length>0?e.filters=h:e.filters=null)}},e}();t.ToolSet=e;var i=[.3,.6,0,0,0,.3,.6,0,0,0,.3,.6,0,0,0,0,0,0,1,0],n=new t.ColorMatrix}(fgui||(fgui={})); |