dragonbones-runtime
Version:
the tools to build dragonbones file for diffrent framework
6 lines • 184 kB
JavaScript
function __extends(t,e){function r(){this.constructor=t}for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);r.prototype=e.prototype,t.prototype=new r}var __reflect=this&&this.__reflect||function(t,e,r){t.__class__=e,r?r.push(e):r=[e],t.__types__=t.__types__?r.concat(t.__types__):r},__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),__define=this.__define||function(t,e,r,i){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:r,set:i})},egret;!function(t){t.$hashCount=1;var e=function(){function e(){this.$hashCode=t.$hashCount++}return Object.defineProperty(e.prototype,"hashCode",{get:function(){return this.$hashCode},enumerable:!0,configurable:!0}),e}();t.HashObject=e,__reflect(e.prototype,"egret.HashObject",["egret.IHashObject"])}(egret||(egret={}));var egret;!function(t){var e=[],r=function(r){function i(t){void 0===t&&(t=null);var e=r.call(this)||this;return e.$EventDispatcher={0:t?t:e,1:{},2:{},3:0},e}return __extends(i,r),i.prototype.$getEventMap=function(t){var e=this.$EventDispatcher,r=t?e[2]:e[1];return r},i.prototype.addEventListener=function(t,e,r,i,n){this.$addListener(t,e,r,i,n)},i.prototype.once=function(t,e,r,i,n){this.$addListener(t,e,r,i,n,!0)},i.prototype.$addListener=function(t,e,r,i,n,o){var a=this.$EventDispatcher,s=i?a[2]:a[1],h=s[t];h?0!==a[3]&&(s[t]=h=h.concat()):h=s[t]=[],this.$insertEventBin(h,t,e,r,i,n,o)},i.prototype.$insertEventBin=function(t,e,r,i,n,o,a){o=0|+o;for(var s=-1,h=t.length,c=0;h>c;c++){var u=t[c];if(u.listener==r&&u.thisObject==i&&u.target==this)return!1;-1==s&&u.priority<o&&(s=c)}var l={type:e,listener:r,thisObject:i,priority:o,target:this,useCapture:n,dispatchOnce:!!a};return-1!==s?t.splice(s,0,l):t.push(l),!0},i.prototype.removeEventListener=function(t,e,r,i){var n=this.$EventDispatcher,o=i?n[2]:n[1],a=o[t];a&&(0!==n[3]&&(o[t]=a=a.concat()),this.$removeEventBin(a,e,r),0==a.length&&(o[t]=null))},i.prototype.$removeEventBin=function(t,e,r){for(var i=t.length,n=0;i>n;n++){var o=t[n];if(o.listener==e&&o.thisObject==r&&o.target==this)return t.splice(n,1),!0}return!1},i.prototype.hasEventListener=function(t){var e=this.$EventDispatcher;return!(!e[1][t]&&!e[2][t])},i.prototype.willTrigger=function(t){return this.hasEventListener(t)},i.prototype.dispatchEvent=function(t){return t.$currentTarget=this.$EventDispatcher[0],t.$setTarget(t.$currentTarget),this.$notifyListener(t,!1)},i.prototype.$notifyListener=function(t,r){var i=this.$EventDispatcher,n=r?i[2]:i[1],o=n[t.$type];if(!o)return!0;var a=o.length;if(0==a)return!0;var s=e;i[3]++;for(var h=0;a>h;h++){var c=o[h];if(c.listener.call(c.thisObject,t),c.dispatchOnce&&s.push(c),t.$isPropagationImmediateStopped)break}for(i[3]--;s.length;){var c=s.pop();c.target.removeEventListener(c.type,c.listener,c.thisObject,c.useCapture)}return!t.$isDefaultPrevented},i.prototype.dispatchEventWith=function(e,r,i,n){if(r||this.hasEventListener(e)){var o=t.Event.create(t.Event,e,r,n);o.data=i;var a=this.dispatchEvent(o);return t.Event.release(o),a}return!0},i}(t.HashObject);t.EventDispatcher=r,__reflect(r.prototype,"egret.EventDispatcher",["egret.IEventDispatcher"])}(egret||(egret={}));var egret;!function(t){function e(t){return t%=360,t>180?t-=360:-180>t&&(t+=360),t}var r=function(r){function i(){var e=r.call(this)||this;return e.$children=null,e.$name="",e.$parent=null,e.$stage=null,e.$nestLevel=0,e.$useTranslate=!1,e.$matrix=new t.Matrix,e.$matrixDirty=!1,e.$x=0,e.$y=0,e.$scaleX=1,e.$scaleY=1,e.$rotation=0,e.$skewX=0,e.$skewXdeg=0,e.$skewY=0,e.$skewYdeg=0,e.$explicitWidth=0/0,e.$explicitHeight=0/0,e.$anchorOffsetX=0,e.$anchorOffsetY=0,e.$visible=!0,e.$displayList=null,e.$cacheAsBitmap=!1,e.$cacheDirty=!1,e.$alpha=1,e.$touchEnabled=i.defaultTouchEnabled,e.$scrollRect=null,e.$blendMode=0,e.$maskedObject=null,e.$mask=null,e.$maskRect=null,e.$parentDisplayList=null,e.$renderNode=null,e.$renderDirty=!1,e.$renderMode=null,e}return __extends(i,r),Object.defineProperty(i.prototype,"name",{get:function(){return this.$name},set:function(t){this.$name=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this.$parent},enumerable:!0,configurable:!0}),i.prototype.$setParent=function(t){this.$parent=t},i.prototype.$onAddToStage=function(e,r){var i=this;i.$stage=e,i.$nestLevel=r,i.$hasAddToStage=!0,t.Sprite.$EVENT_ADD_TO_STAGE_LIST.push(i)},i.prototype.$onRemoveFromStage=function(){var e=this;e.$nestLevel=0,t.Sprite.$EVENT_REMOVE_FROM_STAGE_LIST.push(e)},i.prototype.$updateUseTransform=function(){var t=this;1==t.$scaleX&&1==t.scaleY&&0==t.$skewX&&0==t.$skewY?t.$useTranslate=!1:t.$useTranslate=!0},Object.defineProperty(i.prototype,"stage",{get:function(){return this.$stage},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"matrix",{get:function(){return this.$getMatrix().clone()},set:function(t){this.$setMatrix(t)},enumerable:!0,configurable:!0}),i.prototype.$getMatrix=function(){var t=this;return t.$matrixDirty&&(t.$matrixDirty=!1,t.$matrix.$updateScaleAndRotation(t.$scaleX,t.$scaleY,t.$skewX,t.$skewY)),t.$matrix.tx=t.$x,t.$matrix.ty=t.$y,t.$matrix},i.prototype.$setMatrix=function(t,r){void 0===r&&(r=!0);var i=this,n=i.$matrix;n.a=t.a,n.b=t.b,n.c=t.c,n.d=t.d,i.$x=t.tx,i.$y=t.ty,i.$matrixDirty=!1,1==n.a&&0==n.b&&0==n.c&&1==n.d?i.$useTranslate=!1:i.$useTranslate=!0,r&&(i.$scaleX=n.$getScaleX(),i.$scaleY=n.$getScaleY(),i.$skewX=t.$getSkewX(),i.$skewY=t.$getSkewY(),i.$skewXdeg=e(180*i.$skewX/Math.PI),i.$skewYdeg=e(180*i.$skewY/Math.PI),i.$rotation=e(180*i.$skewY/Math.PI))},i.prototype.$getConcatenatedMatrix=function(){var e=this,r=e.$concatenatedMatrix;r||(r=e.$concatenatedMatrix=new t.Matrix),e.$parent?e.$parent.$getConcatenatedMatrix().$preMultiplyInto(e.$getMatrix(),r):r.copyFrom(e.$getMatrix());var i=e.$anchorOffsetX,n=e.$anchorOffsetY,o=e.$scrollRect;return o?r.$preMultiplyInto(t.$TempMatrix.setTo(1,0,0,1,-o.x-i,-o.y-n),r):(0!=i||0!=n)&&r.$preMultiplyInto(t.$TempMatrix.setTo(1,0,0,1,-i,-n),r),e.$concatenatedMatrix},i.prototype.$getInvertedConcatenatedMatrix=function(){var e=this;return e.$invertedConcatenatedMatrix||(e.$invertedConcatenatedMatrix=new t.Matrix),e.$getConcatenatedMatrix().$invertInto(e.$invertedConcatenatedMatrix),e.$invertedConcatenatedMatrix},Object.defineProperty(i.prototype,"x",{get:function(){return this.$getX()},set:function(t){this.$setX(t)},enumerable:!0,configurable:!0}),i.prototype.$getX=function(){return this.$x},i.prototype.$setX=function(t){t=+t||0;var e=this;if(e.$x==t)return!1;e.$x=t;var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;return i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp()),!0},Object.defineProperty(i.prototype,"y",{get:function(){return this.$getY()},set:function(t){this.$setY(t)},enumerable:!0,configurable:!0}),i.prototype.$getY=function(){return this.$y},i.prototype.$setY=function(t){t=+t||0;var e=this;if(e.$y==t)return!1;e.$y=t;var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;return i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp()),!0},Object.defineProperty(i.prototype,"scaleX",{get:function(){return this.$getScaleX()},set:function(t){this.$setScaleX(t)},enumerable:!0,configurable:!0}),i.prototype.$getScaleX=function(){return this.$scaleX},i.prototype.$setScaleX=function(t){t=+t||0;var e=this;e.$scaleX=t,e.$matrixDirty=!0,e.$updateUseTransform();var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp())},Object.defineProperty(i.prototype,"scaleY",{get:function(){return this.$getScaleY()},set:function(t){this.$setScaleY(t)},enumerable:!0,configurable:!0}),i.prototype.$getScaleY=function(){return this.$scaleY},i.prototype.$setScaleY=function(t){t=+t||0;var e=this;e.$scaleY=t,e.$matrixDirty=!0,e.$updateUseTransform();var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp())},Object.defineProperty(i.prototype,"rotation",{get:function(){return this.$getRotation()},set:function(t){this.$setRotation(t)},enumerable:!0,configurable:!0}),i.prototype.$getRotation=function(){return this.$rotation},i.prototype.$setRotation=function(t){t=+t||0,t=e(t);var r=this;if(t!=r.$rotation){var i=t-r.$rotation,n=i/180*Math.PI;r.$skewX+=n,r.$skewY+=n,r.$rotation=t,r.$matrixDirty=!0,r.$updateUseTransform();var o=r.$parent;o&&!o.$cacheDirty&&(o.$cacheDirty=!0,o.$cacheDirtyUp());var a=r.$maskedObject;a&&!a.$cacheDirty&&(a.$cacheDirty=!0,a.$cacheDirtyUp())}},Object.defineProperty(i.prototype,"skewX",{get:function(){return this.$skewXdeg},set:function(t){this.$setSkewX(t)},enumerable:!0,configurable:!0}),i.prototype.$setSkewX=function(t){t=+t||0;var r=this;if(t!=r.$skewXdeg){r.$skewXdeg=t,t=e(t),t=t/180*Math.PI,r.$skewX=t,r.$matrixDirty=!0,r.$updateUseTransform();var i=r.$parent;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp());var n=r.$maskedObject;n&&!n.$cacheDirty&&(n.$cacheDirty=!0,n.$cacheDirtyUp())}},Object.defineProperty(i.prototype,"skewY",{get:function(){return this.$skewYdeg},set:function(t){this.$setSkewY(t)},enumerable:!0,configurable:!0}),i.prototype.$setSkewY=function(t){t=+t||0;var r=this;if(t!=r.$skewYdeg){r.$skewYdeg=t,t=e(t),t=t/180*Math.PI,r.$skewY=t,r.$matrixDirty=!0,r.$updateUseTransform();var i=r.$parent;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp());var n=r.$maskedObject;n&&!n.$cacheDirty&&(n.$cacheDirty=!0,n.$cacheDirtyUp())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.$getWidth()},set:function(t){this.$setWidth(t)},enumerable:!0,configurable:!0}),i.prototype.$getWidth=function(){var t=this;return isNaN(t.$explicitWidth)?t.$getOriginalBounds().width:t.$explicitWidth},i.prototype.$setWidth=function(t){t=+t,this.$explicitWidth=isNaN(t)?0/0:t},Object.defineProperty(i.prototype,"height",{get:function(){return this.$getHeight()},set:function(t){this.$setHeight(t)},enumerable:!0,configurable:!0}),i.prototype.$getHeight=function(){var t=this;return isNaN(t.$explicitHeight)?t.$getOriginalBounds().height:t.$explicitHeight},i.prototype.$setHeight=function(t){t=+t,this.$explicitHeight=isNaN(t)?0/0:t},Object.defineProperty(i.prototype,"measuredWidth",{get:function(){return this.$getOriginalBounds().width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"measuredHeight",{get:function(){return this.$getOriginalBounds().height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"anchorOffsetX",{get:function(){return this.$anchorOffsetX},set:function(t){this.$setAnchorOffsetX(t)},enumerable:!0,configurable:!0}),i.prototype.$setAnchorOffsetX=function(t){t=+t||0,this.$anchorOffsetX=t},Object.defineProperty(i.prototype,"anchorOffsetY",{get:function(){return this.$anchorOffsetY},set:function(t){this.$setAnchorOffsetY(t)},enumerable:!0,configurable:!0}),i.prototype.$setAnchorOffsetY=function(t){t=+t||0,this.$anchorOffsetY=t},Object.defineProperty(i.prototype,"visible",{get:function(){return this.$visible},set:function(t){this.$setVisible(t)},enumerable:!0,configurable:!0}),i.prototype.$setVisible=function(t){t=!!t;var e=this;e.$visible=t,e.updateRenderMode();var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp())},Object.defineProperty(i.prototype,"cacheAsBitmap",{get:function(){return this.$cacheAsBitmap},set:function(t){t=!!t;var e=this;e.$cacheAsBitmap=t,e.$setHasDisplayList(t)},enumerable:!0,configurable:!0}),i.prototype.$setHasDisplayList=function(e){var r=this,i=!!r.$displayList;if(i!=e)if(e){var n=t.sys.DisplayList.create(r);n&&(r.$displayList=n,r.$cacheDirty=!0)}else r.$displayList=null},i.prototype.$cacheDirtyUp=function(){var t=this.$parent;t&&!t.$cacheDirty&&(t.$cacheDirty=!0,t.$cacheDirtyUp())},Object.defineProperty(i.prototype,"alpha",{get:function(){return this.$alpha},set:function(t){this.$setAlpha(t)},enumerable:!0,configurable:!0}),i.prototype.$setAlpha=function(t){t=+t||0;var e=this;e.$alpha=t,e.updateRenderMode();var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp())},Object.defineProperty(i.prototype,"touchEnabled",{get:function(){return this.$getTouchEnabled()},set:function(t){this.$setTouchEnabled(t)},enumerable:!0,configurable:!0}),i.prototype.$getTouchEnabled=function(){return this.$touchEnabled},i.prototype.$setTouchEnabled=function(t){this.$touchEnabled=t},Object.defineProperty(i.prototype,"scrollRect",{get:function(){return this.$scrollRect},set:function(t){this.$setScrollRect(t)},enumerable:!0,configurable:!0}),i.prototype.$setScrollRect=function(e){var r=this;return e||r.$scrollRect?(e?(r.$scrollRect||(r.$scrollRect=new t.Rectangle),r.$scrollRect.copyFrom(e)):r.$scrollRect=null,void r.updateRenderMode()):void r.updateRenderMode()},Object.defineProperty(i.prototype,"blendMode",{get:function(){return t.sys.numberToBlendMode(this.$blendMode)},set:function(e){var r=this,i=t.sys.blendModeToNumber(e);r.$blendMode=i,r.updateRenderMode();var n=r.$parent;n&&!n.$cacheDirty&&(n.$cacheDirty=!0,n.$cacheDirtyUp());var o=r.$maskedObject;o&&!o.$cacheDirty&&(o.$cacheDirty=!0,o.$cacheDirtyUp())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"mask",{get:function(){var t=this;return t.$mask?t.$mask:t.$maskRect},set:function(t){var e=this;if(t!==e){if(t)if(t instanceof i){if(t==e.$mask)return;t.$maskedObject&&(t.$maskedObject.mask=null),t.$maskedObject=e,e.$mask=t,t.updateRenderMode(),e.$maskRect=null}else e.$setMaskRect(t),e.$mask&&(e.$mask.$maskedObject=null,e.$mask.updateRenderMode()),e.$mask=null;else e.$mask&&(e.$mask.$maskedObject=null,e.$mask.updateRenderMode()),e.$mask=null,e.$maskRect=null;e.updateRenderMode()}},enumerable:!0,configurable:!0}),i.prototype.$setMaskRect=function(e){var r=this;(e||r.$maskRect)&&(e?(r.$maskRect||(r.$maskRect=new t.Rectangle),r.$maskRect.copyFrom(e)):r.$maskRect=null)},Object.defineProperty(i.prototype,"filters",{get:function(){return this.$filters},set:function(t){var e=this;e.$filters=t,e.updateRenderMode()},enumerable:!0,configurable:!0}),i.prototype.getTransformedBounds=function(t,e){return t=t||this,this.$getTransformedBounds(t,e)},i.prototype.getBounds=function(t,e){void 0===e&&(e=!0);var r=this;return t=r.$getTransformedBounds(r,t),e&&(0!=r.$anchorOffsetX&&(t.x-=r.$anchorOffsetX),0!=r.$anchorOffsetY&&(t.y-=r.$anchorOffsetY)),t},i.prototype.$getTransformedBounds=function(e,r){var i=this,n=i.$getOriginalBounds();if(r||(r=new t.Rectangle),r.copyFrom(n),e==i)return r;var o;if(e){o=t.$TempMatrix;var a=e.$getInvertedConcatenatedMatrix();a.$preMultiplyInto(i.$getConcatenatedMatrix(),o)}else o=i.$getConcatenatedMatrix();return o.$transformBounds(r),r},i.prototype.globalToLocal=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0);var i=this.$getInvertedConcatenatedMatrix();return i.transformPoint(t,e,r)},i.prototype.localToGlobal=function(t,e,r){void 0===t&&(t=0),void 0===e&&(e=0);var i=this.$getConcatenatedMatrix();return i.transformPoint(t,e,r)},i.prototype.$getOriginalBounds=function(){var t=this,e=t.$getContentBounds();t.$measureChildBounds(e);var r=t.$measureFiltersOffset(!1);return r&&(e.x+=r.minX,e.y+=r.minY,e.width+=-r.minX+r.maxX,e.height+=-r.minY+r.maxY),e},i.prototype.$measureChildBounds=function(t){},i.prototype.$getContentBounds=function(){var e=t.$TempRectangle;return e.setEmpty(),this.$measureContentBounds(e),e},i.prototype.$measureContentBounds=function(t){},i.prototype.$getRenderNode=function(){var t=this,e=t.$renderNode;return e?(t.$renderDirty&&(e.cleanBeforeRender(),t.$updateRenderNode(),t.$renderDirty=!1,e=t.$renderNode),e):null},i.prototype.updateRenderMode=function(){var t=this;!t.$visible||t.$alpha<=0||t.$maskedObject?t.$renderMode=1:t.filters&&t.filters.length>0?t.$renderMode=2:0!==t.$blendMode||t.$mask?t.$renderMode=3:t.$scrollRect||t.$maskRect?t.$renderMode=4:t.$renderMode=null},i.prototype.$measureFiltersOffset=function(e){for(var r=this,i=0,n=0,o=0,a=0;r;){var s=r.$filters;if(s&&s.length)for(var h=s.length,c=0;h>c;c++){var u=s[c];if("blur"==u.type){var l=u.blurX,p=u.blurY;i-=l,n-=p,o+=l,a+=p}else if("glow"==u.type){var l=u.blurX,p=u.blurY;i-=l,n-=p,o+=l,a+=p;var d=u.distance||0,f=u.angle||0,g=0,$=0;0!=d&&(g=d*t.NumberUtils.cos(f),g=g>0?Math.ceil(g):Math.floor(g),$=d*t.NumberUtils.sin(f),$=$>0?Math.ceil($):Math.floor($),i+=g,o+=g,n+=$,a+=$)}else if("custom"==u.type){var y=u.padding;i-=y,n-=y,o+=y,a+=y}}r=e?r.$parent:null}return i=Math.min(i,0),n=Math.min(n,0),o=Math.max(o,0),a=Math.max(a,0),{minX:i,minY:n,maxX:o,maxY:a}},i.prototype.$getConcatenatedMatrixAt=function(e,r){var i=e.$getInvertedConcatenatedMatrix();if(0===i.a||0===i.d){var n=this,o=e.$nestLevel;for(r.identity();n.$nestLevel>o;){var a=n.$scrollRect;a&&r.concat(t.$TempMatrix.setTo(1,0,0,1,-a.x,-a.y)),r.concat(n.$getMatrix()),n=n.$parent}}else i.$preMultiplyInto(r,r)},i.prototype.$updateRenderNode=function(){},i.prototype.$hitTest=function(t,e){var r=this;if(!r.$renderNode||!r.$visible||0==r.$scaleX||0==r.$scaleY)return null;var i=r.$getInvertedConcatenatedMatrix();if(0==i.a&&0==i.b&&0==i.c&&0==i.d)return null;var n=r.$getContentBounds(),o=i.a*t+i.c*e+i.tx,a=i.b*t+i.d*e+i.ty;if(n.contains(o,a)){if(!r.$children){var s=r.$scrollRect?r.$scrollRect:r.$maskRect;if(s&&!s.contains(o,a))return null;if(r.$mask&&!r.$mask.$hitTest(t,e))return null}return r}return null},i.prototype.hitTestPoint=function(e,r,i){var n=this;if(i){var o=n.$getInvertedConcatenatedMatrix(),a=o.a*e+o.c*r+o.tx,s=o.b*e+o.d*r+o.ty,h=void 0,c=n.$displayList;if(c){var u=c.renderBuffer;try{h=u.getPixels(a-c.offsetX,s-c.offsetY)}catch(l){throw new Error(t.sys.tr(1039))}}else{var u=t.sys.customHitTestBuffer;u.resize(3,3);var p=t.Matrix.create();p.identity(),p.translate(1-a,1-s),t.sys.systemRenderer.render(this,u,p,!0),t.Matrix.release(p);try{h=u.getPixels(1,1)}catch(l){throw new Error(t.sys.tr(1039))}}return 0===h[3]?!1:!0}if(0==n.$scaleX||0==n.$scaleY)return!1;var o=n.$getInvertedConcatenatedMatrix(),d=n.getBounds(null,!1),a=o.a*e+o.c*r+o.tx,s=o.b*e+o.d*r+o.ty;if(d.contains(a,s)){var f=n.$scrollRect?n.$scrollRect:n.$maskRect;return f&&!f.contains(a,s)?!1:!0}return!1},i.prototype.$addListener=function(e,n,o,a,s,h){r.prototype.$addListener.call(this,e,n,o,a,s,h);var c=e==t.Event.ENTER_FRAME;if(c||e==t.Event.RENDER){var u=c?i.$enterFrameCallBackList:i.$renderCallBackList;-1==u.indexOf(this)&&u.push(this)}},i.prototype.removeEventListener=function(e,n,o,a){r.prototype.removeEventListener.call(this,e,n,o,a);var s=e==t.Event.ENTER_FRAME;if((s||e==t.Event.RENDER)&&!this.hasEventListener(e)){var h=s?i.$enterFrameCallBackList:i.$renderCallBackList,c=h.indexOf(this);-1!==c&&h.splice(c,1)}},i.prototype.dispatchEvent=function(t){if(!t.$bubbles)return r.prototype.dispatchEvent.call(this,t);var e=this.$getPropagationList(this),i=.5*e.length;return t.$setTarget(this),this.$dispatchPropagationEvent(t,e,i),!t.$isDefaultPrevented},i.prototype.$getPropagationList=function(t){for(var e=[];t;)e.push(t),t=t.$parent;var r=e.concat();return r.reverse(),e=r.concat(e)},i.prototype.$dispatchPropagationEvent=function(t,e,r){for(var i=e.length,n=r-1,o=0;i>o;o++){var a=e[o];if(t.$currentTarget=a,n>o?t.$eventPhase=1:o==r||o==n?t.$eventPhase=2:t.$eventPhase=3,a.$notifyListener(t,r>o),t.$isPropagationStopped||t.$isPropagationImmediateStopped)return}},i.prototype.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.$parent}return!1},i.defaultTouchEnabled=!1,i.$enterFrameCallBackList=[],i.$renderCallBackList=[],i}(t.EventDispatcher);t.DisplayObject=r,__reflect(r.prototype,"egret.DisplayObject")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=null,e.$uniforms={},e}return __extends(e,t),e.prototype.$toJson=function(){return""},e}(t.HashObject);t.Filter=e,__reflect(e.prototype,"egret.Filter")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var t=e.call(this)||this;return t.$touchChildren=!0,t.$children=[],t}return __extends(r,e),Object.defineProperty(r.prototype,"numChildren",{get:function(){return this.$children.length},enumerable:!0,configurable:!0}),r.prototype.addChild=function(t){var e=this.$children.length;return t.$parent==this&&e--,this.$doAddChild(t,e)},r.prototype.addChildAt=function(t,e){return e=0|+e,(0>e||e>=this.$children.length)&&(e=this.$children.length,t.$parent==this&&e--),this.$doAddChild(t,e)},r.prototype.$doAddChild=function(e,i,n){void 0===n&&(n=!0);var o=this,a=e.$parent;if(a==o)return o.doSetChildIndex(e,i),e;a&&a.removeChild(e),o.$children.splice(i,0,e),e.$setParent(o);var s=o.$stage;if(s&&e.$onAddToStage(s,o.$nestLevel+1),n&&e.dispatchEventWith(t.Event.ADDED,!0),s)for(var h=r.$EVENT_ADD_TO_STAGE_LIST;h.length;){var c=h.shift();c.$stage&&n&&c.dispatchEventWith(t.Event.ADDED_TO_STAGE)}if(!o.$cacheDirty){o.$cacheDirty=!0;var u=o.$parent;u&&!u.$cacheDirty&&(u.$cacheDirty=!0,u.$cacheDirtyUp());var l=o.$maskedObject;l&&!l.$cacheDirty&&(l.$cacheDirty=!0,l.$cacheDirtyUp())}return this.$childAdded(e,i),e},r.prototype.contains=function(t){for(;t;){if(t==this)return!0;t=t.$parent}return!1},r.prototype.getChildAt=function(t){return t=0|+t,t>=0&&t<this.$children.length?this.$children[t]:null},r.prototype.getChildIndex=function(t){return this.$children.indexOf(t)},r.prototype.getChildByName=function(t){for(var e,r=this.$children,i=r.length,n=0;i>n;n++)if(e=r[n],e.name==t)return e;return null},r.prototype.removeChild=function(t){var e=this.$children.indexOf(t);return e>=0?this.$doRemoveChild(e):null},r.prototype.removeChildAt=function(t){return t=0|+t,t>=0&&t<this.$children.length?this.$doRemoveChild(t):null},r.prototype.$doRemoveChild=function(e,i){void 0===i&&(i=!0),e=0|+e;var n=this,o=this.$children,a=o[e];if(this.$childRemoved(a,e),i&&a.dispatchEventWith(t.Event.REMOVED,!0),this.$stage){a.$onRemoveFromStage();for(var s=r.$EVENT_REMOVE_FROM_STAGE_LIST;s.length>0;){var h=s.shift();i&&h.$hasAddToStage&&(h.$hasAddToStage=!1,h.dispatchEventWith(t.Event.REMOVED_FROM_STAGE)),h.$hasAddToStage=!1,h.$stage=null}}this.$displayList||this.$parentDisplayList;a.$setParent(null);var c=o.indexOf(a);if(-1!=c&&o.splice(c,1),!n.$cacheDirty){n.$cacheDirty=!0;var u=n.$parent;u&&!u.$cacheDirty&&(u.$cacheDirty=!0,u.$cacheDirtyUp());var l=n.$maskedObject;l&&!l.$cacheDirty&&(l.$cacheDirty=!0,l.$cacheDirtyUp())}return a},r.prototype.setChildIndex=function(t,e){e=0|+e,(0>e||e>=this.$children.length)&&(e=this.$children.length-1),this.doSetChildIndex(t,e)},r.prototype.doSetChildIndex=function(t,e){var r=this,i=this.$children.indexOf(t);if(i!=e&&(this.$childRemoved(t,i),this.$children.splice(i,1),this.$children.splice(e,0,t),this.$childAdded(t,e),!r.$cacheDirty)){r.$cacheDirty=!0;var n=r.$parent;n&&!n.$cacheDirty&&(n.$cacheDirty=!0,n.$cacheDirtyUp());var o=r.$maskedObject;o&&!o.$cacheDirty&&(o.$cacheDirty=!0,o.$cacheDirtyUp())}},r.prototype.swapChildrenAt=function(t,e){t=0|+t,e=0|+e,t>=0&&t<this.$children.length&&e>=0&&e<this.$children.length&&this.doSwapChildrenAt(t,e)},r.prototype.swapChildren=function(t,e){var r=this.$children.indexOf(t),i=this.$children.indexOf(e);-1==r||-1==i||this.doSwapChildrenAt(r,i)},r.prototype.doSwapChildrenAt=function(t,e){var r=this;if(t>e){var i=e;e=t,t=i}else if(t==e)return;var n=this.$children,o=n[t],a=n[e];if(this.$childRemoved(o,t),this.$childRemoved(a,e),n[t]=a,n[e]=o,this.$childAdded(a,t),this.$childAdded(o,e),!r.$cacheDirty){r.$cacheDirty=!0;var s=r.$parent;s&&!s.$cacheDirty&&(s.$cacheDirty=!0,s.$cacheDirtyUp());var h=r.$maskedObject;h&&!h.$cacheDirty&&(h.$cacheDirty=!0,h.$cacheDirtyUp())}},r.prototype.removeChildren=function(){for(var t=this.$children,e=t.length-1;e>=0;e--)this.$doRemoveChild(e)},r.prototype.$childAdded=function(t,e){},r.prototype.$childRemoved=function(t,e){},r.prototype.$onAddToStage=function(t,r){e.prototype.$onAddToStage.call(this,t,r);var i=this.$children,n=i.length;r++;for(var o=0;n>o;o++){var a=this.$children[o];a.$onAddToStage(t,r)}},r.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this);for(var t=this.$children,r=t.length,i=0;r>i;i++){var n=t[i];n.$onRemoveFromStage()}},r.prototype.$measureChildBounds=function(e){var r=this.$children,i=r.length;if(0!=i){for(var n=0,o=0,a=0,s=0,h=!1,c=-1;i>c;c++){var u=-1==c?e:r[c].$getTransformedBounds(this,t.$TempRectangle);u.isEmpty()||(h?(n=Math.min(n,u.x),o=Math.max(o,u.x+u.width),a=Math.min(a,u.y),s=Math.max(s,u.y+u.height)):(h=!0,n=u.x,o=n+u.width,a=u.y,s=a+u.height))}e.setTo(n,a,o-n,s-a)}},Object.defineProperty(r.prototype,"touchChildren",{get:function(){return this.$getTouchChildren()},set:function(t){this.$setTouchChildren(!!t)},enumerable:!0,configurable:!0}),r.prototype.$getTouchChildren=function(){return this.$touchChildren},r.prototype.$setTouchChildren=function(t){return this.$touchChildren==t?!1:(this.$touchChildren=t,!0)},r.prototype.$hitTest=function(t,r){if(!this.$visible)return null;var i=this.$getInvertedConcatenatedMatrix(),n=i.a*t+i.c*r+i.tx,o=i.b*t+i.d*r+i.ty,a=this.$scrollRect?this.$scrollRect:this.$maskRect;if(a&&!a.contains(n,o))return null;if(this.$mask&&!this.$mask.$hitTest(t,r))return null;for(var s=this.$children,h=!1,c=null,u=s.length-1;u>=0;u--){var l=s[u];if(!l.$maskedObject&&(c=l.$hitTest(t,r))){if(h=!0,c.$touchEnabled)break;c=null}}return c?this.$touchChildren?c:this:h?this:e.prototype.$hitTest.call(this,t,r)},r.$EVENT_ADD_TO_STAGE_LIST=[],r.$EVENT_REMOVE_FROM_STAGE_LIST=[],r}(t.DisplayObject);t.DisplayObjectContainer=e,__reflect(e.prototype,"egret.DisplayObjectContainer")}(egret||(egret={}));var egret;!function(t){t.$locale_strings=t.$locale_strings||{},t.$language="en_US"}(egret||(egret={})),function(t){var e;!function(e){function r(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var n=t.$locale_strings[t.$language][e];if(!n)return"{"+e+"}";for(var o=r.length,a=0;o>a;a++)n=n.replace("{"+a+"}",r[a]);return n}e.tr=r}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){t.$TextureScaleFactor=1;var e=function(e){function r(){var t=e.call(this)||this;return t.$bitmapX=0,t.$bitmapY=0,t.$bitmapWidth=0,t.$bitmapHeight=0,t.$offsetX=0,t.$offsetY=0,t.$textureWidth=0,t.$textureHeight=0,t.$sourceWidth=0,t.$sourceHeight=0,t.$bitmapData=null,t.$rotated=!1,t}return __extends(r,e),Object.defineProperty(r.prototype,"textureWidth",{get:function(){return this.$getTextureWidth()},enumerable:!0,configurable:!0}),r.prototype.$getTextureWidth=function(){return this.$textureWidth},Object.defineProperty(r.prototype,"textureHeight",{get:function(){return this.$getTextureHeight()},enumerable:!0,configurable:!0}),r.prototype.$getTextureHeight=function(){return this.$textureHeight},r.prototype.$getScaleBitmapWidth=function(){return this.$bitmapWidth*t.$TextureScaleFactor},r.prototype.$getScaleBitmapHeight=function(){return this.$bitmapHeight*t.$TextureScaleFactor},Object.defineProperty(r.prototype,"bitmapData",{get:function(){return this.$bitmapData},set:function(t){this._setBitmapData(t)},enumerable:!0,configurable:!0}),r.prototype._setBitmapData=function(e){this.$bitmapData=e;var r=t.$TextureScaleFactor,i=e.width*r,n=e.height*r;this.$initData(0,0,i,n,0,0,i,n,e.width,e.height)},r.prototype.$initData=function(e,r,i,n,o,a,s,h,c,u,l){void 0===l&&(l=!1);var p=t.$TextureScaleFactor;this.$bitmapX=e/p,this.$bitmapY=r/p,this.$bitmapWidth=i/p,this.$bitmapHeight=n/p,this.$offsetX=o,this.$offsetY=a,this.$textureWidth=s,this.$textureHeight=h,this.$sourceWidth=c,this.$sourceHeight=u,this.$rotated=l,t.BitmapData.$invalidate(this.$bitmapData)},r.prototype.getPixel32=function(t,e){throw new Error},r.prototype.getPixels=function(t,e,r,i){throw void 0===r&&(r=1),void 0===i&&(i=1),new Error},r.prototype.toDataURL=function(t,e,r){throw new Error},r.prototype.saveToFile=function(t,e,r){throw new Error},r.prototype.dispose=function(){this.$bitmapData&&(this.$bitmapData.$dispose(),this.$bitmapData=null)},r}(t.HashObject);t.Texture=e,__reflect(e.prototype,"egret.Texture")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(r){var i=e.call(this)||this;return i._bitmapX=0,i._bitmapY=0,i._textureMap=t.createMap(),i.$texture=r,i._bitmapX=r.$bitmapX-r.$offsetX,i._bitmapY=r.$bitmapY-r.$offsetY,i}return __extends(r,e),r.prototype.getTexture=function(t){return this._textureMap[t]},r.prototype.createTexture=function(e,r,i,n,o,a,s,h,c){void 0===a&&(a=0),void 0===s&&(s=0),void 0===h&&(h=a+n),void 0===c&&(c=s+o);var u=new t.Texture;return u.$bitmapData=this.$texture.$bitmapData,u.$initData(this._bitmapX+r,this._bitmapY+i,n,o,a,s,h,c,this.$texture.$sourceWidth,this.$texture.$sourceHeight),this._textureMap[e]=u,u},r.prototype.dispose=function(){this.$texture&&this.$texture.dispose()},r}(t.HashObject);t.SpriteSheet=e,__reflect(e.prototype,"egret.SpriteSheet")}(egret||(egret={}));var egret;!function(t){var e=[],r=Math.PI/180,i=function(i){function n(t,e){void 0===t&&(t=0),void 0===e&&(e=0);var r=i.call(this)||this;return r.x=t,r.y=e,r}return __extends(n,i),n.release=function(t){t&&e.push(t)},n.create=function(t,r){var i=e.pop();return i||(i=new n),i.setTo(t,r)},Object.defineProperty(n.prototype,"length",{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},enumerable:!0,configurable:!0}),n.prototype.setTo=function(t,e){return this.x=t,this.y=e,this},n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.equals=function(t){return this.x==t.x&&this.y==t.y},n.distance=function(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))},n.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},n.prototype.add=function(t){return new n(this.x+t.x,this.y+t.y)},n.interpolate=function(t,e,r){var i=1-r;return new n(t.x*r+e.x*i,t.y*r+e.y*i)},n.prototype.normalize=function(t){if(0!=this.x||0!=this.y){var e=t/this.length;this.x*=e,this.y*=e}},n.prototype.offset=function(t,e){this.x+=t,this.y+=e},n.polar=function(e,i){return new n(e*t.NumberUtils.cos(i/r),e*t.NumberUtils.sin(i/r))},n.prototype.subtract=function(t){return new n(this.x-t.x,this.y-t.y)},n.prototype.toString=function(){return"(x="+this.x+", y="+this.y+")"},n}(t.HashObject);t.Point=i,__reflect(i.prototype,"egret.Point"),t.$TempPoint=new i}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var r=e.call(this)||this;return r.$graphics=new t.Graphics,r.$graphics.$setTarget(r),r}return __extends(r,e),Object.defineProperty(r.prototype,"graphics",{get:function(){return this.$graphics},enumerable:!0,configurable:!0}),r.prototype.$hitTest=function(e,r){if(!this.$visible)return null;var i=this.$getInvertedConcatenatedMatrix(),n=i.a*e+i.c*r+i.tx,o=i.b*e+i.d*r+i.ty,a=this.$scrollRect?this.$scrollRect:this.$maskRect;if(a&&!a.contains(n,o))return null;if(this.$mask&&!this.$mask.$hitTest(e,r))return null;for(var s=this.$children,h=!1,c=null,u=s.length-1;u>=0;u--){var l=s[u];if(!l.$maskedObject&&(c=l.$hitTest(e,r))){if(h=!0,c.$touchEnabled)break;c=null}}return c?this.$touchChildren?c:this:h?this:(c=t.DisplayObject.prototype.$hitTest.call(this,e,r),c&&(c=this.$graphics.$hitTest(e,r)),c)},r.prototype.$measureContentBounds=function(t){this.$graphics.$measureContentBounds(t)},r.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),this.$graphics&&this.$graphics.$onRemoveFromStage()},r}(t.DisplayObjectContainer);t.Sprite=e,__reflect(e.prototype,"egret.Sprite")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,r,i,n,o,a,s,h){void 0===e&&(e=16711680),void 0===r&&(r=1),void 0===i&&(i=6),void 0===n&&(n=6),void 0===o&&(o=2),void 0===a&&(a=1),void 0===s&&(s=!1),void 0===h&&(h=!1);var c=t.call(this)||this;return c.type="glow",c.$color=e,c.$blue=255&e,c.$green=(65280&e)>>8,c.$red=e>>16,c.$alpha=r,c.$blurX=i,c.$blurY=n,c.$strength=o,c.$quality=a,c.$inner=s,c.$knockout=h,c.$uniforms.color={x:c.$red/255,y:c.$green/255,z:c.$blue/255,w:1},c.$uniforms.alpha=r,c.$uniforms.blurX=i,c.$uniforms.blurY=n,c.$uniforms.strength=o,c.$uniforms.inner=s?1:0,c.$uniforms.knockout=h?0:1,c.$uniforms.dist=0,c.$uniforms.angle=0,c.$uniforms.hideObject=0,c
}return __extends(e,t),Object.defineProperty(e.prototype,"color",{get:function(){return this.$color},set:function(t){this.$color!=t&&(this.$color=t,this.$blue=255&t,this.$green=(65280&t)>>8,this.$red=t>>16,this.$uniforms.color.x=this.$red/255,this.$uniforms.color.y=this.$green/255,this.$uniforms.color.z=this.$blue/255)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alpha",{get:function(){return this.$alpha},set:function(t){this.$alpha!=t&&(this.$alpha=t,this.$uniforms.alpha=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.$blurX},set:function(t){this.$blurX!=t&&(this.$blurX=t,this.$uniforms.blurX=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.$blurY},set:function(t){this.$blurY!=t&&(this.$blurY=t,this.$uniforms.blurY=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"strength",{get:function(){return this.$strength},set:function(t){this.$strength!=t&&(this.$strength=t,this.$uniforms.strength=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quality",{get:function(){return this.$quality},set:function(t){this.$quality!=t&&(this.$quality=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inner",{get:function(){return this.$inner},set:function(t){this.$inner!=t&&(this.$inner=t,this.$uniforms.inner=t?1:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"knockout",{get:function(){return this.$knockout},set:function(t){this.$knockout!=t&&(this.$knockout=t,this.$uniforms.knockout=t?0:1)},enumerable:!0,configurable:!0}),e.prototype.$toJson=function(){return'{"color": '+this.$color+', "red": '+this.$red+', "green": '+this.$green+', "blue": '+this.$blue+', "alpha": '+this.$alpha+', "blurX": '+this.$blurX+', "blurY": '+this.blurY+', "strength": '+this.$strength+', "quality": '+this.$quality+', "inner": '+this.$inner+', "knockout": '+this.$knockout+"}"},e}(t.Filter);t.GlowFilter=e,__reflect(e.prototype,"egret.GlowFilter")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,r,i,n){var o=t.call(this)||this;return o.$eventPhase=2,o.$currentTarget=null,o.$target=null,o.$isDefaultPrevented=!1,o.$isPropagationStopped=!1,o.$isPropagationImmediateStopped=!1,o.$type=e,o.$bubbles=!!r,o.$cancelable=!!i,o.data=n,o}return __extends(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return this.$type},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bubbles",{get:function(){return this.$bubbles},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cancelable",{get:function(){return this.$cancelable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventPhase",{get:function(){return this.$eventPhase},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTarget",{get:function(){return this.$currentTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){return this.$target},enumerable:!0,configurable:!0}),e.prototype.$setTarget=function(t){return this.$target=t,!0},e.prototype.isDefaultPrevented=function(){return this.$isDefaultPrevented},e.prototype.preventDefault=function(){this.$cancelable&&(this.$isDefaultPrevented=!0)},e.prototype.stopPropagation=function(){this.$bubbles&&(this.$isPropagationStopped=!0)},e.prototype.stopImmediatePropagation=function(){this.$bubbles&&(this.$isPropagationImmediateStopped=!0)},e.prototype.clean=function(){this.data=this.$currentTarget=null,this.$setTarget(null)},e.dispatchEvent=function(t,r,i,n){void 0===i&&(i=!1);var o=e.create(e,r,i),a=e._getPropertyData(e);void 0!=n&&(a.data=n);var s=t.dispatchEvent(o);return e.release(o),s},e._getPropertyData=function(t){var e=t._props;return e||(e=t._props={}),e},e.create=function(t,e,r,i){var n=t.eventPool;if(n||(n=t.eventPool=[]),n.length){var o=n.pop();return o.$type=e,o.$bubbles=!!r,o.$cancelable=!!i,o.$isDefaultPrevented=!1,o.$isPropagationStopped=!1,o.$isPropagationImmediateStopped=!1,o.$eventPhase=2,o}return new t(e,r,i)},e.release=function(t){t.clean();var e=Object.getPrototypeOf(t).constructor;e.eventPool.push(t)},e.ADDED_TO_STAGE="addedToStage",e.REMOVED_FROM_STAGE="removedFromStage",e.ADDED="added",e.REMOVED="removed",e.ENTER_FRAME="enterFrame",e.RENDER="render",e.RESIZE="resize",e.CHANGE="change",e.CHANGING="changing",e.COMPLETE="complete",e.LOOP_COMPLETE="loopComplete",e.FOCUS_IN="focusIn",e.FOCUS_OUT="focusOut",e.ENDED="ended",e.ACTIVATE="activate",e.DEACTIVATE="deactivate",e.CLOSE="close",e.CONNECT="connect",e.LEAVE_STAGE="leaveStage",e.SOUND_COMPLETE="soundComplete",e}(t.HashObject);t.Event=e,__reflect(e.prototype,"egret.Event")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(i){var n=e.call(this)||this;return n.$texture=null,n.$bitmapData=null,n.$bitmapX=0,n.$bitmapY=0,n.$bitmapWidth=0,n.$bitmapHeight=0,n.$offsetX=0,n.$offsetY=0,n.$textureWidth=0,n.$textureHeight=0,n.$sourceWidth=0,n.$sourceHeight=0,n.$smoothing=r.defaultSmoothing,n.$explicitBitmapWidth=0/0,n.$explicitBitmapHeight=0/0,n.$scale9Grid=null,n.$fillMode="scale",n._pixelHitTest=!1,n.$renderNode=new t.sys.NormalBitmapNode,n.$setTexture(i),i&&(n.$renderNode.rotated=i.$rotated),n}return __extends(r,e),r.prototype.$onAddToStage=function(r,i){e.prototype.$onAddToStage.call(this,r,i);var n=this.$texture;n&&t.BitmapData.$addDisplayObject(this,n.$bitmapData)},r.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this);var r=this.$texture;r&&t.BitmapData.$removeDisplayObject(this,r.$bitmapData)},Object.defineProperty(r.prototype,"texture",{get:function(){return this.$texture},set:function(t){var e=this;e.$setTexture(t),t&&e.$renderNode&&(e.$renderNode.rotated=t.$rotated)},enumerable:!0,configurable:!0}),r.prototype.$setTexture=function(e){var r=this,i=r.$texture;if(e==i)return!1;if(r.$texture=e,!e){i&&t.BitmapData.$removeDisplayObject(r,i.$bitmapData),r.setImageData(null,0,0,0,0,0,0,0,0,0,0),r.$renderDirty=!0;var n=r.$parent;n&&!n.$cacheDirty&&(n.$cacheDirty=!0,n.$cacheDirtyUp());var o=r.$maskedObject;return o&&!o.$cacheDirty&&(o.$cacheDirty=!0,o.$cacheDirtyUp()),!0}if(r.$refreshImageData(),r.$stage){if(i){var a=i.$bitmapData.hashCode,s=e.$bitmapData.hashCode;if(a==s){r.$renderDirty=!0;var h=r.$parent;h&&!h.$cacheDirty&&(h.$cacheDirty=!0,h.$cacheDirtyUp());var c=r.$maskedObject;return c&&!c.$cacheDirty&&(c.$cacheDirty=!0,c.$cacheDirtyUp()),!0}t.BitmapData.$removeDisplayObject(r,i.$bitmapData)}t.BitmapData.$addDisplayObject(r,e.$bitmapData)}r.$renderDirty=!0;var u=r.$parent;u&&!u.$cacheDirty&&(u.$cacheDirty=!0,u.$cacheDirtyUp());var l=r.$maskedObject;return l&&!l.$cacheDirty&&(l.$cacheDirty=!0,l.$cacheDirtyUp()),!0},r.prototype.$setBitmapData=function(t){this.$setTexture(t)},r.prototype.$refreshImageData=function(){var t=this.$texture;t&&this.setImageData(t.$bitmapData,t.$bitmapX,t.$bitmapY,t.$bitmapWidth,t.$bitmapHeight,t.$offsetX,t.$offsetY,t.$getTextureWidth(),t.$getTextureHeight(),t.$sourceWidth,t.$sourceHeight)},r.prototype.setImageData=function(t,e,r,i,n,o,a,s,h,c,u){this.$bitmapData=t,this.$bitmapX=e,this.$bitmapY=r,this.$bitmapWidth=i,this.$bitmapHeight=n,this.$offsetX=o,this.$offsetY=a,this.$textureWidth=s,this.$textureHeight=h,this.$sourceWidth=c,this.$sourceHeight=u},Object.defineProperty(r.prototype,"scale9Grid",{get:function(){return this.$scale9Grid},set:function(t){var e=this;e.$scale9Grid=t,e.$renderDirty=!0;var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"fillMode",{get:function(){return this.$fillMode},set:function(t){this.$setFillMode(t)},enumerable:!0,configurable:!0}),r.prototype.$setFillMode=function(t){return t==this.$fillMode?!1:(this.$fillMode=t,!0)},Object.defineProperty(r.prototype,"smoothing",{get:function(){return this.$smoothing},set:function(t){t=!!t,t!=this.$smoothing&&(this.$smoothing=t,this.$renderNode.smoothing=t)},enumerable:!0,configurable:!0}),r.prototype.$setWidth=function(t){var e=this;if(0>t||t==e.$explicitBitmapWidth)return!1;e.$explicitBitmapWidth=t,e.$renderDirty=!0;var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;return i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp()),!0},r.prototype.$setHeight=function(t){var e=this;if(0>t||t==e.$explicitBitmapHeight)return!1;e.$explicitBitmapHeight=t,e.$renderDirty=!0;var r=e.$parent;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp());var i=e.$maskedObject;return i&&!i.$cacheDirty&&(i.$cacheDirty=!0,i.$cacheDirtyUp()),!0},r.prototype.$getWidth=function(){return isNaN(this.$explicitBitmapWidth)?this.$getContentBounds().width:this.$explicitBitmapWidth},r.prototype.$getHeight=function(){return isNaN(this.$explicitBitmapHeight)?this.$getContentBounds().height:this.$explicitBitmapHeight},r.prototype.$measureContentBounds=function(t){if(this.$bitmapData){var e=isNaN(this.$explicitBitmapWidth)?this.$textureWidth:this.$explicitBitmapWidth,r=isNaN(this.$explicitBitmapHeight)?this.$textureHeight:this.$explicitBitmapHeight;t.setTo(0,0,e,r)}else{var e=isNaN(this.$explicitBitmapWidth)?0:this.$explicitBitmapWidth,r=isNaN(this.$explicitBitmapHeight)?0:this.$explicitBitmapHeight;t.setTo(0,0,e,r)}},r.prototype.$updateRenderNode=function(){if(this.$texture){var e=isNaN(this.$explicitBitmapWidth)?this.$textureWidth:this.$explicitBitmapWidth,r=isNaN(this.$explicitBitmapHeight)?this.$textureHeight:this.$explicitBitmapHeight,i=this.scale9Grid||this.$texture.scale9Grid;i?(this.$renderNode instanceof t.sys.NormalBitmapNode&&(this.$renderNode=new t.sys.BitmapNode),t.sys.BitmapNode.$updateTextureDataWithScale9Grid(this.$renderNode,this.$bitmapData,i,this.$bitmapX,this.$bitmapY,this.$bitmapWidth,this.$bitmapHeight,this.$offsetX,this.$offsetY,this.$textureWidth,this.$textureHeight,e,r,this.$sourceWidth,this.$sourceHeight,this.$smoothing)):(this.fillMode==t.BitmapFillMode.REPEAT&&this.$renderNode instanceof t.sys.NormalBitmapNode&&(this.$renderNode=new t.sys.BitmapNode),t.sys.BitmapNode.$updateTextureData(this.$renderNode,this.$bitmapData,this.$bitmapX,this.$bitmapY,this.$bitmapWidth,this.$bitmapHeight,this.$offsetX,this.$offsetY,this.$textureWidth,this.$textureHeight,e,r,this.$sourceWidth,this.$sourceHeight,this.$fillMode,this.$smoothing))}},Object.defineProperty(r.prototype,"pixelHitTest",{get:function(){return this._pixelHitTest},set:function(t){this._pixelHitTest=!!t},enumerable:!0,configurable:!0}),r.prototype.$hitTest=function(t,r){var i=e.prototype.$hitTest.call(this,t,r);return i&&this._pixelHitTest&&(i=this.hitTestPixel(t,r)),i},r.prototype.hitTestPixel=function(e,r){var i,n=this.$getInvertedConcatenatedMatrix(),o=n.a*e+n.c*r+n.tx,a=n.b*e+n.d*r+n.ty,s=this.$displayList;if(s){var h=s.renderBuffer;try{i=h.getPixels(o-s.offsetX,a-s.offsetY)}catch(c){throw console.log(this.$texture),new Error(t.sys.tr(1039))}}else{var h=t.sys.customHitTestBuffer;h.resize(3,3);var u=this.$getRenderNode(),l=t.Matrix.create();l.identity(),l.translate(1-o,1-a),t.sys.systemRenderer.drawNodeToBuffer(u,h,l,!0),t.Matrix.release(l);try{i=h.getPixels(1,1)}catch(c){throw console.log(this.$texture),new Error(t.sys.tr(1039))}}return 0===i[3]?null:this},r.defaultSmoothing=!0,r}(t.DisplayObject);t.Bitmap=e,__reflect(e.prototype,"egret.Bitmap")}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(){function t(){this.type=0,this.drawData=[],this.renderCount=0}return t.prototype.cleanBeforeRender=function(){this.drawData.length=0,this.renderCount=0},t.prototype.$getRenderCount=function(){return this.renderCount},t}();t.RenderNode=e,__reflect(e.prototype,"egret.sys.RenderNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(){function t(){this.type=0,this.$commands=[],this.$data=[],this.commandPosition=0,this.dataPosition=0,this.$lastX=0,this.$lastY=0}return t.prototype.moveTo=function(t,e){this.$commands[this.commandPosition++]=1;var r=this.dataPosition;this.$data[r++]=t,this.$data[r++]=e,this.dataPosition=r},t.prototype.lineTo=function(t,e){this.$commands[this.commandPosition++]=2;var r=this.dataPosition;this.$data[r++]=t,this.$data[r++]=e,this.dataPosition=r},t.prototype.curveTo=function(t,e,r,i){this.$commands[this.commandPosition++]=3;var n=this.dataPosition;this.$data[n++]=t,this.$data[n++]=e,this.$data[n++]=r,this.$data[n++]=i,this.dataPosition=n},t.prototype.cubicCurveTo=function(t,e,r,i,n,o){this.$commands[this.commandPosition++]=4;var a=this.dataPosition;this.$data[a++]=t,this.$data[a++]=e,this.$data[a++]=r,this.$data[a++]=i,this.$data[a++]=n,this.$data[a++]=o,this.dataPosition=a},t.prototype.drawRect=function(t,e,r,i){var n=t+r,o=e+i;this.moveTo(t,e),this.lineTo(n,e),this.lineTo(n,o),this.lineTo(t,o),this.lineTo(t,e)},t.prototype.drawRoundRect=function(t,e,r,i,n,o){var a=.5*n|0,s=o?.5*o|0:a;if(!a||!s)return void this.drawRect(t,e,r,i);var h=.5*r,c=.5*i;if(a>h&&(a=h),s>c&&(s=c),h===a&&c===s)return void(a===s?this.drawCircle(t+a,e+s,a):this.drawEllipse(t,e,2*a,2*s));var u=t+r,l=e+i,p=t+a,d=u-a,f=e+s,g=l-s;this.moveTo(u,g),this.curveTo(u,l,d,l),this.lineTo(p,l),this.curveTo(t,l,t,g),this.lineTo(t,f),this.curveTo(t,e,p,e),this.lineTo(d,e),this.curveTo(u,e,u,f),this.lineTo(u,g)},t.prototype.drawCircle=function(t,e,r){this.arcToBezier(t,e,r,r,0,2*Math.PI)},t.prototype.drawEllipse=function(t,e,r,i){var n=.5*r,o=.5*i;t+=n,e+=o,this.arcToBezier(t,e,n,o,0,2*Math.PI)},t.prototype.drawArc=function(t,e,r,i,n,o){o?n>=i&&(n-=2*Math.PI):i>=n&&(n+=2*Math.PI),this.arcToBezier(t,e,r,r,i,n,o)},t.prototype.arcToBezier=function(t,e,r,i,n,o,a){var s=.5*Math.PI,h=n,c=h;a?(c+=-s-h%s,o>c&&(c=o)):(c+=s-h%s,c>o&&(c=o));var u=t+Math.cos(h)*r,l=e+Math.sin(h)*i;(this.$lastX!=u||this.$lastY!=l)&&this.moveTo(u,l);for(var p=Math.cos(h),d=Math.sin(h),f=0;4>f;f++){var g=c-h,$=4*Math.tan(g/4)/3,y=u-d*$*r,v=l+p*$*i;p=Math.cos(c),d=Math.sin(c),u=t+p*r,l=e+d*i;var m=u+d*$*r,b=l-p*$*i;if(this.cubicCurveTo(y,v,m,b,u,l),c===o)break;h=c,a?(c=h-s,o>c&&(c=o)):(c=h+s,c>o&&(c=o))}},t}();t.Path2D=e,__reflect(e.prototype,"egret.sys.Path2D")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){function e(){var t=Object.create(null);return t.__v8__=void 0,delete t.__v8__,t}t.createMap=e}(egret||(egret={}));var egret;!function(t){function e(){return""}function r(t){throw new Error("#"+t)}function i(){}function n(){}t.getString=e,t.$error=r,t.$warn=i,t.$markCannotUse=n}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var r=e.call(this)||this;return r.$stageWidth=0,r.$stageHeight=0,r.$scaleMode=t.StageScaleMode.SHOW_ALL,r.$orientation=t.OrientationMode.AUTO,r.$maxTouches=99,r.$stage=r,r.$nestLevel=1,r}return __extends(r,e),Object.defineProperty(r.prototype,"frameRate",{get:function(){return t.ticker.$frameRate},set:function(e){t.ticker.$setFrameRate(e)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"stageWidth",{get:function(){return this.$stageWidth},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"stageHeight",{get:function(){return this.$stageHeight},enumerable:!0,configurable:!0}),r.prototype.invalidate=function(){t.sys.$invalidateRenderFlag=!0},r.prototype.registerImplementation=function(e,r){t.registerImplementation(e,r)},r.prototype.getImplementation=function(e){return t.getImplementation(e)},Object.defineProperty(r.prototype,"scaleMode",{get:function(){return this.$scaleMode},set:function(t){this.$scaleMode!=t&&(this.$scaleMode=t,this.$screen.updateScreenSize())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"orientation",{get:function(){return this.$orientation},set:function(t){this.$orientation!=t&&(this.$orientation=t,this.$screen.updateScreenSize())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScaleFactor",{get:function(){return t.$TextureScaleFactor},set:function(e){t.$TextureScaleFactor=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"maxTouches",{get:function(){return this.$maxTouches},set:function(t){this.$maxTouches!=t&&(this.$maxTouches=t,this.$screen.updateMaxTouches())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"dirtyRegionPolicy",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),r.prototype.setContentSize=function(t,e){this.$screen.setContentSize(t,e)},r}(t.DisplayObjectContainer);t.Stage=e,__reflect(e.prototype,"egret.Stage")}(egret||(egret={}));var egret;!function(t){t.CapsStyle={NONE:"none",ROUND:"round",SQUARE:"square"}}(egret||(egret={}));var egret;!function(t){t.DirtyRegionPolicy={OFF:"off",ON:"on"}}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){}return e.compileProgram=function(r,i,n){var o=e.compileFragmentShader(r,n),a=e.compileVertexShader(r,i),s=r.createProgram();return r.attachShader(s,a),r.attachShader(s,o),r.linkProgram(s),r.getProgramParameter(s,r.LINK_STATUS)||t.$warn(1020),s},e.compileFragmentShader=function(t,r){return e._compileShader(t,r,t.FRAGMENT_SHADER)},e.compileVertexShader=function(t,r){return e._compileShader(t,r,t.VERTEX_SHADER)},e._compileShader=function(t,e,r){var i=t.createShader(r);return t.shaderSource(i,e),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:null},e.checkCanUseWebGL=function(){if(void 0==e.canUseWebGL)try{var t=document.createElement("canvas");e.canUseWebGL=!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(r){e.canUseWebGL=!1}return e.canUseWebGL},e.deleteWebGLTexture=function(t){if(t){var e=t.glContext;e&&e.deleteTexture(t)}},e}();t.WebGLUtils=e,__reflect(e.prototype,"egret.WebGLUtils")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),t.call(this,e,r,i)||this}return __extends(e,t),e.FOCUS_IN="focusIn",e.FOCUS_OUT="focusOut",e}(t.Event);t.FocusEvent=e,__reflect(e.prototype,"egret.FocusEvent")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.PERMISSION_DENIED="permissionDenied",e.UNAVAILABLE="unavailable",e}(t.Event);t.GeolocationEvent=e,__reflect(e.prototype,"egret.GeolocationEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i){void 0===r&&(r=!1),void 0===i&&(i=!1);var n=e.call(this,t,r,i)||this;return n._status=0,n}return __extends(r,e),Object.defineProperty(r.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),r.dispatchHTTPStatusEvent=function(e,i){var n=t.Event.create(r,r.HTTP_STATUS);n._status=i;var o=e.dispatchEvent(n);return t.Event.release(n),o},r.HTTP_STATUS="httpStatus",r}(t.Event);t.HTTPStatusEvent=e,__reflect(e.prototype,"egret.HTTPStatusEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),e.call(this,t,r,i)||this}return __extends(r,e),r.dispatchIOErrorEvent=function(e){var i=t.Event.create(r,r.IO_ERROR),n=e.dispatchEvent(i);return t.Event.release(i),n},r.IO_ERROR="ioError",r}(t.Event);t.IOErrorEvent=e,__reflect(e.prototype,"egret.IOErrorEvent")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Event);t.MotionEvent=e,__reflect(e.prototype,"egret.MotionEvent")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Event);t.OrientationEvent=e,__reflect(e.prototype,"egret.OrientationEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i,n,o){void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===n&&(n=0),void 0===o&&(o=0);var a=e.call(this,t,r,i)||this;return a.bytesLoaded=0,a.bytesTotal=0,a.bytesLoaded=n,a.bytesTotal=o,a}return __extends(r,e),r.dispatchProgressEvent=function(e,i,n,o){void 0===n&&(n=0),void 0===o&&(o=0);var a=t.Event.create(r,i);a.bytesLoaded=n,a.bytesTotal=o;var s=e.dispatchEvent(a);return t.Event.release(a),s},r.PROGRESS="progress",r.SOCKET_DATA="socketData",r}(t.Event);t.ProgressEvent=e,__reflect(e.prototype,"egret.ProgressEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i){return void 0===r&&(r=!1),void 0===i&&(i=!1),e.call(this,t,r,i)||this}return __extends(r,e),r.dispatchStageOrientationEvent=function(e,i){var n=t.Event.create(r,i),o=e.dispatchEvent(n);return t.Event.release(n),o},r.ORIENTATION_CHANGE="orientationChange",r}(t.Event);t.StageOrientationEvent=e,__reflect(e.prototype,"egret.StageOrientationEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i,n){void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===n&&(n="");var o=e.call(this,t,r,i)||this;return o.text=n,o}return __extends(r,e),r.dispatchTextEvent=function(e,i,n){var o=t.Event.create(r,i);o.text=n;var a=e.dispatchEvent(o);return t.Event.release(o),a},r.LINK="link",r}(t.Event);t.TextEvent=e,__reflect(e.prototype,"egret.TextEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t,r,i){return e.call(this,t,r,i)||this}return __extends(r,e),r.prototype.updateAfterEvent=function(){t.sys.$requestRenderingFlag=!0},r.dispatchTimerEvent=function(e,i,n,o){var a=t.Event.create(r,i,n,o),s=e.dispatchEvent(a);return t.Event.release(a),s},r.TIMER="timer",r.TIMER_COMPLETE="timerComplete",r}(t.Event);t.TimerEvent=e,__reflect(e.prototype,"egret.TimerEvent")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(t){var r=e.call(this)||this;return r.format="image",r.$deleteSource=!0,r.source=t,r.width=t.width,r.height=t.height,r}return __extends(r,e),r.create=function(e,i,n){if(t.Capabilities.runtimeType===t.RuntimeType.WEB){var o="";o="arraybuffer"===e?t.Base64Util.encode(i):i;var a="image/png";"/"===o.charAt(0)?a="image/jpeg":"R"===o.charAt(0)?a="image/gif":"i"===o.charAt(0)&&(a="image/png");var s=new Image;s.src="data:"+a+";base64,"+o,s.crossOrigin="*";var h=new r(s);return s.onload=function(){s.onload=void 0,h.source=s,h.height=s.height,h.width=s.width,n&&n(h)},h}var c=null;c="arraybuffer"===e?i:t.Base64Util.decode(i);var u=egret_native.Texture.createTextureFromArrayBuffer(c),l=new r(u);return n&&n(l),l},r.prototype.$dispose=function(){t.Capabilities.runtimeType==t.RuntimeType.WEB&&"webgl"==t.Capabilities.renderMode&&this.webGLTexture&&(t.WebGLUtils.deleteWebGLTexture(this.webGLTexture),this.webGLTexture=null),this.source&&this.source.dispose&&this.source.dispose(),this.source=null,r.$dispose(this)},r.$addDisplayObject=function(t,e){if(e){var i=e.hashCode;if(i){if(!r._displayList[i])return void(r._displayList[i]=[t]);var n=r._displayList[i];n.indexOf(t)<0&&n.push(t)}}},r.$removeDisplayObject=function(t,e){if(e){var i=e.hashCode;if(i&&r._displayList[i]){var n=r._displayList[i],o=n.indexOf(t);o>=0&&n.splice(o)}}},r.$invalidate=function(e){if(e){var i=e.hashCode;if(i&&r._displayList[i])for(var n=r._displayList[i],o=0;o<n.length;o++){n[o]instanceof t.Bitmap&&n[o].$refreshImageData();var a=n[o];a.$renderDirty=!0;var s=a.$parent;s&&!s.$cacheDirty&&(s.$cacheDirty=!0,s.$cacheDirtyUp());var h=a.$maskedObject;h&&!h.$cacheDirty&&(h.$cacheDirty=!0,h.$cacheDirtyUp())}}},r.$dispose=function(e){if(e){var i=e.hashCode;if(i&&r._displayList[i]){for(var n=r._displayList[i],o=0,a=n;o<a.length;o++){var s=a[o];s instanceof t.Bitmap&&(s.$bitmapData=null),s.$renderDirty=!0;var h=s.$parent;h&&!h.$cacheDirty&&(h.$cacheDirty=!0,h.$cacheDirtyUp());var c=s.$maskedObject;c&&!c.$cacheDirty&&(c.$cacheDirty=!0,c.$cacheDirtyUp())}delete r._displayList[i]}}},r._displayList=t.createMap(),r}(t.HashObject);t.BitmapData=e,__reflect(e.prototype,"egret.BitmapData")}(egret||(egret={}));var egret;!function(t){var e=new t.Point,r=function(r){function i(t,e,i,n,o,a){var s=r.call(this,t,e,i)||this;return s.targetChanged=!0,s.touchDown=!1,s.$initTo(n,o,a),s}return __extends(i,r),i.prototype.$initTo=function(t,e,r){this.touchPointID=+r||0,this.$stageX=+t||0,this.$stageY=+e||0},Object.defineProperty(i.prototype,"stageX",{get:function(){return this.$stageX},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"stageY",{get:function(){return this.$stageY},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localX",{get:function(){return this.targetChanged&&this.getLocalXY(),this._localX},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localY",{get:function(){return this.targetChanged&&this.getLocalXY(),this._localY},enumerable:!0,configurable:!0}),i.prototype.getLocalXY=function(){this.targetChanged=!1;var t=this.$target.$getInvertedConcatenatedMatrix();t.transformPoint(this.$stageX,this.$stageY,e),this._localX=e.x,this._localY=e.y},i.prototype.$setTarget=function(t){return this.$target=t,this.targetChanged=!!t,!0},i.prototype.updateAfterEvent=function(){t.sys.$requestRenderingFlag=!0},i.dispatchTouchEvent=function(e,r,n,o,a,s,h,c){if(void 0===c&&(c=!1),!n&&!e.hasEventListener(r))return!0;var u=t.Event.create(i,r,n,o);u.$initTo(a,s,h),u.touchDown=c;var l=e.dispatchEvent(u);return t.Event.release(u),l},i.TOUCH_MOVE="touchMove",i.TOUCH_BEGIN="touchBegin",i.TOUCH_END="touchEnd",i.TOUCH_CANCEL="touchCancel",i.TOUCH_TAP="touchTap",i.TOUCH_RELEASE_OUTSIDE="touchReleaseOutside",i}(t.Event);t.TouchEvent=r,__reflect(r.prototype,"egret.TouchEvent")}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,n,o){void 0===e&&(e=4),void 0===n&&(n=4),void 0===o&&(o=1);var a=t.call(this)||this;return a.type="blur",a.$blurX=e,a.$blurY=n,a.$quality=o,a.blurXFilter=new r(e),a.blurYFilter=new i(n),a}return __extends(e,t),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.$blurX},set:function(t){this.$blurX!=t&&(this.$blurX=t,this.blurXFilter.blurX=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.$blurY},set:function(t){this.$blurY!=t&&(this.$blurY=t,this.blurYFilter.blurY=t)},enumerable:!0,configurable:!0}),e.prototype.$toJson=function(){return'{"blurX": '+this.$blurX+', "blurY": '+this.$blurY+', "quality": 1}'},e}(t.Filter);t.BlurFilter=e,__reflect(e.prototype,"egret.BlurFilter");var r=function(t){function e(e){void 0===e&&(e=4);var r=t.call(this)||this;return r.type="blurX",r.$uniforms.blur={x:e,y:0},r}return __extends(e,t),Object.defineProperty(e.prototype,"blurX",{get:function(){return this.$uniforms.blur.x},set:function(t){this.$uniforms.blur.x=t},enumerable:!0,configurable:!0}),e}(t.Filter);__reflect(r.prototype,"BlurXFilter",["egret.IBlurXFilter"]);var i=function(t){function e(e){void 0===e&&(e=4);var r=t.call(this)||this;return r.type="blurY",r.$uniforms.blur={x:0,y:e},r}return __extends(e,t),Object.defineProperty(e.prototype,"blurY",{get:function(){return this.$uniforms.blur.y},set:function(t){this.$uniforms.blur.y=t},enumerable:!0,configurable:!0}),e}(t.Filter);__reflect(i.prototype,"BlurYFilter",["egret.IBlurYFilter"])}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e){void 0===e&&(e=null);var r=t.call(this)||this;return r.$matrix=[],r.matrix2=[],r.type="colorTransform",r.$uniforms.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.$uniforms.colorAdd={x:0,y:0,z:0,w:0},r.setMatrix(e),r}return __extends(e,t),Object.defineProperty(e.prototype,"matrix",{get:function(){for(var t=0;20>t;t++)this.matrix2[t]=this.$matrix[t];return this.matrix2},set:function(t){this.setMatrix(t)},enumerable:!0,configurable:!0}),e.prototype.setMatrix=function(t){if(t)for(var e=0;20>e;e++)this.$matrix[e]=t[e];else for(var e=0;20>e;e++)this.$matrix[e]=0==e||6==e||12==e||18==e?1:0;for(var r=this.$matrix,i=this.$uniforms.matrix,n=this.$uniforms.colorAdd,e=0,o=0;e<r.length;e++)4===e?n.x=r[e]/255:9===e?n.y=r[e]/255:14===e?n.z=r[e]/255:19===e?n.w=r[e]/255:(i[o]=r[e],o++)},e.prototype.$toJson=function(){return'{"matrix": ['+this.$matrix.toString()+"]}"},e}(t.Filter);t.ColorMatrixFilter=e,__reflect(e.prototype,"egret.ColorMatrixFilter")}(egret||(egret={}));var egret;!function(t){var e,r={},i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=new Array(36),o=0,a=function(){for(var t=0;36>t;t++)8===t||13===t||18===t||23===t?n[t]="-":14===t?n[t]="4":(2>=o&&(o=33554432+16777216*Math.random()|0),e=15&o,o>>=4,n[t]=i[19===t?3&e|8:e]);return n.join("")},s=function(t){function e(e,i,n){void 0===n&&(n={});var o=t.call(this)||this;o.padding=0,o.$vertexSrc=e,o.$fragmentSrc=i;var s=e+i;return r[s]||(r[s]=a()),o.$shaderKey=r[s],o.$uniforms=n,o.type="custom",o}return __extends(e,t),Object.defineProperty(e.prototype,"uniforms",{get:function(){return this.$uniforms},enumerable:!0,configurable:!0}),e}(t.Filter);t.CustomFilter=s,__reflect(s.prototype,"egret.CustomFilter")}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,r,i,n,o,a,s,h,c,u,l){void 0===e&&(e=4),void 0===r&&(r=45),void 0===i&&(i=0),void 0===n&&(n=1),void 0===o&&(o=4),void 0===a&&(a=4),void 0===s&&(s=1),void 0===h&&(h=1),void 0===c&&(c=!1),void 0===u&&(u=!1),void 0===l&&(l=!1);var p=t.call(this,i,n,o,a,s,h,c,u)||this;return p.$distance=e,p.$angle=r,p.$hideObject=l,p.$uniforms.dist=e,p.$uniforms.angle=r/180*Math.PI,p.$uniforms.hideObject=l?1:0,p}return __extends(e,t),Object.defineProperty(e.prototype,"distance",{get:function(){return this.$distance},set:function(t){this.$distance!=t&&(this.$distance=t,this.$uniforms.dist=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"angle",{get:function(){return this.$angle},set:function(t){this.$angle!=t&&(this.$angle=t,this.$uniforms.angle=t/180*Math.PI)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hideObject",{get:function(){return this.$hideObject},set:function(t){this.$hideObject!=t&&(this.$hideObject=t,this.$uniforms.hideObject=t?1:0)},enumerable:!0,configurable:!0}),e.prototype.$toJson=function(){return'{"distance": '+this.$distance+', "angle": '+this.$angle+', "color": '+this.$color+', "red": '+this.$red+', "green": '+this.$green+', "blue": '+this.$blue+', "alpha": '+this.$alpha+', "blurX": '+this.$blurX+', "blurY": '+this.blurY+', "strength": '+this.$strength+', "quality": '+this.$quality+', "inner": '+this.$inner+', "knockout": '+this.$knockout+', "hideObject": '+this.$hideObject+"}"},e}(t.GlowFilter);t.DropShadowFilter=e,__reflect(e.prototype,"egret.DropShadowFilter")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.LINEAR="linear",t.RADIAL="radial",t}();t.GradientType=e,__reflect(e.prototype,"egret.GradientType")}(egret||(egret={}));var egret;!function(t){function e(t){return t%=2*Math.PI,0>t&&(t+=2*Math.PI),t}var r=function(r){function i(){var e=r.call(this)||this;return e.lastX=0,e.lastY=0,e.fillPath=null,e.strokePath=null,e.topLeftStrokeWidth=0,e.bottomRightStrokeWidth=0,e.minX=1/0,e.minY=1/0,e.maxX=-(1/0),e.maxY=-(1/0),e.includeLastPosition=!0,e.$renderNode=new t.sys.GraphicsNode,e}return __extends(i,r),i.prototype.$setTarget=function(t){this.targetDisplay&&(this.targetDisplay.$renderNode=null),t.$renderNode=this.$renderNode,this.targetDisplay=t},i.prototype.setStrokeWidth=function(t){switch(t){case 1:this.topLeftStrokeWidth=0,this.bottomRightStrokeWidth=1;break;case 3:this.topLeftStrokeWidth=1,this.bottomRightStrokeWidth=2;break;default:var e=0|Math.ceil(.5*t);this.topLeftStrokeWidth=e,this.bottomRightStrokeWidth=e}},i.prototype.beginFill=function(t,e){void 0===e&&(e=1),t=+t||0,e=+e||0,this.fillPath=this.$renderNode.beginFill(t,e,this.strokePath),this.$renderNode.drawData.length>1&&this.fillPath.moveTo(this.lastX,this.lastY)},i.prototype.beginGradientFill=function(t,e,r,i,n){void 0===n&&(n=null),this.fillPath=this.$renderNode.beginGradientFill(t,e,r,i,n,this.strokePath),this.$renderNode.drawData.length>1&&this.fillPath.moveTo(this.lastX,this.lastY)},i.prototype.endFill=function(){this.fillPath=null},i.prototype.lineStyle=function(t,e,r,i,n,o,a,s,h){void 0===t&&(t=0/0),void 0===e&&(e=0),void 0===r&&(r=1),void 0===i&&(i=!1),void 0===n&&(n="normal"),void 0===o&&(o=null),void 0===a&&(a=null),void 0===s&&(s=3),t=+t||0,0>=t?(this.strokePath=null,this.setStrokeWidth(0)):(e=+e||0,r=+r||0,s=+s||0,this.setStrokeWidth(t),this.strokePath=this.$renderNode.lineStyle(t,e,r,o,a,s),h&&this.strokePath.setLineDash(h),this.$renderNode.drawData.length>1&&this.strokePath.moveTo(this.lastX,this.lastY))
},i.prototype.drawRect=function(t,e,r,i){t=+t||0,e=+e||0,r=+r||0,i=+i||0;var n=this.fillPath,o=this.strokePath;n&&n.drawRect(t,e,r,i),o&&o.drawRect(t,e,r,i),this.extendBoundsByPoint(t+r,e+i),this.updatePosition(t,e),this.$renderNode.dirtyRender=!0},i.prototype.drawRoundRect=function(t,e,r,i,n,o){t=+t||0,e=+e||0,r=+r||0,i=+i||0,n=+n||0,o=+o||0;var a=this.fillPath,s=this.strokePath;a&&a.drawRoundRect(t,e,r,i,n,o),s&&s.drawRoundRect(t,e,r,i,n,o);var h=.5*n|0,c=o?.5*o|0:h,u=t+r,l=e+i,p=l-c;this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(u,l),this.updatePosition(u,p),this.$renderNode.dirtyRender=!0},i.prototype.drawCircle=function(t,e,r){t=+t||0,e=+e||0,r=+r||0;var i=this.fillPath,n=this.strokePath;i&&i.drawCircle(t,e,r),n&&n.drawCircle(t,e,r),this.extendBoundsByPoint(t-r-1,e-r-1),this.extendBoundsByPoint(t+r+2,e+r+2),this.updatePosition(t+r,e),this.$renderNode.dirtyRender=!0},i.prototype.drawEllipse=function(t,e,r,i){t=+t||0,e=+e||0,r=+r||0,i=+i||0;var n=this.fillPath,o=this.strokePath;n&&n.drawEllipse(t,e,r,i),o&&o.drawEllipse(t,e,r,i),this.extendBoundsByPoint(t-1,e-1),this.extendBoundsByPoint(t+r+2,e+i+2),this.updatePosition(t+r,e+.5*i),this.$renderNode.dirtyRender=!0},i.prototype.moveTo=function(t,e){t=+t||0,e=+e||0;var r=this.fillPath,i=this.strokePath;r&&r.moveTo(t,e),i&&i.moveTo(t,e),this.includeLastPosition=!1,this.lastX=t,this.lastY=e,this.$renderNode.dirtyRender=!0},i.prototype.lineTo=function(t,e){t=+t||0,e=+e||0;var r=this.fillPath,i=this.strokePath;r&&r.lineTo(t,e),i&&i.lineTo(t,e),this.updatePosition(t,e),this.$renderNode.dirtyRender=!0},i.prototype.curveTo=function(t,e,r,i){t=+t||0,e=+e||0,r=+r||0,i=+i||0;var n=this.fillPath,o=this.strokePath;n&&n.curveTo(t,e,r,i),o&&o.curveTo(t,e,r,i),this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(r,i),this.updatePosition(r,i),this.$renderNode.dirtyRender=!0},i.prototype.cubicCurveTo=function(t,e,r,i,n,o){t=+t||0,e=+e||0,r=+r||0,i=+i||0,n=+n||0,o=+o||0;var a=this.fillPath,s=this.strokePath;a&&a.cubicCurveTo(t,e,r,i,n,o),s&&s.cubicCurveTo(t,e,r,i,n,o),this.extendBoundsByPoint(t,e),this.extendBoundsByPoint(r,i),this.extendBoundsByPoint(n,o),this.updatePosition(n,o),this.$renderNode.dirtyRender=!0},i.prototype.drawArc=function(t,r,i,n,o,a){if(!(0>i||n===o)){t=+t||0,r=+r||0,i=+i||0,n=+n||0,o=+o||0,a=!!a,n=e(n),o=e(o);var s=this.fillPath,h=this.strokePath;s&&(s.$lastX=this.lastX,s.$lastY=this.lastY,s.drawArc(t,r,i,n,o,a)),h&&(h.$lastX=this.lastX,h.$lastY=this.lastY,h.drawArc(t,r,i,n,o,a)),a?this.arcBounds(t,r,i,o,n):this.arcBounds(t,r,i,n,o);var c=t+Math.cos(o)*i,u=r+Math.sin(o)*i;this.updatePosition(c,u),this.$renderNode.dirtyRender=!0}},i.prototype.arcBounds=function(t,e,r,i,n){var o=Math.PI;if(Math.abs(i-n)<.01)return this.extendBoundsByPoint(t-r,e-r),void this.extendBoundsByPoint(t+r,e+r);i>n&&(n+=2*o);for(var a=Math.cos(i)*r,s=Math.cos(n)*r,h=Math.min(a,s),c=Math.max(a,s),u=Math.sin(i)*r,l=Math.sin(n)*r,p=Math.min(u,l),d=Math.max(u,l),f=i/(.5*o),g=n/(.5*o),$=Math.ceil(f);g>=$;$++)switch($%4){case 0:c=r;break;case 1:d=r;break;case 2:h=-r;break;case 3:p=-r}h=Math.floor(h),p=Math.floor(p),c=Math.ceil(c),d=Math.ceil(d),this.extendBoundsByPoint(h+t,p+e),this.extendBoundsByPoint(c+t,d+e)},i.prototype.clear=function(){this.$renderNode.clear(),this.updatePosition(0,0),this.minX=1/0,this.minY=1/0,this.maxX=-(1/0),this.maxY=-(1/0)},i.prototype.extendBoundsByPoint=function(t,e){this.extendBoundsByX(t),this.extendBoundsByY(e)},i.prototype.extendBoundsByX=function(t){this.minX=Math.min(this.minX,t-this.topLeftStrokeWidth),this.maxX=Math.max(this.maxX,t+this.bottomRightStrokeWidth),this.updateNodeBounds()},i.prototype.extendBoundsByY=function(t){this.minY=Math.min(this.minY,t-this.topLeftStrokeWidth),this.maxY=Math.max(this.maxY,t+this.bottomRightStrokeWidth),this.updateNodeBounds()},i.prototype.updateNodeBounds=function(){var t=this.$renderNode;t.x=this.minX,t.y=this.minY,t.width=Math.ceil(this.maxX-this.minX),t.height=Math.ceil(this.maxY-this.minY)},i.prototype.updatePosition=function(t,e){this.includeLastPosition||(this.extendBoundsByPoint(this.lastX,this.lastY),this.includeLastPosition=!0),this.lastX=t,this.lastY=e,this.extendBoundsByPoint(t,e)},i.prototype.$measureContentBounds=function(t){this.minX===1/0?t.setEmpty():t.setTo(this.minX,this.minY,this.maxX-this.minX,this.maxY-this.minY)},i.prototype.$hitTest=function(e,r){var i=this.targetDisplay,n=i.$getInvertedConcatenatedMatrix(),o=n.a*e+n.c*r+n.tx,a=n.b*e+n.d*r+n.ty,s=t.sys.canvasHitTestBuffer;s.resize(3,3);var h=this.$renderNode,c=t.Matrix.create();c.identity(),c.translate(1-o,1-a),t.sys.canvasRenderer.drawNodeToBuffer(h,s,c,!0),t.Matrix.release(c);try{var u=s.getPixels(1,1);if(0===u[3])return null}catch(l){throw new Error(t.sys.tr(1039))}return i},i.prototype.$onRemoveFromStage=function(){this.$renderNode&&this.$renderNode.clean()},i}(t.HashObject);t.Graphics=r,__reflect(r.prototype,"egret.Graphics")}(egret||(egret={}));var egret;!function(t){var e=Math.PI,r=2*e,i=e/180,n=[],o=function(o){function a(t,e,r,i,n,a){void 0===t&&(t=1),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=1),void 0===n&&(n=0),void 0===a&&(a=0);var s=o.call(this)||this;return s.a=t,s.b=e,s.c=r,s.d=i,s.tx=n,s.ty=a,s}return __extends(a,o),a.release=function(t){t&&n.push(t)},a.create=function(){var t=n.pop();return t||(t=new a),t},a.prototype.clone=function(){return new a(this.a,this.b,this.c,this.d,this.tx,this.ty)},a.prototype.concat=function(t){var e=this.a*t.a,r=0,i=0,n=this.d*t.d,o=this.tx*t.a+t.tx,a=this.ty*t.d+t.ty;(0!==this.b||0!==this.c||0!==t.b||0!==t.c)&&(e+=this.b*t.c,n+=this.c*t.b,r+=this.a*t.b+this.b*t.d,i+=this.c*t.a+this.d*t.c,o+=this.ty*t.c,a+=this.tx*t.b),this.a=e,this.b=r,this.c=i,this.d=n,this.tx=o,this.ty=a},a.prototype.copyFrom=function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},a.prototype.identity=function(){this.a=this.d=1,this.b=this.c=this.tx=this.ty=0},a.prototype.invert=function(){this.$invertInto(this)},a.prototype.$invertInto=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=this.tx,a=this.ty;if(0==r&&0==i)return t.b=t.c=0,void(0==e||0==n?t.a=t.d=t.tx=t.ty=0:(e=t.a=1/e,n=t.d=1/n,t.tx=-e*o,t.ty=-n*a));var s=e*n-r*i;if(0==s)return void t.identity();s=1/s;var h=t.a=n*s;r=t.b=-r*s,i=t.c=-i*s,n=t.d=e*s,t.tx=-(h*o+i*a),t.ty=-(r*o+n*a)},a.prototype.rotate=function(e){if(e=+e,0!==e){e/=i;var r=t.NumberUtils.cos(e),n=t.NumberUtils.sin(e),o=this.a,a=this.b,s=this.c,h=this.d,c=this.tx,u=this.ty;this.a=o*r-a*n,this.b=o*n+a*r,this.c=s*r-h*n,this.d=s*n+h*r,this.tx=c*r-u*n,this.ty=c*n+u*r}},a.prototype.scale=function(t,e){1!==t&&(this.a*=t,this.c*=t,this.tx*=t),1!==e&&(this.b*=e,this.d*=e,this.ty*=e)},a.prototype.setTo=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},a.prototype.transformPoint=function(e,r,i){var n=this.a*e+this.c*r+this.tx,o=this.b*e+this.d*r+this.ty;return i?(i.setTo(n,o),i):new t.Point(n,o)},a.prototype.translate=function(t,e){this.tx+=t,this.ty+=e},a.prototype.equals=function(t){return this.a==t.a&&this.b==t.b&&this.c==t.c&&this.d==t.d&&this.tx==t.tx&&this.ty==t.ty},a.prototype.prepend=function(t,e,r,i,n,o){var a=this.tx;if(1!=t||0!=e||0!=r||1!=i){var s=this.a,h=this.c;this.a=s*t+this.b*r,this.b=s*e+this.b*i,this.c=h*t+this.d*r,this.d=h*e+this.d*i}return this.tx=a*t+this.ty*r+n,this.ty=a*e+this.ty*i+o,this},a.prototype.append=function(t,e,r,i,n,o){var a=this.a,s=this.b,h=this.c,c=this.d;return(1!=t||0!=e||0!=r||1!=i)&&(this.a=t*a+e*h,this.b=t*s+e*c,this.c=r*a+i*h,this.d=r*s+i*c),this.tx=n*a+o*h+this.tx,this.ty=n*s+o*c+this.ty,this},a.prototype.deltaTransformPoint=function(e){var r=this,i=r.a*e.x+r.c*e.y,n=r.b*e.x+r.d*e.y;return new t.Point(i,n)},a.prototype.toString=function(){return"(a="+this.a+", b="+this.b+", c="+this.c+", d="+this.d+", tx="+this.tx+", ty="+this.ty+")"},a.prototype.createBox=function(e,r,n,o,a){void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=this;if(0!==n){n/=i;var h=t.NumberUtils.cos(n),c=t.NumberUtils.sin(n);s.a=h*e,s.b=c*r,s.c=-c*e,s.d=h*r}else s.a=e,s.b=0,s.c=0,s.d=r;s.tx=o,s.ty=a},a.prototype.createGradientBox=function(t,e,r,i,n){void 0===r&&(r=0),void 0===i&&(i=0),void 0===n&&(n=0),this.createBox(t/1638.4,e/1638.4,r,i+t/2,n+e/2)},a.prototype.$transformBounds=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=this.tx,a=this.ty,s=t.x,h=t.y,c=s+t.width,u=h+t.height,l=e*s+i*h+o,p=r*s+n*h+a,d=e*c+i*h+o,f=r*c+n*h+a,g=e*c+i*u+o,$=r*c+n*u+a,y=e*s+i*u+o,v=r*s+n*u+a,m=0;l>d&&(m=l,l=d,d=m),g>y&&(m=g,g=y,y=m),t.x=Math.floor(g>l?l:g),t.width=Math.ceil((d>y?d:y)-t.x),p>f&&(m=p,p=f,f=m),$>v&&(m=$,$=v,v=m),t.y=Math.floor($>p?p:$),t.height=Math.ceil((f>v?f:v)-t.y)},a.prototype.getDeterminant=function(){return this.a*this.d-this.b*this.c},a.prototype.$getScaleX=function(){var t=this;if(1==t.a&&0==t.b)return 1;var e=Math.sqrt(t.a*t.a+t.b*t.b);return this.getDeterminant()<0?-e:e},a.prototype.$getScaleY=function(){var t=this;if(0==t.c&&1==t.d)return 1;var e=Math.sqrt(t.c*t.c+t.d*t.d);return this.getDeterminant()<0?-e:e},a.prototype.$getSkewX=function(){return Math.atan2(this.d,this.c)-e/2},a.prototype.$getSkewY=function(){return Math.atan2(this.b,this.a)},a.prototype.$updateScaleAndRotation=function(e,n,o,a){if(!(0!=o&&o!=r||0!=a&&a!=r))return this.a=e,this.b=this.c=0,void(this.d=n);o/=i,a/=i;var s=t.NumberUtils.cos(o),h=t.NumberUtils.sin(o);o==a?(this.a=s*e,this.b=h*e):(this.a=t.NumberUtils.cos(a)*e,this.b=t.NumberUtils.sin(a)*e),this.c=-h*n,this.d=s*n},a.prototype.$preMultiplyInto=function(t,e){var r=t.a*this.a,i=0,n=0,o=t.d*this.d,a=t.tx*this.a+this.tx,s=t.ty*this.d+this.ty;(0!==t.b||0!==t.c||0!==this.b||0!==this.c)&&(r+=t.b*this.c,o+=t.c*this.b,i+=t.a*this.b+t.b*this.d,n+=t.c*this.a+t.d*this.c,a+=t.ty*this.c,s+=t.tx*this.b),e.a=r,e.b=i,e.c=n,e.d=o,e.tx=a,e.ty=s},a}(t.HashObject);t.Matrix=o,__reflect(o.prototype,"egret.Matrix"),t.$TempMatrix=new o}(egret||(egret={}));var egret;!function(t){var e=[],r=function(r){function i(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0);var o=r.call(this)||this;return o.x=t,o.y=e,o.width=i,o.height=n,o}return __extends(i,r),i.release=function(t){t&&e.push(t)},i.create=function(){var t=e.pop();return t||(t=new i),t},Object.defineProperty(i.prototype,"right",{get:function(){return this.x+this.width},set:function(t){this.width=t-this.x},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return this.y+this.height},set:function(t){this.height=t-this.y},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"left",{get:function(){return this.x},set:function(t){this.width+=this.x-t,this.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return this.y},set:function(t){this.height+=this.y-t,this.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"topLeft",{get:function(){return new t.Point(this.left,this.top)},set:function(t){this.top=t.y,this.left=t.x},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bottomRight",{get:function(){return new t.Point(this.right,this.bottom)},set:function(t){this.bottom=t.y,this.right=t.x},enumerable:!0,configurable:!0}),i.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.setTo=function(t,e,r,i){return this.x=t,this.y=e,this.width=r,this.height=i,this},i.prototype.contains=function(t,e){return this.x<=t&&this.x+this.width>=t&&this.y<=e&&this.y+this.height>=e},i.prototype.intersection=function(t){return this.clone().$intersectInPlace(t)},i.prototype.inflate=function(t,e){this.x-=t,this.width+=2*t,this.y-=e,this.height+=2*e},i.prototype.$intersectInPlace=function(t){var e=this.x,r=this.y,i=t.x,n=t.y,o=Math.max(e,i),a=Math.min(e+this.width,i+t.width);if(a>=o){var s=Math.max(r,n),h=Math.min(r+this.height,n+t.height);if(h>=s)return this.setTo(o,s,a-o,h-s),this}return this.setEmpty(),this},i.prototype.intersects=function(t){return Math.max(this.x,t.x)<=Math.min(this.right,t.right)&&Math.max(this.y,t.y)<=Math.min(this.bottom,t.bottom)},i.prototype.isEmpty=function(){return this.width<=0||this.height<=0},i.prototype.setEmpty=function(){this.x=0,this.y=0,this.width=0,this.height=0},i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.containsPoint=function(t){return this.x<=t.x&&this.x+this.width>t.x&&this.y<=t.y&&this.y+this.height>t.y?!0:!1},i.prototype.containsRect=function(t){var e=t.x+t.width,r=t.y+t.height,i=this.x+this.width,n=this.y+this.height;return t.x>=this.x&&t.x<i&&t.y>=this.y&&t.y<n&&e>this.x&&i>=e&&r>this.y&&n>=r},i.prototype.equals=function(t){return this===t?!0:this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},i.prototype.inflatePoint=function(t){this.inflate(t.x,t.y)},i.prototype.offset=function(t,e){this.x+=t,this.y+=e},i.prototype.offsetPoint=function(t){this.offset(t.x,t.y)},i.prototype.toString=function(){return"(x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"},i.prototype.union=function(t){var e=this.clone();if(t.isEmpty())return e;if(e.isEmpty())return e.copyFrom(t),e;var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return e.setTo(r,i,Math.max(e.right,t.right)-r,Math.max(e.bottom,t.bottom)-i),e},i.prototype.$getBaseWidth=function(t){var e=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t));return e*this.width+r*this.height},i.prototype.$getBaseHeight=function(t){var e=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t));return r*this.width+e*this.height},i}(t.HashObject);t.Rectangle=r,__reflect(r.prototype,"egret.Rectangle"),t.$TempRectangle=new r}(egret||(egret={}));var egret;!function(t){t.$locale_strings=t.$locale_strings||{},t.$locale_strings.en_US=t.$locale_strings.en_US||{};var e=t.$locale_strings.en_US;e[1001]="Could not find Egret entry class: {0}。",e[1002]="Egret entry class '{0}' must inherit from egret.DisplayObject.",e[1003]="Parameter {0} must be non-null.",e[1004]="An object cannot be added as a child to one of it's children (or children's children, etc.).",e[1005]="An object cannot be added as a child of itself.",e[1006]="The supplied DisplayObject must be a child of the caller.",e[1007]="An index specified for a parameter was out of range.",e[1008]="Instantiate singleton error,singleton class {0} can not create multiple instances.",e[1009]='the Class {0} cannot use the property "{1}"',e[1010]='the property "{1}" of the Class "{0}" is readonly',e[1011]="Stream Error. URL: {0}",e[1012]="The type of parameter {0} must be Class.",e[1013]="Variable assignment is NaN, please see the code!",e[1014]='the constant "{1}" of the Class "{0}" is read-only',e[1015]="xml not found!",e[1016]="{0}has been obsoleted",e[1017]="The format of JSON file is incorrect: {0}\ndata: {1}",e[1018]="the scale9Grid is not correct",e[1019]="Network ab:{0}",e[1020]="Cannot initialize Shader",e[1021]="Current browser does not support webgl",e[1022]="{0} ArgumentError",e[1023]="This method is not available in the ScrollView!",e[1025]="end of the file",e[1026]="! EncodingError The code point {0} could not be encoded.",e[1027]="DecodingError",e[1028]=". called injection is not configured rule: {0}, please specify configuration during its initial years of injection rule, and then call the corresponding single case.",e[1029]="Function.prototype.bind - what is trying to be bound is not callable",e[1033]="Photos can not be used across domains toDataURL to convert base64",e[1034]='Music file decoding failed: "{0}", please use the standard conversion tool reconversion under mp3.',e[1035]="Native does not support this feature!",e[1036]="Sound has stopped, please recall Sound.play () to play the sound!",e[1037]="Non-load the correct blob!",e[1038]="XML format error!",e[1039]="Cross domains pictures can not get pixel information!",e[1040]="hitTestPoint can not detect crossOrigin images! Please check if the display object has crossOrigin elements.",e[1041]="{0} is deprecated, please use {1} replace",e[1042]="The parameters passed in the region needs is an integer in drawToTexture method. Otherwise, some browsers will draw abnormal.",e[1043]="Compile errors in {0}, the attribute name: {1}, the attribute value: {2}.",e[1044]="The current version of the Runtime does not support video playback, please use the latest version",e[1045]="The resource url is not found",e[1046]="BitmapText no corresponding characters: {0}, please check the configuration file",e[1047]="egret.localStorage.setItem save failed,key={0}&value={1}",e[1048]="Video loading failed",e[1049]="In the absence of sound is not allowed to play after loading",e[1050]="ExternalInterface calls the method without js registration: {0}",e[3e3]="Theme configuration file failed to load: {0}",e[3001]="Cannot find the skin name which is configured in Theme: {0}",e[3002]='Index:"{0}" is out of the collection element index range',e[3003]="Cannot be available in this component. If this component is container, please continue to use",e[3004]="addChild(){0}addElement() replace",e[3005]="addChildAt(){0}addElementAt() replace",e[3006]="removeChild(){0}removeElement() replace",e[3007]="removeChildAt(){0}removeElementAt() replace",e[3008]="setChildIndex(){0}setElementIndex() replace",e[3009]="swapChildren(){0}swapElements() replace",e[3010]="swapChildrenAt(){0}swapElementsAt() replace",e[3011]='Index:"{0}" is out of the visual element index range',e[3012]="This method is not available in Scroller component!",e[3013]="UIStage is GUI root container, and only one such instant is in the display list!",e[3014]="set fullscreen error",e[3100]="Current browser does not support WebSocket",e[3101]="Please connect Socket firstly",e[3102]="Please set the type of binary type",e[4e3]="An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)",e[4001]="Abstract class can not be instantiated!",e[4002]="Unnamed data!",e[4003]="Nonsupport version!"}(egret||(egret={}));var egret;!function(t){t.JointStyle={BEVEL:"bevel",MITER:"miter",ROUND:"round"}}(egret||(egret={}));var egret;!function(t){t.$locale_strings=t.$locale_strings||{},t.$locale_strings.zh_CN=t.$locale_strings.zh_CN||{};var e=t.$locale_strings.zh_CN;e[1001]="找不到Egret入口类: {0}。",e[1002]="Egret入口类 {0} 必须继承自egret.DisplayObject。",e[1003]="参数 {0} 不能为 null。",e[1004]="无法将对象添加为它的一个子对象(或子对象的子对象等)的子对象。",e[1005]="不能将对象添加为其自身的子对象。",e[1006]="提供的 DisplayObject 必须是调用者的子级。",e[1007]="为参数指定的索引不在范围内。",e[1008]="实例化单例出错,不允许实例化多个 {0} 对象。",e[1009]="类 {0} 不可以使用属性 {1}",e[1010]="类 {0} 属性 {1} 是只读的",e[1011]="流错误。URL: {0}",e[1012]="参数 {0} 的类型必须为 Class。",e[1013]="变量赋值为NaN,请查看代码!",e[1014]="类 {0} 常量 {1} 是只读的",e[1015]="xml not found!",e[1016]="{0}已经废弃",e[1017]="JSON文件格式不正确: {0}\ndata: {1}",e[1018]="9宫格设置错误",e[1019]="网络异常:{0}",e[1020]="无法初始化着色器",e[1021]="当前浏览器不支持webgl",e[1022]="{0} ArgumentError",e[1023]="此方法在ScrollView内不可用!",e[1025]="遇到文件尾",e[1026]="EncodingError! The code point {0} could not be encoded.",e[1027]="DecodingError",e[1028]="调用了未配置的注入规则:{0}。 请先在项目初始化里配置指定的注入规则,再调用对应单例。",e[1029]="Function.prototype.bind - what is trying to be bound is not callable",e[1033]="跨域图片不可以使用toDataURL来转换成base64",e[1034]='音乐文件解码失败:"{0}",请使用标准的转换工具重新转换下mp3。',e[1035]="Native 下暂未实现此功能!",e[1036]="声音已停止,请重新调用 Sound.play() 来播放声音!",e[1037]="非正确的blob加载!",e[1038]="XML 格式错误!",e[1039]="跨域图片不能获取像素信息!",e[1040]="hitTestPoint 不能对跨域图片进行检测! 请检查该显示对象内是否含有跨域元素",e[1041]="{0} 已废弃,请使用 {1} 代替",e[1042]="drawToTexture方法传入的区域各个参数需要为整数,否则某些浏览器绘制会出现异常",e[1043]="{0} 中存在编译错误,属性名 : {1},属性值 : {2}",e[1044]="当前的 runtime 版本不支持视频播放,请使用最新的版本",e[1045]="没有设置要加载的资源地址",e[1046]="BitmapText 找不到对应字符:{0},请检查配置文件",e[1047]="egret.localStorage.setItem保存失败,key={0}&value={1}",e[1048]="视频加载失败",e[1049]="声音在没有加载完之前不允许播放",e[1050]="ExternalInterface调用了js没有注册的方法: {0}",e[3e3]="主题配置文件加载失败: {0}",e[3001]="找不到主题中所配置的皮肤类名: {0}",e[3002]='索引:"{0}"超出集合元素索引范围',e[3003]="在此组件中不可用,若此组件为容器类,请使用",e[3004]="addChild(){0}addElement()代替",e[3005]="addChildAt(){0}addElementAt()代替",e[3006]="removeChild(){0}removeElement()代替",e[3007]="removeChildAt(){0}removeElementAt()代替",e[3008]="setChildIndex(){0}setElementIndex()代替",e[3009]="swapChildren(){0}swapElements()代替",e[3010]="swapChildrenAt(){0}swapElementsAt()代替",e[3011]='索引:"{0}"超出可视元素索引范围',e[3012]="此方法在Scroller组件内不可用!",e[3013]="UIStage是GUI根容器,只能有一个此实例在显示列表中!",e[3014]="设置全屏模式失败",e[3100]="当前浏览器不支持WebSocket",e[3101]="请先连接WebSocket",e[3102]="请先设置type为二进制类型",e[4e3]="An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)",e[4001]="Abstract class can not be instantiated!",e[4002]="Unnamed data!",e[4003]="Nonsupport version!"}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.localStorage||(t.localStorage={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){function e(t){i.indexOf(t)<0&&i.push(t)}function r(t){var e=i.indexOf(t);return e>=0?(i.splice(e,1),!0):!1}var i=[];t.$pushSoundChannel=e,t.$popSoundChannel=r}(e=t.sys||(t.sys={}))}(egret||(egret={})),function(t){}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){this.onSuccessFunc=null,this.onSuccessThisObject=null,this.onErrorFunc=null,this.onErrorThisObject=null,this.downloadingSizeFunc=null,this.downloadingSizeThisObject=null,this.onResponseHeaderFunc=null,this.onResponseHeaderThisObject=null}return e.create=function(){return e.promiseObjectList.length?e.promiseObjectList.pop():new t.PromiseObject},e.prototype.onSuccess=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.onSuccessFunc&&this.onSuccessFunc.apply(this.onSuccessThisObject,t),this.destroy()},e.prototype.onError=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.onErrorFunc&&this.onErrorFunc.apply(this.onErrorThisObject,t),this.destroy()},e.prototype.downloadingSize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.downloadingSizeFunc&&this.downloadingSizeFunc.apply(this.downloadingSizeThisObject,t)},e.prototype.onResponseHeader=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.onResponseHeaderFunc&&this.onResponseHeaderFunc.apply(this.onResponseHeaderThisObject,t)},e.prototype.destroy=function(){this.onSuccessFunc=void 0,this.onSuccessThisObject=void 0,this.onErrorFunc=void 0,this.onErrorThisObject=void 0,this.downloadingSizeFunc=void 0,this.downloadingSizeThisObject=void 0,this.onResponseHeaderFunc=void 0,this.onResponseHeaderThisObject=void 0,e.promiseObjectList.push(this)},e.promiseObjectList=[],e}();t.PromiseObject=e,__reflect(e.prototype,"egret.PromiseObject")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.GET="GET",t.POST="POST",t}();t.HttpMethod=e,__reflect(e.prototype,"egret.HttpMethod")}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.TEXT="text",t.ARRAY_BUFFER="arraybuffer",t}();t.HttpResponseType=e,__reflect(e.prototype,"egret.HttpResponseType")}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(r){function i(i){var n=r.call(this)||this;return n.isStage=!1,n.$renderNode=new e.BitmapNode,n.renderBuffer=null,n.offsetX=0,n.offsetY=0,n.offsetMatrix=new t.Matrix,n.needUpdateRegions=!1,n.$canvasScaleX=1,n.$canvasScaleY=1,n.root=i,n.isStage=i instanceof t.Stage,n}return __extends(i,r),i.create=function(r){var i=new t.sys.DisplayList(r);try{var n=new e.RenderBuffer;i.renderBuffer=n}catch(o){return null}return i.root=r,i},i.prototype.$getRenderNode=function(){return this.$renderNode},i.prototype.setClipRect=function(t,e){t*=i.$canvasScaleX,e*=i.$canvasScaleY,this.renderBuffer.resize(t,e)},i.prototype.drawToSurface=function(){var r=0;this.$canvasScaleX=this.offsetMatrix.a=i.$canvasScaleX,this.$canvasScaleY=this.offsetMatrix.d=i.$canvasScaleY,this.isStage||this.changeSurfaceSize();var n=this.renderBuffer;if(n.clear(),r=e.systemRenderer.render(this.root,n,this.offsetMatrix),!this.isStage){var o=n.surface,a=this.$renderNode;a.drawData.length=0;var s=o.width,h=o.height;this.bitmapData?(this.bitmapData.source=o,this.bitmapData.width=s,this.bitmapData.height=h):this.bitmapData=new t.BitmapData(o),a.image=this.bitmapData,a.imageWidth=s,a.imageHeight=h,a.drawImage(0,0,s,h,-this.offsetX,-this.offsetY,s/this.$canvasScaleX,h/this.$canvasScaleY)}return r},i.prototype.changeSurfaceSize=function(){var t=(this.root,this.offsetX),e=this.offsetY,r=this.root.$getOriginalBounds(),i=this.$canvasScaleX,n=this.$canvasScaleY;this.offsetX=-r.x,this.offsetY=-r.y,this.offsetMatrix.setTo(this.offsetMatrix.a,0,0,this.offsetMatrix.d,this.offsetX,this.offsetY);var o=this.renderBuffer,a=Math.max(257,r.width*i),s=Math.max(257,r.height*n);(this.offsetX!=t||this.offsetY!=e||o.surface.width!=a||o.surface.height!=s)&&o.resize(a,s)},i.$setCanvasScale=function(t,e){i.$canvasScaleX=t,i.$canvasScaleY=e},i.$canvasScaleFactor=1,i.$canvasScaleX=1,i.$canvasScaleY=1,i}(t.HashObject);e.DisplayList=r,__reflect(r.prototype,"egret.sys.DisplayList")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e;!function(e){function r(r,n,h,c){if(n&&(t.log=function(){for(var t=arguments.length,r="",n=0;t>n;n++)r+=arguments[n]+" ";e.$logToFPS(r),console.log.apply(console,i(arguments))}),a=c?{}:c,n=!!n,this.showFPS=!!r,this.showLog=n,!this.fps){var u=void 0===c.x?0:c.x,l=void 0===c.y?0:c.y;o=this.fps=new FPS(this.stage,r,n,h,c),o.x=u,o.y=l;for(var p=s.length,d=0;p>d;d++)o.updateInfo(s[d]);s=null}}function i(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r]);return e}var n=function(i){function n(t,e,n){var o=i.call(this)||this;return o.isPlaying=!1,o.entryClassName=n,o.stage=e,o.screenDisplayList=o.createDisplayList(e,t),o.showFPS=!1,o.showLog=!1,o.stageDisplayList=null,o.displayFPS=r,o}return __extends(n,i),n.prototype.createDisplayList=function(t,r){var i=new e.DisplayList(t);return i.renderBuffer=r,t.$displayList=i,i},n.prototype.start=function(){!this.isPlaying&&this.stage&&(e.$TempStage=e.$TempStage||this.stage,this.isPlaying=!0,this.root||this.initialize(),t.ticker.$addPlayer(this))},n.prototype.initialize=function(){var e;if(this.entryClassName&&(e=t.getDefinitionByName(this.entryClassName)),e){var r=new e;this.root=r,r instanceof t.DisplayObject&&this.stage.addChild(r)}},n.prototype.stop=function(){this.pause(),this.stage=null},n.prototype.pause=function(){this.isPlaying&&(this.isPlaying=!1,t.ticker.$removePlayer(this))},n.prototype.$render=function(e,r){(this.showFPS||this.showLog)&&this.stage.addChild(this.fps);var i=this.stage,n=t.getTimer(),o=i.$displayList.drawToSurface(),a=t.getTimer();e&&this.showFPS&&this.fps.update(o,a-n,r)},n.prototype.updateStageSize=function(e,r){var i=this.stage;i.$stageWidth=e,i.$stageHeight=r,this.screenDisplayList.setClipRect(e,r),this.stageDisplayList&&this.stageDisplayList.setClipRect(e,r),i.dispatchEventWith(t.Event.RESIZE)},n}(t.HashObject);e.Player=n,__reflect(n.prototype,"egret.sys.Player");var o,a,s=[];e.$logToFPS=function(t){return o?void o.updateInfo(t):void s.push(t)},FPS=function(e){function r(r,i,n,o,a){e.call(this),this.isFPS=!0,this.infoLines=[],this.totalTime=0,this.totalTick=0,this.lastTime=0,this.drawCalls=0,this.costRender=0,this.costTicker=0,this._stage=r,this.showFPS=i,this.showLog=n,this.logFilter=o,this.touchChildren=!1,this.touchEnabled=!1,this.styles=a,this.fpsDisplay=new t.FPSDisplay(r,i,n,o,a),this.addChild(this.fpsDisplay);var s;try{s=o?new RegExp(o):null}catch(h){t.log(h)}this.filter=function(t){return s?s.test(t):!o||0==t.indexOf(o)}}return __extends(r,e),r.prototype.update=function(e,r,i){var n=t.getTimer();if(this.totalTime+=n-this.lastTime,this.lastTime=n,this.totalTick++,this.drawCalls+=e,this.costRender+=r,this.costTicker+=i,this.totalTime>=1e3){var o=Math.min(Math.ceil(1e3*this.totalTick/this.totalTime),t.ticker.$frameRate),a=Math.round(this.drawCalls/this.totalTick),s=Math.round(this.costRender/this.totalTick),h=Math.round(this.costTicker/this.totalTick);this.fpsDisplay.update({fps:o,draw:a,costTicker:h,costRender:s}),this.totalTick=0,this.totalTime=this.totalTime%1e3,this.drawCalls=0,this.costRender=0,this.costTicker=0}},r.prototype.updateInfo=function(t){t&&this.showLog&&this.filter(t)&&this.fpsDisplay.updateInfo(t)},r}(t.Sprite),t.warn=function(){console.warn.apply(console,i(arguments))},t.error=function(){console.error.apply(console,i(arguments))},t.assert=function(){console.assert.apply(console,i(arguments))},t.log=function(){console.log.apply(console,i(arguments))}}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(r){var i=e.call(this,r)||this;return i._verticesDirty=!0,i._bounds=new t.Rectangle,i.$renderNode=new t.sys.MeshNode,i}return __extends(r,e),r.prototype.$updateRenderNode=function(){var e=this.$bitmapData;if(e){var r=(t.$TextureScaleFactor,this.$renderNode);r.smoothing=this.$smoothing,r.image=e,r.imageWidth=this.$sourceWidth,r.imageHeight=this.$sourceHeight;var i=isNaN(this.$explicitBitmapWidth)?this.$textureWidth:this.$explicitBitmapWidth,n=isNaN(this.$explicitBitmapHeight)?this.$textureHeight:this.$explicitBitmapHeight,o=i/this.$textureWidth,a=n/this.$textureHeight,s=this.$bitmapWidth,h=this.$bitmapHeight;r.drawMesh(this.$bitmapX,this.$bitmapY,s,h,this.$offsetX*o,this.$offsetY*a,o*s,a*h)}},r.prototype.$updateVertices=function(){var t=this;t._verticesDirty=!0,t.$renderDirty=!0;var e=t.$parent;e&&!e.$cacheDirty&&(e.$cacheDirty=!0,e.$cacheDirtyUp());var r=t.$maskedObject;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp())},r.prototype.$measureContentBounds=function(t){if(this._verticesDirty){this._verticesDirty=!1;var e=this.$renderNode,r=e.vertices;if(r.length){this._bounds.setTo(Number.MAX_VALUE,Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var i=0,n=r.length;n>i;i+=2){var o=r[i],a=r[i+1];this._bounds.x>o&&(this._bounds.x=o),this._bounds.width<o&&(this._bounds.width=o),this._bounds.y>a&&(this._bounds.y=a),this._bounds.height<a&&(this._bounds.height=a)}this._bounds.width-=this._bounds.x,this._bounds.height-=this._bounds.y}else this._bounds.setTo(0,0,0,0);e.bounds.copyFrom(this._bounds)}t.copyFrom(this._bounds)},r}(t.Bitmap);t.Mesh=e,__reflect(e.prototype,"egret.Mesh")}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){return e.call(this)||this}return __extends(r,e),r.prototype.calculateStageSize=function(e,r,i,n,o){var a=r,s=i,h=n,c=o,u=r/h||0,l=i/c||0;switch(e){case t.StageScaleMode.EXACT_FIT:break;case t.StageScaleMode.FIXED_HEIGHT:h=Math.round(r/l);break;case t.StageScaleMode.FIXED_WIDTH:c=Math.round(i/u);break;case t.StageScaleMode.NO_BORDER:u>l?s=Math.round(c*u):a=Math.round(h*l);break;case t.StageScaleMode.SHOW_ALL:u>l?a=Math.round(h*l):s=Math.round(c*u);break;case t.StageScaleMode.FIXED_NARROW:u>l?h=Math.round(r/l):c=Math.round(i/u);break;case t.StageScaleMode.FIXED_WIDE:u>l?c=Math.round(i/u):h=Math.round(r/l);break;default:h=r,c=i}return h%2!=0&&(h+=1),c%2!=0&&(c+=1),a%2!=0&&(a+=1),s%2!=0&&(s+=1),{stageWidth:h,stageHeight:c,displayWidth:a,displayHeight:s}},r}(t.HashObject);e.DefaultScreenAdapter=r,__reflect(r.prototype,"egret.sys.DefaultScreenAdapter",["egret.sys.IScreenAdapter"])}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.NO_SCALE="noScale",t.SHOW_ALL="showAll",t.NO_BORDER="noBorder",t.EXACT_FIT="exactFit",t.FIXED_WIDTH="fixedWidth",t.FIXED_HEIGHT="fixedHeight",t.FIXED_NARROW="fixedNarrow",t.FIXED_WIDE="fixedWide",t}();t.StageScaleMode=e,__reflect(e.prototype,"egret.StageScaleMode")}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){e.$START_TIME=0,e.$invalidateRenderFlag=!1,e.$requestRenderingFlag=!1;var r=function(){function r(){this.playerList=[],this.callBackList=[],this.thisObjectList=[],this.$frameRate=30,this.lastTimeStamp=0,this.costEnterFrame=0,this.isPaused=!1,e.$START_TIME=Date.now(),this.frameDeltaTime=1e3/this.$frameRate,this.lastCount=this.frameInterval=Math.round(6e4/this.$frameRate)
}return r.prototype.$addPlayer=function(t){-1==this.playerList.indexOf(t)&&(this.playerList=this.playerList.concat(),this.playerList.push(t))},r.prototype.$removePlayer=function(t){var e=this.playerList.indexOf(t);if(-1!==e){this.playerList=this.playerList.concat(),this.playerList.splice(e,1)}},r.prototype.$startTick=function(t,e){var r=this.getTickIndex(t,e);-1==r&&(this.concatTick(),this.callBackList.push(t),this.thisObjectList.push(e))},r.prototype.$stopTick=function(t,e){var r=this.getTickIndex(t,e);-1!=r&&(this.concatTick(),this.callBackList.splice(r,1),this.thisObjectList.splice(r,1))},r.prototype.getTickIndex=function(t,e){for(var r=this.callBackList,i=this.thisObjectList,n=r.length-1;n>=0;n--)if(r[n]==t&&i[n]==e)return n;return-1},r.prototype.concatTick=function(){this.callBackList=this.callBackList.concat(),this.thisObjectList=this.thisObjectList.concat()},r.prototype.$setFrameRate=function(e){return e=+e||0,0>=e?!1:this.$frameRate==e?!1:(this.$frameRate=e,e>60&&(e=60),t.Capabilities.runtimeType==t.RuntimeType.NATIVE&&(egret_native.setFrameRate(e),e=60),this.frameDeltaTime=1e3/e,this.lastCount=this.frameInterval=Math.round(6e4/e),!0)},r.prototype.pause=function(){this.isPaused=!0},r.prototype.resume=function(){this.isPaused=!1},r.prototype.update=function(){for(var r=t.getTimer(),i=this.callBackList,n=this.thisObjectList,o=i.length,a=e.$requestRenderingFlag,s=t.getTimer(),h=t.lifecycle.contexts,c=0,u=h;c<u.length;c++){var l=u[c];l.onUpdate&&l.onUpdate()}if(this.isPaused)return void(this.lastTimeStamp=s);this.callLaterAsyncs();for(var p=0;o>p;p++)i[p].call(n[p],s)&&(a=!0);var d=t.getTimer(),f=s-this.lastTimeStamp;if(this.lastTimeStamp=s,f>=this.frameDeltaTime)this.lastCount=this.frameInterval;else{if(this.lastCount-=1e3,this.lastCount>0)return void(a&&this.render(!1,this.costEnterFrame+d-r));this.lastCount+=this.frameInterval}this.render(!0,this.costEnterFrame+d-r);var g=t.getTimer();this.broadcastEnterFrame();var $=t.getTimer();this.costEnterFrame=$-g},r.prototype.render=function(t,r){var i=this.playerList,n=i.length;if(0!=n){this.callLaters(),e.$invalidateRenderFlag&&(this.broadcastRender(),e.$invalidateRenderFlag=!1);for(var o=0;n>o;o++)i[o].$render(t,r);e.$requestRenderingFlag=!1}},r.prototype.broadcastEnterFrame=function(){var e=t.DisplayObject.$enterFrameCallBackList,r=e.length;if(0!=r){e=e.concat();for(var i=0;r>i;i++)e[i].dispatchEventWith(t.Event.ENTER_FRAME)}},r.prototype.broadcastRender=function(){var e=t.DisplayObject.$renderCallBackList,r=e.length;if(0!=r){e=e.concat();for(var i=0;r>i;i++)e[i].dispatchEventWith(t.Event.RENDER)}},r.prototype.callLaters=function(){var e,r,i;if(t.$callLaterFunctionList.length>0&&(e=t.$callLaterFunctionList,t.$callLaterFunctionList=[],r=t.$callLaterThisList,t.$callLaterThisList=[],i=t.$callLaterArgsList,t.$callLaterArgsList=[]),e)for(var n=e.length,o=0;n>o;o++){var a=e[o];null!=a&&a.apply(r[o],i[o])}},r.prototype.callLaterAsyncs=function(){if(t.$callAsyncFunctionList.length>0){var e=t.$callAsyncFunctionList,r=t.$callAsyncThisList,i=t.$callAsyncArgsList;t.$callAsyncFunctionList=[],t.$callAsyncThisList=[],t.$callAsyncArgsList=[];for(var n=0;n<e.length;n++){var o=e[n];null!=o&&o.apply(r[n],i[n])}}},r}();e.SystemTicker=r,__reflect(r.prototype,"egret.sys.SystemTicker")}(e=t.sys||(t.sys={}))}(egret||(egret={})),function(t){var e;!function(e){function r(t){var r=new n;e.contexts.push(r),t(r)}e.contexts=[];var i=!0,n=function(){function r(){}return r.prototype.pause=function(){i&&(i=!1,e.stage.dispatchEvent(new t.Event(t.Event.DEACTIVATE)),e.onPause&&e.onPause())},r.prototype.resume=function(){i||(i=!0,e.stage.dispatchEvent(new t.Event(t.Event.ACTIVATE)),e.onResume&&e.onResume())},r}();e.LifecycleContext=n,__reflect(n.prototype,"egret.lifecycle.LifecycleContext"),e.addLifecycleListener=r}(e=t.lifecycle||(t.lifecycle={})),t.ticker=new t.sys.SystemTicker}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(t){var r=e.call(this)||this;return r.maxTouches=0,r.useTouchesCount=0,r.touchDownTarget={},r.lastTouchX=-1,r.lastTouchY=-1,r.stage=t,r}return __extends(r,e),r.prototype.$initMaxTouches=function(){this.maxTouches=this.stage.$maxTouches},r.prototype.onTouchBegin=function(e,r,i){if(!(this.useTouchesCount>=this.maxTouches)){this.lastTouchX=e,this.lastTouchY=r;var n=this.findTarget(e,r);null==this.touchDownTarget[i]&&(this.touchDownTarget[i]=n,this.useTouchesCount++),t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_BEGIN,!0,!0,e,r,i,!0)}},r.prototype.onTouchMove=function(e,r,i){if(null!=this.touchDownTarget[i]&&(this.lastTouchX!=e||this.lastTouchY!=r)){this.lastTouchX=e,this.lastTouchY=r;var n=this.findTarget(e,r);t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_MOVE,!0,!0,e,r,i,!0)}},r.prototype.onTouchEnd=function(e,r,i){if(null!=this.touchDownTarget[i]){var n=this.findTarget(e,r),o=this.touchDownTarget[i];delete this.touchDownTarget[i],this.useTouchesCount--,t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_END,!0,!0,e,r,i,!1),o==n?t.TouchEvent.dispatchTouchEvent(n,t.TouchEvent.TOUCH_TAP,!0,!0,e,r,i,!1):t.TouchEvent.dispatchTouchEvent(o,t.TouchEvent.TOUCH_RELEASE_OUTSIDE,!0,!0,e,r,i,!1)}},r.prototype.findTarget=function(t,e){var r=this.stage.$hitTest(t,e);return r||(r=this.stage),r},r}(t.HashObject);e.TouchHandler=r,__reflect(r.prototype,"egret.sys.TouchHandler")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var t=e.call(this)||this;return t.image=null,t.smoothing=!0,t.blendMode=null,t.alpha=0/0,t.filter=null,t.rotated=!1,t.type=1,t}return __extends(r,e),r.prototype.drawImage=function(t,e,r,i,n,o,a,s){this.drawData.push(t,e,r,i,n,o,a,s),this.renderCount++},r.prototype.cleanBeforeRender=function(){e.prototype.cleanBeforeRender.call(this),this.image=null,this.matrix=null,this.blendMode=null,this.alpha=0/0,this.filter=null},r.$updateTextureData=function(e,i,n,o,a,s,h,c,u,l,p,d,f,g,$,y){if(i){var v=t.$TextureScaleFactor;if(e.smoothing=y,e.image=i,e.imageWidth=f,e.imageHeight=g,$==t.BitmapFillMode.SCALE){var m=p/u*v,b=d/l*v;e.drawImage(n,o,a,s,m*h,b*c,m*a,b*s)}else if($==t.BitmapFillMode.CLIP){var x=Math.min(u,p),T=Math.min(l,d),_=a*v,w=s*v;r.drawClipImage(e,v,n,o,_,w,h,c,x,T)}else for(var _=a*v,w=s*v,O=0;p>O;O+=u)for(var E=0;d>E;E+=l){var x=Math.min(p-O,u),T=Math.min(d-E,l);r.drawClipImage(e,v,n,o,_,w,h,c,x,T,O,E)}}},r.$updateTextureDataWithScale9Grid=function(e,r,i,n,o,a,s,h,c,u,l,p,d,f,g,$){e.smoothing=$,e.image=r,e.imageWidth=f,e.imageHeight=g;var y=a,v=s;p-=u-a*t.$TextureScaleFactor,d-=l-s*t.$TextureScaleFactor;var m=i.x-h,b=i.y-c,x=m/t.$TextureScaleFactor,T=b/t.$TextureScaleFactor,_=i.width/t.$TextureScaleFactor,w=i.height/t.$TextureScaleFactor;0==w&&(w=1,T>=v&&T--),0==_&&(_=1,x>=y&&x--);var O=n,E=O+x,D=E+_,S=y-x-_,P=o,F=P+T,C=F+w,M=v-T-w,B=S*t.$TextureScaleFactor,A=M*t.$TextureScaleFactor;if((x+S)*t.$TextureScaleFactor>p||(T+M)*t.$TextureScaleFactor>d)return void e.drawImage(n,o,a,s,h,c,p,d);var R=h,N=R+m,k=R+(p-B),L=p-m-B,j=c,I=j+b,U=j+d-A,X=d-b-A;T>0&&(x>0&&e.drawImage(O,P,x,T,R,j,m,b),_>0&&e.drawImage(E,P,_,T,N,j,L,b),S>0&&e.drawImage(D,P,S,T,k,j,B,b)),w>0&&(x>0&&e.drawImage(O,F,x,w,R,I,m,X),_>0&&e.drawImage(E,F,_,w,N,I,L,X),S>0&&e.drawImage(D,F,S,w,k,I,B,X)),M>0&&(x>0&&e.drawImage(O,C,x,M,R,U,m,A),_>0&&e.drawImage(E,C,_,M,N,U,L,A),S>0&&e.drawImage(D,C,S,M,k,U,B,A))},r.drawClipImage=function(t,e,r,i,n,o,a,s,h,c,u,l){void 0===u&&(u=0),void 0===l&&(l=0);var p=a+n-h;p>0&&(n-=p),p=s+o-c,p>0&&(o-=p),t.drawImage(r,i,n/e,o/e,u+a,l+s,n,o)},r}(e.RenderNode);e.BitmapNode=r,__reflect(r.prototype,"egret.sys.BitmapNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=["none","round","square"],i=["bevel","miter","round"],n=function(n){function o(){var t=n.call(this)||this;return t.dirtyRender=!0,t.type=3,t}return __extends(o,n),o.prototype.beginFill=function(t,r,i){void 0===r&&(r=1);var n=new e.FillPath;if(n.fillColor=t,n.fillAlpha=r,i){var o=this.drawData.lastIndexOf(i);this.drawData.splice(o,0,n)}else this.drawData.push(n);return n},o.prototype.beginGradientFill=function(r,i,n,o,a,s){var h=new t.Matrix;a?(h.a=819.2*a.a,h.b=819.2*a.b,h.c=819.2*a.c,h.d=819.2*a.d,h.tx=a.tx,h.ty=a.ty):(h.a=100,h.d=100);var c=new e.GradientFillPath;if(c.gradientType=r,c.colors=i,c.alphas=n,c.ratios=o,c.matrix=h,s){var u=this.drawData.lastIndexOf(s);this.drawData.splice(u,0,c)}else this.drawData.push(c);return c},o.prototype.lineStyle=function(n,o,a,s,h,c){void 0===a&&(a=1),void 0===c&&(c=3),-1==r.indexOf(s)&&(s="round"),-1==i.indexOf(h)&&(h="round");var u=new e.StrokePath;return u.lineWidth=n,u.lineColor=o,u.lineAlpha=a,u.caps=s||t.CapsStyle.ROUND,u.joints=h,u.miterLimit=c,this.drawData.push(u),u},o.prototype.clear=function(){this.drawData.length=0,this.dirtyRender=!0},o.prototype.cleanBeforeRender=function(){},o.prototype.clean=function(){this.$texture&&(t.WebGLUtils.deleteWebGLTexture(this.$texture),this.$texture=null,this.dirtyRender=!0)},o}(e.RenderNode);e.GraphicsNode=n,__reflect(n.prototype,"egret.sys.GraphicsNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=4,e}return __extends(e,t),e.prototype.addNode=function(t){this.drawData.push(t)},e.prototype.cleanBeforeRender=function(){for(var t=this.drawData,e=t.length-1;e>=0;e--)t[e].cleanBeforeRender()},e.prototype.$getRenderCount=function(){for(var t=0,e=this.drawData,r=e.length-1;r>=0;r--)t+=e[r].$getRenderCount();return t},e}(t.RenderNode);t.GroupNode=e,__reflect(e.prototype,"egret.sys.GroupNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var r=e.call(this)||this;return r.image=null,r.smoothing=!0,r.bounds=new t.Rectangle,r.blendMode=null,r.alpha=0/0,r.filter=null,r.rotated=!1,r.type=5,r.vertices=[],r.uvs=[],r.indices=[],r}return __extends(r,e),r.prototype.drawMesh=function(t,e,r,i,n,o,a,s){this.drawData.push(t,e,r,i,n,o,a,s),this.renderCount++},r.prototype.cleanBeforeRender=function(){e.prototype.cleanBeforeRender.call(this),this.image=null,this.matrix=null},r}(e.RenderNode);e.MeshNode=r,__reflect(r.prototype,"egret.sys.MeshNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.image=null,e.smoothing=!0,e.rotated=!1,e.type=6,e}return __extends(e,t),e.prototype.drawImage=function(t,e,r,i,n,o,a,s){var h=this;h.sourceX=t,h.sourceY=e,h.sourceW=r,h.sourceH=i,h.drawX=n,h.drawY=o,h.drawW=a,h.drawH=s,h.renderCount=1},e.prototype.cleanBeforeRender=function(){t.prototype.cleanBeforeRender.call(this),this.image=null},e}(t.RenderNode);t.NormalBitmapNode=e,__reflect(e.prototype,"egret.sys.NormalBitmapNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){t.OrientationMode={AUTO:"auto",PORTRAIT:"portrait",LANDSCAPE:"landscape",LANDSCAPE_FLIPPED:"landscapeFlipped"}}(egret||(egret={}));var egret;!function(t){var e;!function(e){var r=function(e){function r(){var t=e.call(this)||this;return t.textColor=16777215,t.strokeColor=0,t.size=30,t.stroke=0,t.bold=!1,t.italic=!1,t.fontFamily="Arial",t.dirtyRender=!0,t.type=2,t}return __extends(r,e),r.prototype.drawText=function(t,e,r,i){this.drawData.push(t,e,r,i),this.renderCount++,this.dirtyRender=!0},r.prototype.clean=function(){this.$texture&&(t.WebGLUtils.deleteWebGLTexture(this.$texture),this.$texture=null,this.dirtyRender=!0)},r}(e.RenderNode);e.TextNode=r,__reflect(r.prototype,"egret.sys.TextNode")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=1,e}return __extends(e,t),e}(t.Path2D);t.FillPath=e,__reflect(e.prototype,"egret.sys.FillPath")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=2,e}return __extends(e,t),e}(t.Path2D);t.GradientFillPath=e,__reflect(e.prototype,"egret.sys.GradientFillPath")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var r=e.call(this)||this;r.$renderBuffer=new t.sys.RenderBuffer;var i=new t.BitmapData(r.$renderBuffer.surface);return i.$deleteSource=!1,r._setBitmapData(i),r}return __extends(r,e),r.prototype.drawToTexture=function(e,r,i){if(void 0===i&&(i=1),r&&(0==r.width||0==r.height))return!1;var n=r||e.$getOriginalBounds();if(0==n.width||0==n.height)return!1;i/=t.$TextureScaleFactor;var o=(n.x+n.width)*i,a=(n.y+n.height)*i;r&&(o=n.width*i,a=n.height*i);var s=this.$renderBuffer;if(!s)return!1;s.resize(o,a),this.$bitmapData.width=o,this.$bitmapData.height=a;var h=t.Matrix.create();return h.identity(),r&&h.translate(-r.x,-r.y),h.scale(i,i),t.sys.systemRenderer.render(e,s,h,!0),t.Matrix.release(h),this.$initData(0,0,o,a,0,0,o,a,o,a),!0},r.prototype.getPixel32=function(e,r){var i;if(this.$renderBuffer){var n=t.$TextureScaleFactor;e=Math.round(e/n),r=Math.round(r/n),i=this.$renderBuffer.getPixels(e,r,1,1)}return i},r.prototype.dispose=function(){e.prototype.dispose.call(this),this.$renderBuffer=null},r}(t.Texture);t.RenderTexture=e,__reflect(e.prototype,"egret.RenderTexture")}(egret||(egret={}));var egret;!function(t){var e;!function(t){var e=function(t){function e(){var e=t.call(this)||this;return e.type=3,e}return __extends(e,t),e.prototype.setLineDash=function(t){this.$commands[this.commandPosition++]=5;var e=this.dataPosition;this.$data[e++]=t,this.dataPosition=e},e}(t.Path2D);t.StrokePath=e,__reflect(e.prototype,"egret.sys.StrokePath")}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){function e(t,e){var r=null==e.italic?t.italic:e.italic,i=null==e.bold?t.bold:e.bold,n=null==e.size?t.size:e.size,o=e.fontFamily||t.fontFamily,a=r?"italic ":"normal ";return a+=i?"bold ":"normal ",a+=n+"px "+o}function r(t,e){var r=t>>16,i=t>>8&255,n=255&t;return"rgba("+r+","+i+","+n+","+e+")"}function i(e,i,n,o,a,s){var h;h=i==t.GradientType.LINEAR?e.createLinearGradient(-1,0,1,0):e.createRadialGradient(0,0,0,0,0,1);for(var c=n.length,u=0;c>u;u++)h.addColorStop(a[u]/255,r(n[u],o[u]));return h}function n(t,e,r){void 0===r&&(r=0);for(var i=0,n=e.length;n>i;i++)t[i+r]=e[i]}function o(t,e,r,i){for(var n=i[0],o=i[1],a=i[2],s=i[3],h=i[4],c=i[5],u=i[6],l=i[7],p=i[8],d=i[9],f=i[10],g=i[11],$=i[12],y=i[13],v=i[14],m=i[15],b=i[16],x=i[17],T=i[18],_=i[19],w=0,O=e*r*4;O>w;w+=4){var E=t[w+0],D=t[w+1],S=t[w+2],P=t[w+3];t[w+0]=n*E+o*D+a*S+s*P+h,t[w+1]=c*E+u*D+l*S+p*P+d,t[w+2]=f*E+g*D+$*S+y*P+v,t[w+3]=m*E+b*D+x*S+T*P+_}}function a(t,e,r,i,n){s(t,e,r,i),h(t,e,r,n)}function s(t,e,r,i){var o;o=_?new Uint8ClampedArray(4*e):new Array(4*e);for(var a=4*e,s=2*i+1,h=0;r>h;h++){for(var c=h*a,u=0,l=0,p=0,d=0,f=0,g=0,$=4*-i,y=4*i+4;y>$;$+=4){var v=c+$;c>v||v>=c+a||(f=t[v+3],u+=t[v+0]*f,l+=t[v+1]*f,p+=t[v+2]*f,d+=f)}for(var $=c,y=c+a,m=0,b=$-4*i,x=$+4*(i+1);y>$;$+=4,m+=4,x+=4,b+=4)0===d?(o[m+0]=0,o[m+1]=0,o[m+2]=0,o[m+3]=0):(o[m+0]=u/d,o[m+1]=l/d,o[m+2]=p/d,o[m+3]=d/s),f=t[x+3],g=t[b+3],f||0==f?g||0==g?(u+=t[x+0]*f-t[b+0]*g,l+=t[x+1]*f-t[b+1]*g,p+=t[x+2]*f-t[b+2]*g,d+=f-g):(u+=t[x+0]*f,l+=t[x+1]*f,p+=t[x+2]*f,d+=f):(g||0==g)&&(u+=-t[b+0]*g,l+=-t[b+1]*g,p+=-t[b+2]*g,d+=-g);_?t.set(o,c):n(t,o,c)}}function h(t,e,r,i){var n;n=_?new Uint8ClampedArray(4*r):new Array(4*r);for(var o=4*e,a=2*i+1,s=0;e>s;s++){for(var h=4*s,c=0,u=0,l=0,p=0,d=0,f=0,g=-i*o,$=i*o+o;$>g;g+=o){var y=h+g;h>y||y>=h+r*o||(d=t[y+3],c+=t[y+0]*d,u+=t[y+1]*d,l+=t[y+2]*d,p+=d)}for(var g=h,$=h+r*o,v=0,m=h-i*o,b=h+(i+1)*o;$>g;g+=o,v+=4,b+=o,m+=o)0===p?(n[v+0]=0,n[v+1]=0,n[v+2]=0,n[v+3]=0):(n[v+0]=c/p,n[v+1]=u/p,n[v+2]=l/p,n[v+3]=p/a),d=t[b+3],f=t[m+3],d||0==d?f||0==f?(c+=t[b+0]*d-t[m+0]*f,u+=t[b+1]*d-t[m+1]*f,l+=t[b+2]*d-t[m+2]*f,p+=d-f):(c+=t[b+0]*d,u+=t[b+1]*d,l+=t[b+2]*d,p+=d):(f||0==f)&&(c+=-t[m+0]*f,u+=-t[m+1]*f,l+=-t[m+2]*f,p+=-f);for(var x=4*s,$=x+r*o,T=0;$>x;x+=o,T+=4)t[x+0]=n[T+0],t[x+1]=n[T+1],t[x+2]=n[T+2],t[x+3]=n[T+3]}}function c(t,e,r,i,o,s,h,c,f){var g=u(t,i);l(g,e,r,h,c),a(g,e,r,o,s),p(g,f),d(g,t),t.set(g),_?t.set(g):n(t,g)}function u(t,e){e||(e=[0,0,0,0]);var r;_?r=new Uint8ClampedArray(t):(r=new Array(t.length),n(r,t));for(var i=e[0],o=e[1],a=e[2],s=e[3],h=0,c=r.length;c>h;h+=4){var u=r[h+3];r[h+0]=i*u,r[h+1]=o*u,r[h+2]=a*u,r[h+3]=s*u}return r}function l(t,e,r,i,o){var a,s,h=Math.sin(i)*o|0,c=Math.cos(i)*o|0;if(_){a=new Int32Array(t.buffer),s=new Int32Array(a.length);for(var u=0;r>u;u++){var l=u+h;if(!(0>l||l>r))for(var p=0;e>p;p++){var d=p+c;0>d||d>e||(s[l*e+d]=a[u*e+p])}}a.set(s)}else{a=t,s=new Array(a.length);for(var u=0;r>u;u++){var l=u+h;if(!(0>l||l>r))for(var p=0;e>p;p++){var d=p+c;0>d||d>e||(s[4*(l*e+d)+0]=a[4*(u*e+p)+0],s[4*(l*e+d)+1]=a[4*(u*e+p)+1],s[4*(l*e+d)+2]=a[4*(u*e+p)+2],s[4*(l*e+d)+3]=a[4*(u*e+p)+3])}}n(a,s)}}function p(t,e){for(var r=0,i=t.length;i>r;r+=4)t[r+3]*=e}function d(t,e){for(var r=0,i=t.length;i>r;r+=4){var n=t[r+0],o=t[r+1],a=t[r+2],s=t[r+3]/255,h=e[r+0],c=e[r+1],u=e[r+2],l=e[r+3]/255;t[r+0]=h+n*(1-l),t[r+1]=c+o*(1-l),t[r+2]=u+a*(1-l),t[r+3]=255*(l+s*(1-l))}}function f(t,e,r){return t*(1-r)+e*r}function g(t,e,r,i,o,a,s,h,c,u,l,p){var d;d=_?new Uint8ClampedArray(t.length):new Array(t.length);for(var g,$,y=i[3],v=0,m=0,b=h*Math.cos(s),x=h*Math.sin(s),T=7,w=12,O=3.141592653589793,E=o/T,D=a/T,S=0;e>S;S++)for(var P=0;r>P;P++){for(var F=0,C=P*e*4+4*S,M=0,B=0,A=t[C+0]/255,R=t[C+1]/255,N=t[C+2]/255,k=t[C+3]/255,L=0;2*O>=L;L+=2*O/w){g=Math.cos(L+F),$=Math.sin(L+F);for(var j=0;T>j;j++){v=j*E*g,m=j*D*$;var I=Math.round(S+v-b),U=Math.round(P+m-x),X=0;if(I>=e||0>I||0>U||U>=r)X=0;else{var H=U*e*4+4*I;X=t[H+3]/255}M+=(T-j)*X,B+=T-j}}k=Math.max(k,1e-4);var Y=M/B*c*y*(1-u)*Math.max(Math.min(p,l),1-k),W=(B-M)/B*c*y*u*k;k=Math.max(k*l*(1-p),1e-4);var G=W/(W+k),z=f(A,i[0],G),V=f(R,i[1],G),q=f(N,i[2],G),J=Y/(W+k+Y),K=f(z,i[0],J),Q=f(V,i[1],J),Z=f(q,i[2],J),te=Math.min(k+Y+W,1);d[C+0]=255*K,d[C+1]=255*Q,d[C+2]=255*Z,d[C+3]=255*te}_?t.set(d):n(t,d)}var $=["source-over","lighter","destination-out"],y="source-over",v="#000000",m={none:"butt",square:"square",round:"round"},b=[],x=[],T=function(){function n(){this.nestLevel=0,this.renderingMask=!1}return n.prototype.render=function(e,r,i,n){this.nestLevel++;var o=r.context;o.transform(i.a,i.b,i.c,i.d,0,0);var a=this.drawDisplayObject(e,o,i.tx,i.ty,!0),s=t.Matrix.create();if(i.$invertInto(s),o.transform(s.a,s.b,s.c,s.d,0,0),t.Matrix.release(s),this.nestLevel--,0===this.nestLevel){b.length>6&&(b.length=6);for(var h=b.length,c=0;h>c;c++)b[c].resize(0,0)}return a},n.prototype.drawDisplayObject=function(e,r,i,n,o){var a,s=0,h=e.$displayList;if(h&&!o?((e.$cacheDirty||e.$renderDirty||h.$canvasScaleX!=t.sys.DisplayList.$canvasScaleX||h.$canvasScaleY!=t.sys.DisplayList.$canvasScaleY)&&(s+=h.drawToSurface()),a=h.$renderNode):a=e.$renderDirty?e.$getRenderNode():e.$renderNode,e.$cacheDirty=!1,a){switch(s++,r.$offsetX=i,r.$offsetY=n,a.type){case 1:this.renderBitmap(a,r);break;case 2:this.renderText(a,r);break;case 3:this.renderGraphics(a,r);break;case 4:this.renderGroup(a,r);break;case 5:this.renderMesh(a,r);break;case 6:this.renderNormalBitmap(a,r)}r.$offsetX=0,r.$offsetY=0}if(h&&!o)return s;var c=e.$children;if(c)for(var u=c.length,l=0;u>l;l++){var p=c[l],d=void 0,f=void 0;if(p.$useTranslate){var g=p.$getMatrix();d=i+p.$x,f=n+p.$y,r.save(),r.transform(g.a,g.b,g.c,g.d,d,f),d=-p.$anchorOffsetX,f=-p.$anchorOffsetY}else d=i+p.$x-p.$anchorOffsetX,f=n+p.$y-p.$anchorOffsetY;var $=void 0;switch(1!=p.$alpha&&($=r.globalAlpha,r.globalAlpha*=p.$alpha),p.$renderMode){case 1:break;case 2:s+=this.drawWithFilter(p,r,d,f);break;case 3:s+=this.drawWithClip(p,r,d,f);break;case 4:s+=this.drawWithScrollRect(p,r,d,f);break;default:s+=this.drawDisplayObject(p,r,d,f)}p.$useTranslate?r.restore():$&&(r.globalAlpha=$)}return s},n.prototype.drawWithFilter=function(e,r,i,n){if(t.Capabilities.runtimeType==t.RuntimeType.NATIVE)return this.drawWithFilterNative(e,r,i,n);var s,h=0,u=e.$filters,l=u.length,p=0!==e.$blendMode;p&&(s=$[e.$blendMode],s||(s=y));var d=e.$getOriginalBounds();if(d.width<=0||d.height<=0)return h;var f=this.createRenderBuffer(d.width,d.height,!0),v=f.context;if(h+=e.$mask?this.drawWithClip(e,r,i,n):e.$scrollRect||e.$maskRect?this.drawWithScrollRect(e,r,i,n):this.drawDisplayObject(e,r,i,n),h>0){p&&(r.globalCompositeOperation=s),h++;for(var m=v.getImageData(0,0,f.surface.width,f.surface.height),b=0;l>b;b++){var T=u[b];if("colorTransform"==T.type)o(m.data,f.surface.width,f.surface.height,T.$matrix);else if("blur"==T.type)a(m.data,f.surface.width,f.surface.height,T.$blurX,T.$blurY);else if("glow"==T.type){var _=T.$red,w=T.$green,O=T.$blue,E=T.$alpha;T.$inner||T.$knockout||T.$hideObject?g(m.data,f.surface.width,f.surface.height,[_/255,w/255,O/255,E],T.$blurX,T.$blurY,T.$angle?T.$angle/180*Math.PI:0,T.$distance||0,T.$strength,T.$inner?1:0,T.$knockout?0:1,T.$hideObject?1:0):c(m.data,f.surface.width,f.surface.height,[_/255,w/255,O/255,E],T.$blurX,T.$blurY,T.$angle?T.$angle/180*Math.PI:0,T.$distance||0,T.$strength)}else"custom"==T.type}v.putImageData(m,0,0),r.globalAlpha=1,r.drawImage(f.surface,i+d.x,n+d.y),p&&(r.globalCompositeOperation=y)}return x.push(f),h},n.prototype.drawWithFilterNative=function(t,e,r,i){var n,o=0,a=t.$filters,s=0!==t.$blendMode;s&&(n=$[t.$blendMode],n||(n=y));var h=t.$getOriginalBounds();if(h.width<=0||h.height<=0)return o;if(1==a.length&&"colorTransform"==a[0].type&&!t.$children)return s&&(e.globalCompositeOperation=n),e.setGlobalShader(a[0]),o+=t.$mask?this.drawWithClip(t,e,r,i):t.$scrollRect||t.$maskRect?this.drawWithScrollRect(t,e,r,i):this.drawDisplayObject(t,e,r,i),e.setGlobalShader(null),s&&(e.globalCompositeOperation=y),o;var c=this.createRenderBuffer(h.width,h.height);return o+=t.$mask?this.drawWithClip(t,e,r,i):t.$scrollRect||t.$maskRect?this.drawWithScrollRect(t,e,r,i):this.drawDisplayObject(t,e,r,i),o>0&&(s&&(e.globalCompositeOperation=n),o++,e.globalAlpha=1,e.setGlobalShader(a[0]),e.drawImage(c.surface,0,0,c.width,c.height,r+h.x,i+h.y,c.width,c.height),e.setGlobalShader(null),s&&(e.globalCompositeOperation=y)),b.push(c),o},n.prototype.drawWithClip=function(e,r,i,n){var o,a=0,s=0!==e.$blendMode;s&&(o=$[e.$blendMode],o||(o=y));var h=e.$scrollRect?e.$scrollRect:e.$maskRect,c=e.$mask;if(c){var u=c.$getMatrix();if(0==u.a&&0==u.b||0==u.c&&0==u.d)return a}if(!(c||e.$children&&0!=e.$children.length))return h&&(r.save(),r.beginPath(),r.rect(h.x+i,h.y+n,h.width,h.height),r.clip()),s&&(r.globalCompositeOperation=o),a+=this.drawDisplayObject(e,r,i,n),s&&(r.globalCompositeOperation=y),h&&r.restore(),a;var l=c.$getRenderNode();if(c&&t.Capabilities.$runtimeType==t.RuntimeType.WEB&&(!c.$children||0==c.$children.length)&&l&&3==l.type&&1==l.drawData.length&&1==l.drawData[0].type&&1==l.drawData[0].fillAlpha){this.renderingMask=!0,r.save();var p=t.Matrix.create();p.copyFrom(c.$getConcatenatedMatrix()),c.$getConcatenatedMatrixAt(e,p),r.transform(p.a,p.b,p.c,p.d,p.tx,p.ty);var d=this.drawDisplayObject(c,r,i,n);return this.renderingMask=!1,p.$invertInto(p),r.transform(p.a,p.b,p.c,p.d,p.tx,p.ty),t.Matrix.release(p),h&&(r.beginPath(),r.rect(h.x+i,h.y+n,h.width,h.height),r.clip()),d+=this.drawDisplayObject(e,r,i,n),r.restore(),d}var f=e.$getOriginalBounds(),g=this.createRenderBuffer(f.width,f.height),v=g.context;if(!v)return a+=this.drawDisplayObject(e,r,i,n);if(a+=this.drawDisplayObject(e,v,0,0),c){var p=t.Matrix.create();if(p.copyFrom(c.$getConcatenatedMatrix()),c.$getConcatenatedMatrixAt(e,p),t.Capabilities.$runtimeType==t.RuntimeType.WEB&&l&&1==l.$getRenderCount()||c.$displayList)v.globalCompositeOperation="destination-in",v.save(),v.setTransform(p.a,p.b,p.c,p.d,p.tx,p.ty),a+=this.drawDisplayObject(c,v,0,0),v.restore();else{var m=this.createRenderBuffer(f.width,f.height),x=m.context;x.setTransform(p.a,p.b,p.c,p.d,p.tx,p.ty),a+=this.drawDisplayObject(c,x,-f.x,-f.y),v.globalCompositeOperation="destination-in",v.globalAlpha=1,v.drawImage(m.surface,0,0),b.push(m)}t.Matrix.release(p)}return a>0&&(a++,s&&(r.globalCompositeOperation=o),h&&(r.save(),r.beginPath(),r.rect(h.x+i,h.y+n,h.width,h.height),r.clip()),r.globalAlpha=1,r.drawImage(g.surface,i+f.x,n+f.y),h&&r.restore(),s&&(r.globalCompositeOperation=y)),b.push(g),a},n.prototype.drawWithScrollRect=function(t,e,r,i){var n=0,o=t.$scrollRect?t.$scrollRect:t.$maskRect;return o.isEmpty()?n:(t.$scrollRect&&(r-=o.x,i-=o.y),e.save(),e.beginPath(),e.rect(o.x+r,o.y+i,o.width,o.height),e.clip(),n+=this.drawDisplayObject(t,e,r,i),e.restore(),n)},n.prototype.drawNodeToBuffer=function(t,e,r,i){var n=e.context;n.setTransform(r.a,r.b,r.c,r.d,r.tx,r.ty),this.renderNode(t,n,i)},n.prototype.drawDisplayToBuffer=function(t,e,r){var i=e.context;r&&i.setTransform(r.a,r.b,r.c,r.d,r.tx,r.ty);var n;n=t.$renderDirty?t.$getRenderNode():t.$renderNode;var o=0;if(n)switch(o++,n.type){case 1:this.renderBitmap(n,i);break;case 2:this.renderText(n,i);break;case 3:this.renderGraphics(n,i);break;case 4:this.renderGroup(n,i);break;case 5:this.renderMesh(n,i);break;case 6:this.renderNormalBitmap(n,i)}var a=t.$children;if(a)for(var s=a.length,h=0;s>h;h++){var c=a[h];switch(c.$renderMode){case 1:break;case 2:o+=this.drawWithFilter(c,i,0,0);break;case 3:o+=this.drawWithClip(c,i,0,0);break;case 4:o+=this.drawWithScrollRect(c,i,0,0);break;default:o+=this.drawDisplayObject(c,i,0,0)}}return o},n.prototype.renderNode=function(t,e,r){var i=0;switch(t.type){case 1:i=this.renderBitmap(t,e);break;case 2:i=1,this.renderText(t,e);break;case 3:i=this.renderGraphics(t,e,r);break;case 4:i=this.renderGroup(t,e);break;case 5:i=this.renderMesh(t,e);break;case 6:i+=this.renderNormalBitmap(t,e)}return i},n.prototype.renderNormalBitmap=function(t,e){var r=t.image;if(!r||!r.source)return 0;if(e.$imageSmoothingEnabled!=t.smoothing&&(e.imageSmoothingEnabled=t.smoothing,e.$imageSmoothingEnabled=t.smoothing),t.rotated){var i=t.sourceX,n=t.sourceY,o=t.sourceW,a=t.sourceH,s=t.drawX,h=t.drawY,c=t.drawW,u=t.drawH;e.saveTransform?e.saveTransform():e.save(),e.transform(0,-1,1,0,0,u),e.drawImage(r.source,i,n,a,o,s+e.$offsetX,h+e.$offsetY,u,c),e.restoreTransform?e.restoreTransform():e.restore()}else e.drawImage(r.source,t.sourceX,t.sourceY,t.sourceW,t.sourceH,t.drawX+e.$offsetX,t.drawY+e.$offsetY,t.drawW,t.drawH);return 1},n.prototype.renderBitmap=function(e,r){var i=e.image;if(!i||!i.source)return 0;r.$imageSmoothingEnabled!=e.smoothing&&(r.imageSmoothingEnabled=e.smoothing,r.$imageSmoothingEnabled=e.smoothing);var n,a,s=e.drawData,h=s.length,c=0,u=e.matrix,l=e.blendMode,p=e.alpha,d=!1;u&&(r.saveTransform?r.saveTransform():r.save(),d=!0,(0!=r.$offsetX||0!=r.$offsetY)&&(r.translate(r.$offsetX,r.$offsetY),n=r.$offsetX,a=r.$offsetY,r.$offsetX=r.$offsetY=0),r.transform(u.a,u.b,u.c,u.d,u.tx,u.ty)),l&&(r.globalCompositeOperation=$[l]);var f;p==p&&(f=r.globalAlpha,r.globalAlpha*=p);var g=0,v=e.filter;if(v&&8==h)if(t.Capabilities.runtimeType==t.RuntimeType.NATIVE){if(egret_native.Graphics.setGlobalShader(v),g++,e.rotated){var m=s[0],x=s[1],T=s[2],_=s[3],w=s[4],O=s[5],E=s[6],D=s[7];r.saveTransform?r.saveTransform():r.save(),r.transform(0,-1,1,0,0,D),r.drawImage(i.source,m,x,_,T,w+r.$offsetX,O+r.$offsetY,D,E),r.restoreTransform?r.restoreTransform():r.restore()}else r.drawImage(i.source,s[0],s[1],s[2],s[3],s[4]+r.$offsetX,s[5]+r.$offsetY,s[6],s[7]);egret_native.Graphics.setGlobalShader(null)}else{var m=s[0],x=s[1],_=s[2],T=s[3],S=s[4],P=s[5],D=s[6],E=s[7];e.rotated&&(_=s[3],T=s[2],D=s[7],E=s[6]);var F=this.createRenderBuffer(D,E),C=F.context;g++,e.rotated&&r.transform(0,-1,1,0,0,D),C.drawImage(i.source,m,x,_,T,0,0,D,E),g++;var M=C.getImageData(0,0,D,E);o(M.data,D,E,v.$matrix),C.putImageData(M,0,0),r.drawImage(F.surface,0,0,D,E,S+r.$offsetX,P+r.$offsetY,D,E),b.push(F)}else for(;h>c;)if(g++,e.rotated){var m=s[c++],x=s[c++],T=s[c++],_=s[c++],B=s[c++],A=s[c++],E=s[c++],D=s[c++];r.saveTransform?r.saveTransform():r.save(),r.transform(0,-1,1,0,0,D),r.drawImage(i.source,m,x,_,T,B+r.$offsetX,A+r.$offsetY,D,E),r.restoreTransform?r.restoreTransform():r.restore()}else r.drawImage(i.source,s[c++],s[c++],s[c++],s[c++],s[c++]+r.$offsetX,s[c++]+r.$offsetY,s[c++],s[c++]);return d?r.restoreTransform?(r.restoreTransform(),l&&(r.globalCompositeOperation=y),p==p&&(r.globalAlpha=f)):r.restore():(l&&(r.globalCompositeOperation=y),p==p&&(r.globalAlpha=f)),n&&(r.$offsetX=n),a&&(r.$offsetY=a),g},n.prototype.renderMesh=function(e,r){if(t.Capabilities.runtimeType!=t.RuntimeType.NATIVE)return 0;var i,n,o=e.image,a=e.drawData,s=a.length,h=0,c=e.matrix,u=e.blendMode,l=e.alpha;c&&(r.saveTransform(),(0!=r.$offsetX||0!=r.$offsetY)&&(r.translate(r.$offsetX,r.$offsetY),i=r.$offsetX,n=r.$offsetY,r.$offsetX=r.$offsetY=0),r.transform(c.a,c.b,c.c,c.d,c.tx,c.ty)),u&&(r.globalCompositeOperation=$[u]);var p;l==l&&(p=r.globalAlpha,r.globalAlpha*=l);var d=0,f=e.filter;if(f){for(egret_native.Graphics.setGlobalShader(f);s>h;)d++,r.drawMesh(o.source,a[h++],a[h++],a[h++],a[h++],a[h++]+r.$offsetX,a[h++]+r.$offsetY,a[h++],a[h++],e.imageWidth,e.imageHeight,e.uvs,e.vertices,e.indices,e.bounds);egret_native.Graphics.setGlobalShader(null)}else for(;s>h;)d++,r.drawMesh(o.source,a[h++],a[h++],a[h++],a[h++],a[h++]+r.$offsetX,a[h++]+r.$offsetY,a[h++],a[h++],e.imageWidth,e.imageHeight,e.uvs,e.vertices,e.indices,e.bounds);return c&&r.restoreTransform(),u&&(r.globalCompositeOperation=y),l==l&&(r.globalAlpha=p),i&&(r.$offsetX=i),n&&(r.$offsetY=n),1},n.prototype.renderText=function(r,i){i.textAlign="left",i.textBaseline="middle",i.lineJoin="round";for(var n=r.drawData,o=n.length,a=0;o>a;){var s=n[a++],h=n[a++],c=n[a++],u=n[a++];i.font=e(r,u);var l=null==u.textColor?r.textColor:u.textColor,p=null==u.strokeColor?r.strokeColor:u.strokeColor,d=null==u.stroke?r.stroke:u.stroke;i.fillStyle=t.toColorString(l),i.strokeStyle=t.toColorString(p),d&&(i.lineWidth=2*d,i.strokeText(c,s+i.$offsetX,h+i.$offsetY)),i.fillText(c,s+i.$offsetX,h+i.$offsetY)}},n.prototype.renderGraphics=function(t,e,n){var o=t.drawData,a=o.length;n=!!n;for(var s=0;a>s;s++){var h=o[s];switch(h.type){case 1:var c=h;e.fillStyle=n?v:r(c.fillColor,c.fillAlpha),this.renderPath(h,e),this.renderingMask?e.clip():e.fill();break;case 2:var u=h;e.fillStyle=n?v:i(e,u.gradientType,u.colors,u.alphas,u.ratios,u.matrix),e.save();var l=u.matrix;this.renderPath(h,e),e.transform(l.a,l.b,l.c,l.d,l.tx,l.ty),e.fill(),e.restore();break;case 3:var p=h,d=p.lineWidth;e.lineWidth=d,e.strokeStyle=n?v:r(p.lineColor,p.lineAlpha),e.lineCap=m[p.caps],e.lineJoin=p.joints,e.miterLimit=p.miterLimit;var f=1===d||3===d;f&&e.translate(.5,.5),this.renderPath(h,e),e.stroke(),f&&e.translate(-.5,-.5)}}return 0==a?0:1},n.prototype.renderPath=function(t,e){e.beginPath();for(var r=t.$data,i=t.$commands,n=i.length,o=0,a=0;n>a;a++){var s=i[a];switch(s){case 4:e.bezierCurveTo(r[o++]+e.$offsetX,r[o++]+e.$offsetY,r[o++]+e.$offsetX,r[o++]+e.$offsetY,r[o++]+e.$offsetX,r[o++]+e.$offsetY);break;case 3:e.quadraticCurveTo(r[o++]+e.$offsetX,r[o++]+e.$offsetY,r[o++]+e.$offsetX,r[o++]+e.$offsetY);break;case 2:e.lineTo(r[o++]+e.$offsetX,r[o++]+e.$offsetY);break;case 1:e.moveTo(r[o++]+e.$offsetX,r[o++]+e.$offsetY);break;case 5:e.setLineDash(r[o++])}}},n.prototype.renderGroup=function(t,e){var r,i,n=t.matrix,o=!1;n&&(e.saveTransform?e.saveTransform():e.save(),o=!0,(0!=e.$offsetX||0!=e.$offsetY)&&(e.translate(e.$offsetX,e.$offsetY),r=e.$offsetX,i=e.$offsetY,e.$offsetX=e.$offsetY=0),e.transform(n.a,n.b,n.c,n.d,n.tx,n.ty));for(var a=0,s=t.drawData,h=s.length,c=0;h>c;c++){var u=s[c];a+=this.renderNode(u,e)}return o&&(e.restoreTransform?e.restoreTransform():e.restore()),r&&(e.$offsetX=r),i&&(e.$offsetY=i),a},n.prototype.createRenderBuffer=function(e,r,i){var n=i?x.pop():b.pop();return n?n.resize(e,r,!0):n=new t.sys.CanvasRenderBuffer(e,r),n},n}();t.CanvasRenderer=T,__reflect(T.prototype,"egret.CanvasRenderer");var _=!1;try{_=void 0!==typeof Uint8ClampedArray}catch(w){}}(egret||(egret={}));var egret;!function(t){t.DeviceOrientation=null}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.WEB="web",t.NATIVE="native",t
}();t.RuntimeType=e,__reflect(e.prototype,"egret.RuntimeType");var r=function(){function t(){}return Object.defineProperty(t,"language",{get:function(){return t.$language},enumerable:!0,configurable:!0}),Object.defineProperty(t,"isMobile",{get:function(){return t.$isMobile},enumerable:!0,configurable:!0}),Object.defineProperty(t,"os",{get:function(){return t.$os},enumerable:!0,configurable:!0}),Object.defineProperty(t,"runtimeType",{get:function(){return t.$runtimeType},enumerable:!0,configurable:!0}),Object.defineProperty(t,"supportVersion",{get:function(){return t.$supportVersion},enumerable:!0,configurable:!0}),Object.defineProperty(t,"engineVersion",{get:function(){return"5.1.0"},enumerable:!0,configurable:!0}),t.$setNativeCapabilities=function(e){var r=e.split("-");if(r.length<=4){var i=r[0];switch(i){case"android":i="Android";break;case"ios":i="iOS"}t.$os=i;var n=r[2].substring(1,r[2].length);t.$supportVersion=n}},Object.defineProperty(t,"renderMode",{get:function(){return t.$renderMode},enumerable:!0,configurable:!0}),Object.defineProperty(t,"boundingClientWidth",{get:function(){return t.$boundingClientWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t,"boundingClientHeight",{get:function(){return t.$boundingClientHeight},enumerable:!0,configurable:!0}),t.$language="zh-CN",t.$os="Unknown",t.$runtimeType="Unknown",t.$supportVersion="Unknown",t.$renderMode="Unknown",t.$boundingClientWidth=0,t.$boundingClientHeight=0,t}();t.Capabilities=r,__reflect(r.prototype,"egret.Capabilities")}(egret||(egret={}));var testDeviceType=function(){if(!this.navigator)return!0;var t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("mobile")||-1!=t.indexOf("android")},testRuntimeType=function(){return this.navigator?!0:!1};egret.Capabilities.$isMobile=testDeviceType(),egret.Capabilities.$runtimeType=testRuntimeType()?egret.RuntimeType.WEB:egret.RuntimeType.NATIVE;var egret;!function(t){var e=function(e){function r(){var r=e.call(this)||this;return r.$graphics=new t.Graphics,r.$graphics.$setTarget(r),r}return __extends(r,e),Object.defineProperty(r.prototype,"graphics",{get:function(){return this.$graphics},enumerable:!0,configurable:!0}),r.prototype.$measureContentBounds=function(t){this.$graphics.$measureContentBounds(t)},r.prototype.$hitTest=function(t,r){var i=e.prototype.$hitTest.call(this,t,r);return i==this&&(i=this.$graphics.$hitTest(t,r)),i},r.prototype.$onRemoveFromStage=function(){e.prototype.$onRemoveFromStage.call(this),this.$graphics&&this.$graphics.$onRemoveFromStage()},r}(t.DisplayObject);t.Shape=e,__reflect(e.prototype,"egret.Shape")}(egret||(egret={}));var egret;!function(t){function e(t,e){i[t]=e}function r(t){return i[t]}var i={};t.registerImplementation=e,t.getImplementation=r}(egret||(egret={}));var egret;!function(t){var e=function(t){function e(e,r){var i=t.call(this,e)||this;return i.firstCharHeight=0,"string"==typeof r?i.charList=i.parseConfig(r):r&&r.hasOwnProperty("frames")?i.charList=r.frames:i.charList={},i}return __extends(e,t),e.prototype.getTexture=function(t){var e=this._textureMap[t];if(!e){var r=this.charList[t];if(!r)return null;e=this.createTexture(t,r.x,r.y,r.w,r.h,r.offX,r.offY,r.sourceW,r.sourceH),this._textureMap[t]=e}return e},e.prototype.getConfig=function(t,e){return this.charList[t]?this.charList[t][e]:0},e.prototype._getFirstCharHeight=function(){if(0==this.firstCharHeight)for(var t in this.charList){var e=this.charList[t];if(e){var r=e.sourceH;if(void 0===r){var i=e.h;void 0===i&&(i=0);var n=e.offY;void 0===n&&(n=0),r=i+n}if(0>=r)continue;this.firstCharHeight=r;break}}return this.firstCharHeight},e.prototype.parseConfig=function(t){t=t.split("\r\n").join("\n");for(var e=t.split("\n"),r=this.getConfigByKey(e[3],"count"),i={},n=4;4+r>n;n++){var o=e[n],a=String.fromCharCode(this.getConfigByKey(o,"id")),s={};i[a]=s,s.x=this.getConfigByKey(o,"x"),s.y=this.getConfigByKey(o,"y"),s.w=this.getConfigByKey(o,"width"),s.h=this.getConfigByKey(o,"height"),s.offX=this.getConfigByKey(o,"xoffset"),s.offY=this.getConfigByKey(o,"yoffset"),s.xadvance=this.getConfigByKey(o,"xadvance")}return i},e.prototype.getConfigByKey=function(t,e){for(var r=t.split(" "),i=0,n=r.length;n>i;i++){var o=r[i];if(e==o.substring(0,e.length)){var a=o.substring(e.length+1);return parseInt(a)}}return 0},e}(t.SpriteSheet);t.BitmapFont=e,__reflect(e.prototype,"egret.BitmapFont")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var r=e.call(this)||this;return r.$textOffsetX=0,r.$textOffsetY=0,r.$textStartX=0,r.$textStartY=0,r.textLines=[],r.$lineHeights=[],r.$renderNode=new t.sys.BitmapNode,r.$BitmapText={0:0/0,1:0/0,2:"",3:0,4:0,5:null,6:!1,7:!1,8:!1,9:!1,10:"left",11:"top",12:t.Bitmap.defaultSmoothing},r}return __extends(r,e),Object.defineProperty(r.prototype,"smoothing",{get:function(){var t=this.$BitmapText;return t[12]},set:function(t){t=!!t;var e=this.$BitmapText;t!=e[12]&&(e[12]=t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"text",{get:function(){return this.$BitmapText[2]},set:function(t){this.$setText(t)},enumerable:!0,configurable:!0}),r.prototype.$setText=function(t){null==t&&(t=""),t=String(t);var e=this.$BitmapText;return t==e[2]?!1:(e[2]=t,this.$invalidateBitmapText(),!0)},r.prototype.$getWidth=function(){var t=this.$BitmapText[0];return isNaN(t)?this.$getContentBounds().width:t},r.prototype.$setWidth=function(t){var e=this.$BitmapText;return 0>t||t==e[0]?!1:(e[0]=t,this.$invalidateBitmapText(),!0)},r.prototype.$invalidateBitmapText=function(){var t=this;t.$renderDirty=!0,t.$BitmapText[7]=!0;var e=t.$parent;e&&!e.$cacheDirty&&(e.$cacheDirty=!0,e.$cacheDirtyUp());var r=t.$maskedObject;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp())},r.prototype.$getHeight=function(){var t=this.$BitmapText[1];return isNaN(t)?this.$getContentBounds().height:t},r.prototype.$setHeight=function(t){var e=this.$BitmapText;return 0>t||t==e[1]?!1:(e[1]=t,this.$invalidateBitmapText(),!0)},Object.defineProperty(r.prototype,"font",{get:function(){return this.$BitmapText[5]},set:function(t){this.$setFont(t)},enumerable:!0,configurable:!0}),r.prototype.$setFont=function(t){var e=this.$BitmapText;return e[5]==t?!1:(e[5]=t,this.$BitmapText[6]=!0,this.$invalidateBitmapText(),!0)},Object.defineProperty(r.prototype,"lineSpacing",{get:function(){return this.$BitmapText[3]},set:function(t){this.$setLineSpacing(t)},enumerable:!0,configurable:!0}),r.prototype.$setLineSpacing=function(t){t=+t||0;var e=this.$BitmapText;return e[3]==t?!1:(e[3]=t,this.$invalidateBitmapText(),!0)},Object.defineProperty(r.prototype,"letterSpacing",{get:function(){return this.$BitmapText[4]},set:function(t){this.$setLetterSpacing(t)},enumerable:!0,configurable:!0}),r.prototype.$setLetterSpacing=function(t){t=+t||0;var e=this.$BitmapText;return e[4]==t?!1:(e[4]=t,this.$invalidateBitmapText(),!0)},Object.defineProperty(r.prototype,"textAlign",{get:function(){return this.$BitmapText[10]},set:function(t){this.$setTextAlign(t)},enumerable:!0,configurable:!0}),r.prototype.$setTextAlign=function(t){var e=this.$BitmapText;return e[10]==t?!1:(e[10]=t,this.$invalidateBitmapText(),!0)},Object.defineProperty(r.prototype,"verticalAlign",{get:function(){return this.$BitmapText[11]},set:function(t){this.$setVerticalAlign(t)},enumerable:!0,configurable:!0}),r.prototype.$setVerticalAlign=function(t){var e=this.$BitmapText;return e[11]==t?!1:(e[11]=t,this.$invalidateBitmapText(),!0)},r.prototype.$updateRenderNode=function(){var e=this.$BitmapText,i=this.$getTextLines(),n=i.length;if(0!=n){var o=this.$textLinesWidth,a=e[5],s=this.$renderNode;a.$texture&&(s.image=a.$texture.$bitmapData),s.smoothing=e[12];for(var h=a._getFirstCharHeight(),c=Math.ceil(h*r.EMPTY_FACTOR),u=!isNaN(e[1]),l=e[8],p=e[0],d=e[1],f=e[10],g=this.$textOffsetY+this.$textStartY,$=this.$lineHeights,y=0;n>y;y++){var v=$[y];if(u&&y>0&&g+v>d)break;var m=i[y],b=m.length,x=this.$textOffsetX;if(f!=t.HorizontalAlign.LEFT){var T=p>l?p:l;f==t.HorizontalAlign.RIGHT?x+=T-o[y]:f==t.HorizontalAlign.CENTER&&(x+=Math.floor((T-o[y])/2))}for(var _=0;b>_;_++){var w=m.charAt(_),O=a.getTexture(w);if(O){var E=O.$bitmapWidth,D=O.$bitmapHeight;s.imageWidth=O.$sourceWidth,s.imageHeight=O.$sourceHeight,s.drawImage(O.$bitmapX,O.$bitmapY,E,D,x+O.$offsetX,g+O.$offsetY,O.$getScaleBitmapWidth(),O.$getScaleBitmapHeight()),x+=(a.getConfig(w,"xadvance")||O.$getTextureWidth())+e[4]}else" "==w?x+=c:t.$warn(1046,w)}g+=v+e[3]}}},r.prototype.$measureContentBounds=function(t){var e=this.$getTextLines();0==e.length?t.setEmpty():t.setTo(this.$textOffsetX+this.$textStartX,this.$textOffsetY+this.$textStartY,this.$BitmapText[8]-this.$textOffsetX,this.$BitmapText[9]-this.$textOffsetY)},Object.defineProperty(r.prototype,"textWidth",{get:function(){return this.$getTextLines(),this.$BitmapText[8]},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textHeight",{get:function(){return this.$getTextLines(),this.$BitmapText[9]},enumerable:!0,configurable:!0}),r.prototype.$getTextLines=function(){function e(t){return m&&n.length>0&&f>m?!1:(f+=c+l,s||h||(u-=p),n.push(t),a.push(c),o.push(u),d=Math.max(u,d),!0)}var i=this.$BitmapText;if(!i[7])return this.textLines;var n=[];this.textLines=n;var o=[];this.$textLinesWidth=o,i[7]=!1;var a=[];if(this.$lineHeights=a,!i[2]||!i[5])return n;for(var s,h,c,u,l=i[3],p=i[4],d=0,f=0,g=0,$=0,y=!isNaN(i[0]),v=i[0],m=i[1],b=i[5],x=b._getFirstCharHeight(),T=Math.ceil(x*r.EMPTY_FACTOR),_=i[2],w=_.split(/(?:\r\n|\r|\n)/),O=w.length,E=!0,D=0;O>D;D++){var S=w[D],P=S.length;c=0,u=0,s=!0,h=!1;for(var F=0;P>F;F++){s||(u+=p);var C=S.charAt(F),M=void 0,B=void 0,A=0,R=0,N=b.getTexture(C);if(N)M=N.$getTextureWidth(),B=N.$getTextureHeight(),A=N.$offsetX,R=N.$offsetY;else{if(" "!=C){t.$warn(1046,C),s&&(s=!1);continue}M=T,B=x}if(s&&(s=!1,g=Math.min(A,g)),E&&(E=!1,$=Math.min(R,$)),y&&F>0&&u+M>v){if(!e(S.substring(0,F)))break;S=S.substring(F),P=S.length,F=0,u=F==P-1?M:b.getConfig(C,"xadvance")||M,c=B}else u+=F==P-1?M:b.getConfig(C,"xadvance")||M,c=Math.max(B,c)}if(m&&D>0&&f>m)break;if(h=!0,!e(S))break}f-=l,i[8]=d,i[9]=f,this.$textOffsetX=g,this.$textOffsetY=$,this.$textStartX=0,this.$textStartY=0;var k;return v>d&&(k=i[10],k==t.HorizontalAlign.RIGHT?this.$textStartX=v-d:k==t.HorizontalAlign.CENTER&&(this.$textStartX=Math.floor((v-d)/2))),m>f&&(k=i[11],k==t.VerticalAlign.BOTTOM?this.$textStartY=m-f:k==t.VerticalAlign.MIDDLE&&(this.$textStartY=Math.floor((m-f)/2))),n},r.EMPTY_FACTOR=.33,r}(t.DisplayObject);t.BitmapText=e,__reflect(e.prototype,"egret.BitmapText")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.LEFT="left",t.RIGHT="right",t.CENTER="center",t.JUSTIFY="justify",t.CONTENT_JUSTIFY="contentJustify",t}();t.HorizontalAlign=e,__reflect(e.prototype,"egret.HorizontalAlign")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){this.replaceArr=[],this.resutlArr=[],this.initReplaceArr()}return e.prototype.initReplaceArr=function(){this.replaceArr=[],this.replaceArr.push([/</g,"<"]),this.replaceArr.push([/>/g,">"]),this.replaceArr.push([/&/g,"&"]),this.replaceArr.push([/"/g,'"']),this.replaceArr.push([/'/g,"'"])},e.prototype.replaceSpecial=function(t){for(var e=0;e<this.replaceArr.length;e++){var r=this.replaceArr[e][0],i=this.replaceArr[e][1];t=t.replace(r,i)}return t},e.prototype.parse=function(e){this.stackArray=[],this.resutlArr=[];for(var r=0,i=e.length;i>r;){var n=e.indexOf("<",r);if(0>n)this.addToResultArr(e.substring(r)),r=i;else{this.addToResultArr(e.substring(r,n));var o=e.indexOf(">",n);-1==o?(t.$error(1038),o=n):"/"==e.charAt(n+1)?this.stackArray.pop():this.addToArray(e.substring(n+1,o)),r=o+1}}return this.resutlArr},e.prototype.parser=function(t){return this.parse(t)},e.prototype.addToResultArr=function(t){""!=t&&(t=this.replaceSpecial(t),this.stackArray.length>0?this.resutlArr.push({text:t,style:this.stackArray[this.stackArray.length-1]}):this.resutlArr.push({text:t}))},e.prototype.changeStringToObject=function(t){t=t.trim();var e={},r=[];if("i"==t.charAt(0)||"b"==t.charAt(0)||"u"==t.charAt(0))this.addProperty(e,t,"true");else if(r=t.match(/^(font|a)\s/)){t=t.substring(r[0].length).trim();for(var i=0,n=void 0;n=t.match(this.getHeadReg());){var o=n[0],a="";t=t.substring(o.length).trim(),'"'==t.charAt(0)?(i=t.indexOf('"',1),a=t.substring(1,i),i+=1):"'"==t.charAt(0)?(i=t.indexOf("'",1),a=t.substring(1,i),i+=1):(a=t.match(/(\S)+/)[0],i=a.length),this.addProperty(e,o.substring(0,o.length-1).trim(),a.trim()),t=t.substring(i).trim()}}return e},e.prototype.getHeadReg=function(){return/^(color|textcolor|strokecolor|stroke|b|bold|i|italic|u|size|fontfamily|href|target)(\s)*=/},e.prototype.addProperty=function(t,e,r){switch(e.toLowerCase()){case"color":case"textcolor":r=r.replace(/#/,"0x"),t.textColor=parseInt(r);break;case"strokecolor":r=r.replace(/#/,"0x"),t.strokeColor=parseInt(r);break;case"stroke":t.stroke=parseInt(r);break;case"b":case"bold":t.bold="true"==r;break;case"u":t.underline="true"==r;break;case"i":case"italic":t.italic="true"==r;break;case"size":t.size=parseInt(r);break;case"fontfamily":t.fontFamily=r;break;case"href":t.href=this.replaceSpecial(r);break;case"target":t.target=this.replaceSpecial(r)}},e.prototype.addToArray=function(t){var e=this.changeStringToObject(t);if(0==this.stackArray.length)this.stackArray.push(e);else{var r=this.stackArray[this.stackArray.length-1];for(var i in r)null==e[i]&&(e[i]=r[i]);this.stackArray.push(e)}},e}();t.HtmlTextParser=e,__reflect(e.prototype,"egret.HtmlTextParser")}(egret||(egret={}));var egret;!function(t){var e=function(e){function r(){var t=e.call(this)||this;return t.stageTextAdded=!1,t._text=null,t._isFocus=!1,t}return __extends(r,e),r.prototype.init=function(e){this._text=e,this.stageText=new t.StageText,this.stageText.$setTextField(this._text)},r.prototype._addStageText=function(){this.stageTextAdded||(this._text.$inputEnabled||(this._text.$touchEnabled=!0),this.tempStage=this._text.stage,this.stageText.$addToStage(),this.stageText.addEventListener("updateText",this.updateTextHandler,this),this._text.addEventListener(t.TouchEvent.TOUCH_BEGIN,this.onMouseDownHandler,this),this.stageText.addEventListener("blur",this.blurHandler,this),this.stageText.addEventListener("focus",this.focusHandler,this),this.stageTextAdded=!0)},r.prototype._removeStageText=function(){this.stageTextAdded&&(this._text.$inputEnabled||(this._text.$touchEnabled=!1),this.stageText.$removeFromStage(),this.stageText.removeEventListener("updateText",this.updateTextHandler,this),this._text.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onMouseDownHandler,this),this.tempStage.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onStageDownHandler,this),this.stageText.removeEventListener("blur",this.blurHandler,this),this.stageText.removeEventListener("focus",this.focusHandler,this),this.stageTextAdded=!1)},r.prototype._getText=function(){return this.stageText.$getText()},r.prototype._setText=function(t){this.stageText.$setText(t)},r.prototype._setColor=function(t){this.stageText.$setColor(t)},r.prototype.focusHandler=function(e){this._isFocus||(this._isFocus=!0,e.showing||(this._text.$isTyping=!0,this._text.$invalidateTextField()),this._text.dispatchEvent(new t.FocusEvent(t.FocusEvent.FOCUS_IN,!0)))},r.prototype.blurHandler=function(e){this._isFocus&&(this._isFocus=!1,this.tempStage.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onStageDownHandler,this),this._text.$isTyping=!1,this._text.$invalidateTextField(),this.stageText.$onBlur(),this._text.dispatchEvent(new t.FocusEvent(t.FocusEvent.FOCUS_OUT,!0)))},r.prototype.onMouseDownHandler=function(t){this.$onFocus()},r.prototype.$onFocus=function(){var e=this;this._text.visible&&(this._isFocus||(this.tempStage.removeEventListener(t.TouchEvent.TOUCH_BEGIN,this.onStageDownHandler,this),t.callLater(function(){e.tempStage.addEventListener(t.TouchEvent.TOUCH_BEGIN,e.onStageDownHandler,e)},this),this.stageText.$show()))},r.prototype.onStageDownHandler=function(t){t.$target!=this._text&&this.stageText.$hide()},r.prototype.updateTextHandler=function(e){var r,i,n=this._text.$TextField,o=this.stageText.$getText(),a=!1;null!=n[35]&&(r=new RegExp("["+n[35]+"]","g"),i=o.match(r),o=i?i.join(""):"",a=!0),null!=n[36]&&(r=new RegExp("[^"+n[36]+"]","g"),i=o.match(r),o=i?i.join(""):"",a=!0),a&&this.stageText.$getText()!=o&&this.stageText.$setText(o),this.resetText(),this._text.dispatchEvent(new t.Event(t.Event.CHANGE,!0))},r.prototype.resetText=function(){this._text.$setBaseText(this.stageText.$getText())},r.prototype._hideInput=function(){this.stageText.$removeFromStage()},r.prototype.updateInput=function(){!this._text.$visible&&this.stageText&&this._hideInput()},r.prototype._updateProperties=function(){if(this._isFocus)return this.stageText.$resetStageText(),void this.updateInput();var t=this._text.$stage;if(null==t);else for(var e=this._text,r=e.$visible;;){if(!r)break;if(e=e.parent,e==t)break;r=e.$visible}this.stageText.$setText(this._text.$TextField[13]),this.stageText.$resetStageText(),this.updateInput()},r}(t.HashObject);t.InputController=e,__reflect(e.prototype,"egret.InputController")}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){function e(e,r,n){n=n||{};var o=null==n.italic?r[16]:n.italic,a=null==n.bold?r[15]:n.bold,s=null==n.size?r[0]:n.size,h=n.fontFamily||r[8]||i.default_fontFamily;return t.sys.measureText(e,h,s,a,o)}var r=new RegExp("(?=[\\u00BF-\\u1FFF\\u2C00-\\uD7FF]|\\b|\\s)(?![。,!、》…))}”】\\.\\,\\!\\?\\]\\:])"),i=function(i){function n(){var e=i.call(this)||this;e.$inputEnabled=!1,e.inputUtils=null,e.graphicsNode=null,e.isFlow=!1,e.textArr=[],e.linesArr=[],e.$isTyping=!1;var r=new t.sys.TextNode;return r.fontFamily=n.default_fontFamily,e.textNode=r,e.$renderNode=r,e.$TextField={0:n.default_size,1:0,2:n.default_textColor,3:0/0,4:0/0,5:0,6:0,7:0,8:n.default_fontFamily,9:"left",10:"top",11:"#ffffff",12:"",13:"",14:[],15:!1,16:!1,17:!0,18:!1,19:!1,20:!1,21:0,22:0,23:0,24:t.TextFieldType.DYNAMIC,25:0,26:"#000000",27:0,28:-1,29:0,30:!1,31:!1,32:0,33:!1,34:16777215,35:null,36:null,37:t.TextFieldInputType.TEXT},e}return __extends(n,i),n.prototype.isInput=function(){return this.$TextField[24]==t.TextFieldType.INPUT},n.prototype.$setTouchEnabled=function(t){i.prototype.$setTouchEnabled.call(this,t),this.isInput()&&(this.$inputEnabled=!0)},Object.defineProperty(n.prototype,"fontFamily",{get:function(){return this.$TextField[8]},set:function(t){this.$setFontFamily(t)},enumerable:!0,configurable:!0}),n.prototype.$setFontFamily=function(t){var e=this.$TextField;return e[8]==t?!1:(e[8]=t,this.invalidateFontString(),!0)},Object.defineProperty(n.prototype,"size",{get:function(){return this.$TextField[0]},set:function(t){this.$setSize(t)},enumerable:!0,configurable:!0}),n.prototype.$setSize=function(t){t=+t||0;var e=this.$TextField;return e[0]==t?!1:(e[0]=t,this.invalidateFontString(),!0)},Object.defineProperty(n.prototype,"bold",{get:function(){return this.$TextField[15]},set:function(t){this.$setBold(t)},enumerable:!0,configurable:!0}),n.prototype.$setBold=function(t){t=!!t;var e=this.$TextField;return t==e[15]?!1:(e[15]=t,this.invalidateFontString(),!0)},Object.defineProperty(n.prototype,"italic",{get:function(){return this.$TextField[16]},set:function(t){this.$setItalic(t)},enumerable:!0,configurable:!0}),n.prototype.$setItalic=function(t){t=!!t;var e=this.$TextField;return t==e[16]?!1:(e[16]=t,this.invalidateFontString(),!0)},n.prototype.invalidateFontString=function(){this.$TextField[17]=!0,this.$invalidateTextField()},Object.defineProperty(n.prototype,"textAlign",{get:function(){return this.$TextField[9]},set:function(t){this.$setTextAlign(t)},enumerable:!0,configurable:!0}),n.prototype.$setTextAlign=function(t){var e=this.$TextField;return e[9]==t?!1:(e[9]=t,this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"verticalAlign",{get:function(){return this.$TextField[10]},set:function(t){this.$setVerticalAlign(t)},enumerable:!0,configurable:!0}),n.prototype.$setVerticalAlign=function(t){var e=this.$TextField;return e[10]==t?!1:(e[10]=t,this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"lineSpacing",{get:function(){return this.$TextField[1]},set:function(t){this.$setLineSpacing(t)},enumerable:!0,configurable:!0}),n.prototype.$setLineSpacing=function(t){t=+t||0;var e=this.$TextField;return e[1]==t?!1:(e[1]=t,this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"textColor",{get:function(){return this.$TextField[2]},set:function(t){this.$setTextColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setTextColor=function(t){t=0|+t;var e=this.$TextField;return e[2]==t?!1:(e[2]=t,this.inputUtils&&this.inputUtils._setColor(this.$TextField[2]),this.$invalidateTextField(),!0)},Object.defineProperty(n.prototype,"wordWrap",{get:function(){return this.$TextField[19]},set:function(t){this.$setWordWrap(t)},enumerable:!0,configurable:!0}),n.prototype.$setWordWrap=function(t){t=!!t;var e=this.$TextField;t!=e[19]&&(e[20]||(e[19]=t,this.$invalidateTextField()))},Object.defineProperty(n.prototype,"type",{get:function(){return this.$TextField[24]},set:function(t){this.$setType(t)},enumerable:!0,configurable:!0}),n.prototype.$setType=function(e){var r=this.$TextField;return r[24]!=e?(r[24]=e,e==t.TextFieldType.INPUT?(isNaN(r[3])&&this.$setWidth(100),isNaN(r[4])&&this.$setHeight(30),this.$setTouchEnabled(!0),null==this.inputUtils&&(this.inputUtils=new t.InputController),this.inputUtils.init(this),this.$invalidateTextField(),this.$stage&&this.inputUtils._addStageText()):(this.inputUtils&&(this.inputUtils._removeStageText(),this.inputUtils=null),this.$setTouchEnabled(!1)),!0):!1},Object.defineProperty(n.prototype,"inputType",{get:function(){return this.$TextField[37]},set:function(t){this.$TextField[37]=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"text",{get:function(){return this.$getText()},set:function(t){this.$setText(t)},enumerable:!0,configurable:!0}),n.prototype.$getText=function(){return this.$TextField[24]==t.TextFieldType.INPUT?this.inputUtils._getText():this.$TextField[13]},n.prototype.$setBaseText=function(t){null==t&&(t=""),t=t.toString(),this.isFlow=!1;var e=this.$TextField;if(e[13]!=t){this.$invalidateTextField(),e[13]=t;var r="";return r=e[20]?this.changeToPassText(t):t,this.setMiddleStyle([{text:r}]),!0}return!1},n.prototype.$setText=function(t){null==t&&(t="");var e=this.$setBaseText(t);return this.inputUtils&&this.inputUtils._setText(this.$TextField[13]),e},Object.defineProperty(n.prototype,"displayAsPassword",{get:function(){return this.$TextField[20]},set:function(t){this.$setDisplayAsPassword(t)},enumerable:!0,configurable:!0}),n.prototype.$setDisplayAsPassword=function(t){var e=this.$TextField;if(e[20]!=t){e[20]=t,this.$invalidateTextField();var r="";return r=t?this.changeToPassText(e[13]):e[13],this.setMiddleStyle([{text:r}]),!0}return!1},Object.defineProperty(n.prototype,"strokeColor",{get:function(){return this.$TextField[25]},set:function(t){t=+t||0,this.$setStrokeColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setStrokeColor=function(e){var r=this.$TextField;return r[25]!=e?(this.$invalidateTextField(),r[25]=e,r[26]=t.toColorString(e),!0):!1},Object.defineProperty(n.prototype,"stroke",{get:function(){return this.$TextField[27]},set:function(t){this.$setStroke(t)},enumerable:!0,configurable:!0}),n.prototype.$setStroke=function(t){return this.$TextField[27]!=t?(this.$invalidateTextField(),this.$TextField[27]=t,!0):!1},Object.defineProperty(n.prototype,"maxChars",{get:function(){return this.$TextField[21]},set:function(t){this.$setMaxChars(t)},enumerable:!0,configurable:!0}),n.prototype.$setMaxChars=function(t){return this.$TextField[21]!=t?(this.$TextField[21]=t,!0):!1},Object.defineProperty(n.prototype,"scrollV",{get:function(){return Math.min(Math.max(this.$TextField[28],1),this.maxScrollV)},set:function(t){this.$TextField[28]=Math.max(t,1),this.$invalidateTextField()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxScrollV",{get:function(){return this.$getLinesArr(),Math.max(this.$TextField[29]-t.TextFieldUtils.$getScrollNum(this)+1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectionBeginIndex",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectionEndIndex",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"caretIndex",{get:function(){return 0},enumerable:!0,configurable:!0}),n.prototype.$setSelection=function(t,e){return!1},n.prototype.$getLineHeight=function(){return this.$TextField[1]+this.$TextField[0]},Object.defineProperty(n.prototype,"numLines",{get:function(){return this.$getLinesArr(),this.$TextField[29]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"multiline",{get:function(){return this.$TextField[30]},set:function(t){this.$setMultiline(t)},enumerable:!0,configurable:!0}),n.prototype.$setMultiline=function(t){return this.$TextField[30]=t,this.$invalidateTextField(),!0},Object.defineProperty(n.prototype,"restrict",{get:function(){var t=this.$TextField,e=null;return null!=t[35]&&(e=t[35]),null!=t[36]&&(null==e&&(e=""),e+="^"+t[36]),e},set:function(t){var e=this.$TextField;if(null==t)e[35]=null,e[36]=null;else{for(var r=-1;r<t.length&&(r=t.indexOf("^",r),0!=r)&&r>0&&"\\"==t.charAt(r-1);)r++;0==r?(e[35]=null,e[36]=t.substring(r+1)):r>0?(e[35]=t.substring(0,r),e[36]=t.substring(r+1)):(e[35]=t,e[36]=null)}},enumerable:!0,configurable:!0}),n.prototype.$setWidth=function(t){var e=this.$TextField;if(isNaN(t)){if(isNaN(e[3]))return!1;e[3]=0/0}else{if(e[3]==t)return!1;e[3]=t}return t=+t,0>t?!1:(this.$invalidateTextField(),!0)},n.prototype.$setHeight=function(t){var e=this.$TextField;if(isNaN(t)){if(isNaN(e[4]))return!1;e[4]=0/0}else{if(e[4]==t)return!1;e[4]=t}return t=+t,0>t?!1:(this.$invalidateTextField(),!0)},n.prototype.$getWidth=function(){var t=this.$TextField;return isNaN(t[3])?this.$getContentBounds().width:t[3]},n.prototype.$getHeight=function(){var t=this.$TextField;return isNaN(t[4])?this.$getContentBounds().height:t[4]},Object.defineProperty(n.prototype,"border",{get:function(){return this.$TextField[31]},set:function(t){this.$setBorder(t)},enumerable:!0,configurable:!0}),n.prototype.$setBorder=function(t){this.$TextField[31]=!!t},Object.defineProperty(n.prototype,"borderColor",{get:function(){return this.$TextField[32]},set:function(t){this.$setBorderColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setBorderColor=function(t){this.$TextField[32]=+t||0},Object.defineProperty(n.prototype,"background",{get:function(){return this.$TextField[33]},set:function(t){this.$setBackground(t)},enumerable:!0,configurable:!0}),n.prototype.$setBackground=function(t){this.$TextField[33]=t},Object.defineProperty(n.prototype,"backgroundColor",{get:function(){return this.$TextField[34]},set:function(t){this.$setBackgroundColor(t)},enumerable:!0,configurable:!0}),n.prototype.$setBackgroundColor=function(t){this.$TextField[34]=t},n.prototype.fillBackground=function(e){var r=this.graphicsNode;r&&r.clear();var i=this.$TextField;if(i[33]||i[31]||e&&e.length>0){if(!r){r=this.graphicsNode=new t.sys.GraphicsNode;var n=new t.sys.GroupNode;n.addNode(r),n.addNode(this.textNode),this.$renderNode=n}var o=void 0,a=void 0;if(i[33]&&(o=r.beginFill(i[34]),o.drawRect(0,0,this.$getWidth(),this.$getHeight())),i[31]&&(a=r.lineStyle(1,i[32]),a.drawRect(0,0,this.$getWidth()-1,this.$getHeight()-1)),e&&e.length>0)for(var s=i[2],h=-1,c=e.length,u=0;c>u;u+=4){var l=e[u],p=e[u+1],d=e[u+2],f=e[u+3]||s;(0>h||h!=f)&&(h=f,a=r.lineStyle(2,f,1,t.CapsStyle.NONE)),a.moveTo(l,p),a.lineTo(l+d,p)}}if(r){var g=this.$getRenderBounds();r.x=g.x,r.y=g.y,r.width=g.width,r.height=g.height,t.Rectangle.release(g)}},n.prototype.setFocus=function(){this.type==t.TextFieldType.INPUT&&this.$stage&&this.inputUtils.$onFocus()},n.prototype.$onRemoveFromStage=function(){i.prototype.$onRemoveFromStage.call(this),this.removeEvent(),this.$TextField[24]==t.TextFieldType.INPUT&&this.inputUtils._removeStageText(),this.textNode&&this.textNode.clean()},n.prototype.$onAddToStage=function(e,r){i.prototype.$onAddToStage.call(this,e,r),this.addEvent(),this.$TextField[24]==t.TextFieldType.INPUT&&this.inputUtils._addStageText()},n.prototype.$invalidateTextField=function(){var t=this;t.$renderDirty=!0,t.$TextField[18]=!0;var e=t.$parent;e&&!e.$cacheDirty&&(e.$cacheDirty=!0,e.$cacheDirtyUp());var r=t.$maskedObject;r&&!r.$cacheDirty&&(r.$cacheDirty=!0,r.$cacheDirtyUp())},n.prototype.$getRenderBounds=function(){var e=this.$getContentBounds(),r=t.Rectangle.create();r.copyFrom(e),this.$TextField[31]&&(r.width+=2,r.height+=2);var i=2*this.$TextField[27];return i>0&&(r.width+=2*i,r.height+=2*i),r.x-=i+2,r.y-=i+2,r.width=Math.ceil(r.width)+4,r.height=Math.ceil(r.height)+4,r},n.prototype.$measureContentBounds=function(e){this.$getLinesArr();var r=isNaN(this.$TextField[3])?this.$TextField[5]:this.$TextField[3],i=isNaN(this.$TextField[4])?t.TextFieldUtils.$getTextHeight(this):this.$TextField[4];e.setTo(0,0,r,i)},n.prototype.$updateRenderNode=function(){if(this.$TextField[24]==t.TextFieldType.INPUT){if(this.inputUtils._updateProperties(),this.$isTyping)return void this.fillBackground()}else if(0==this.$TextField[3]){var e=this.graphicsNode;return void(e&&e.clear())}var r=this.drawText();this.fillBackground(r);var i=this.$getRenderBounds(),n=this.textNode;n.x=i.x,n.y=i.y,n.width=Math.ceil(i.width),n.height=Math.ceil(i.height),t.Rectangle.release(i)},Object.defineProperty(n.prototype,"textFlow",{get:function(){return this.textArr},set:function(t){this.isFlow=!0;var e="";null==t&&(t=[]);for(var r=0;r<t.length;r++){var i=t[r];e+=i.text}this.$TextField[20]?this.$setBaseText(e):(this.$TextField[13]=e,this.setMiddleStyle(t))},enumerable:!0,configurable:!0}),n.prototype.changeToPassText=function(t){if(this.$TextField[20]){for(var e="",r=0,i=t.length;i>r;r++)switch(t.charAt(r)){case"\n":e+="\n";break;case"\r":break;default:e+="*"}return e}return t},n.prototype.setMiddleStyle=function(t){this.$TextField[18]=!0,this.textArr=t,this.$invalidateTextField()},Object.defineProperty(n.prototype,"textWidth",{get:function(){return this.$getLinesArr(),this.$TextField[5]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"textHeight",{get:function(){return this.$getLinesArr(),t.TextFieldUtils.$getTextHeight(this)},enumerable:!0,configurable:!0}),n.prototype.appendText=function(t){this.appendElement({text:t})},n.prototype.appendElement=function(t){var e=this.$TextField[13]+t.text;this.$TextField[20]?this.$setBaseText(e):(this.$TextField[13]=e,this.textArr.push(t),this.setMiddleStyle(this.textArr))},n.prototype.$getLinesArr=function(){var i=this.$TextField;if(!i[18])return this.linesArr;i[18]=!1;var n=this.textArr;this.linesArr.length=0,i[6]=0,i[5]=0;var o=i[3];if(!isNaN(o)&&0==o)return i[29]=0,[{width:0,height:0,charNum:0,elements:[],hasNextLine:!1}];for(var a,s=this.linesArr,h=0,c=0,u=0,l=0,p=0,d=n.length;d>p;p++){var f=n[p];if(f.text){f.style=f.style||{};for(var g=f.text.toString(),$=g.split(/(?:\r\n|\r|\n)/),y=0,v=$.length;v>y;y++){null==s[l]&&(a={width:0,height:0,elements:[],charNum:0,hasNextLine:!1},s[l]=a,h=0,u=0,c=0),u=i[24]==t.TextFieldType.INPUT?i[0]:Math.max(u,f.style.size||i[0]);var m=!0;if(""==$[y])y==v-1&&(m=!1);else{var b=e($[y],i,f.style);if(isNaN(o))h+=b,c+=$[y].length,a.elements.push({width:b,text:$[y],style:f.style}),y==v-1&&(m=!1);else if(o>=h+b)a.elements.push({width:b,text:$[y],style:f.style}),h+=b,c+=$[y].length,y==v-1&&(m=!1);else{var x=0,T=0,_=$[y],w=void 0;w=i[19]?_.split(r):_.match(/./g);for(var O=w.length,E=0;O>x;x++){var D=w[x].length,S=!1;if(1==D&&O-1>x){var P=w[x].charCodeAt(0),F=w[x+1].charCodeAt(0);if(P>=55296&&56319>=P&&56320==(64512&F)){var C=w[x]+w[x+1];D=2,S=!0,b=e(C,i,f.style)}else b=e(w[x],i,f.style)}else b=e(w[x],i,f.style);if(0!=h&&h+b>o&&h+x!=0)break;if(T+b>o)for(var M=w[x].match(/./g),B=0,A=M.length;A>B;B++){var D=M[B].length,R=!1;if(1==D&&A-1>B){var P=M[B].charCodeAt(0),F=M[B+1].charCodeAt(0);
if(P>=55296&&56319>=P&&56320==(64512&F)){var C=M[B]+M[B+1];D=2,R=!0,b=e(C,i,f.style)}else b=e(M[B],i,f.style)}else b=e(M[B],i,f.style);if(B>0&&h+b>o)break;E+=D,T+=b,h+=b,c+=E,R&&B++}else E+=D,T+=b,h+=b,c+=E;S&&x++}if(x>0){a.elements.push({width:T,text:_.substring(0,E),style:f.style});var N=_.substring(E),k=void 0,L=N.length;for(k=0;L>k&&" "==N.charAt(k);k++);$[y]=N.substring(k)}""!=$[y]&&(y--,m=!1)}}m&&(c++,a.hasNextLine=!0),y<$.length-1&&(a.width=h,a.height=u,a.charNum=c,i[5]=Math.max(i[5],h),i[6]+=u,l++)}p==n.length-1&&a&&(a.width=h,a.height=u,a.charNum=c,i[5]=Math.max(i[5],h),i[6]+=u)}else a&&(a.width=h,a.height=u,a.charNum=c,i[5]=Math.max(i[5],h),i[6]+=u)}return i[29]=s.length,s},n.prototype.drawText=function(){var e=this.textNode,r=this.$TextField;e.bold=r[15],e.fontFamily=r[8]||n.default_fontFamily,e.italic=r[16],e.size=r[0],e.stroke=r[27],e.strokeColor=r[25],e.textColor=r[2];var i=this.$getLinesArr();if(0==r[5])return[];var o=isNaN(r[3])?r[5]:r[3],a=t.TextFieldUtils.$getTextHeight(this),s=0,h=t.TextFieldUtils.$getStartLine(this),c=r[4];if(!isNaN(c)&&c>a){var u=t.TextFieldUtils.$getValign(this);s+=u*(c-a)}s=Math.round(s);for(var l=t.TextFieldUtils.$getHalign(this),p=0,d=[],f=h,g=r[29];g>f;f++){var $=i[f],y=$.height;if(s+=y/2,f!=h){if(r[24]==t.TextFieldType.INPUT&&!r[30])break;if(!isNaN(c)&&s>c)break}p=Math.round((o-$.width)*l);for(var v=0,m=$.elements.length;m>v;v++){var b=$.elements[v],x=b.style.size||r[0];e.drawText(p,s+(y-x)/2,b.text,b.style),b.style.underline&&d.push(p,s+y/2,b.width,b.style.textColor),p+=b.width}s+=y/2+r[1]}return d},n.prototype.addEvent=function(){this.addEventListener(t.TouchEvent.TOUCH_TAP,this.onTapHandler,this)},n.prototype.removeEvent=function(){this.removeEventListener(t.TouchEvent.TOUCH_TAP,this.onTapHandler,this)},n.prototype.onTapHandler=function(e){if(this.$TextField[24]!=t.TextFieldType.INPUT){var r=t.TextFieldUtils.$getTextElement(this,e.localX,e.localY);if(null!=r){var i=r.style;if(i&&i.href)if(i.href.match(/^event:/)){var n=i.href.match(/^event:/)[0];t.TextEvent.dispatchTextEvent(this,t.TextEvent.LINK,i.href.substring(n.length))}else open(i.href,i.target||"_blank")}}},n.default_fontFamily="Arial",n.default_size=30,n.default_textColor=16777215,n}(t.DisplayObject);t.TextField=i,__reflect(i.prototype,"egret.TextField")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.TEXT="text",t.TEL="tel",t.PASSWORD="password",t}();t.TextFieldInputType=e,__reflect(e.prototype,"egret.TextFieldInputType")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.DYNAMIC="dynamic",t.INPUT="input",t}();t.TextFieldType=e,__reflect(e.prototype,"egret.TextFieldType")}(egret||(egret={}));var egret;!function(t){var e=function(){function e(){}return e.$getStartLine=function(t){var r=t.$TextField,i=e.$getTextHeight(t),n=0,o=r[4];return isNaN(o)||(o>i||i>o&&(n=Math.max(r[28]-1,0),n=Math.min(r[29]-1,n)),r[30]||(n=Math.max(r[28]-1,0),r[29]>0&&(n=Math.min(r[29]-1,n)))),n},e.$getHalign=function(e){var r=e.$getLinesArr(),i=0;return e.$TextField[9]==t.HorizontalAlign.CENTER?i=.5:e.$TextField[9]==t.HorizontalAlign.RIGHT&&(i=1),e.$TextField[24]==t.TextFieldType.INPUT&&!e.$TextField[30]&&r.length>1&&(i=0),i},e.$getTextHeight=function(e){var r=t.TextFieldType.INPUT!=e.$TextField[24]||e.$TextField[30]?e.$TextField[6]+(e.$TextField[29]-1)*e.$TextField[1]:e.$TextField[0];return r},e.$getValign=function(r){var i=e.$getTextHeight(r),n=r.$TextField[4];if(!isNaN(n)&&n>i){var o=0;return r.$TextField[10]==t.VerticalAlign.MIDDLE?o=.5:r.$TextField[10]==t.VerticalAlign.BOTTOM&&(o=1),o}return 0},e.$getTextElement=function(t,r,i){var n=e.$getHit(t,r,i),o=t.$getLinesArr();return n&&o[n.lineIndex]&&o[n.lineIndex].elements[n.textElementIndex]?o[n.lineIndex].elements[n.textElementIndex]:null},e.$getHit=function(t,r,i){var n=t.$getLinesArr();if(0==t.$TextField[3])return null;var o=0,a=e.$getTextHeight(t),s=0,h=t.$TextField[4];if(!isNaN(h)&&h>a){var c=e.$getValign(t);s=c*(h-a),0!=s&&(i-=s)}for(var u=e.$getStartLine(t),l=0,p=u;p<n.length;p++){var d=n[p];if(l+d.height>=i){i>l&&(o=p+1);break}if(l+=d.height,l+t.$TextField[1]>i)return null;l+=t.$TextField[1]}if(0==o)return null;var f=n[o-1],g=t.$TextField[3];isNaN(g)&&(g=t.textWidth);var $=e.$getHalign(t);r-=$*(g-f.width);for(var y=0,p=0;p<f.elements.length;p++){var v=f.elements[p];if(y+v.width<=r)y+=v.width;else if(r>y)return{lineIndex:o-1,textElementIndex:p}}return null},e.$getScrollNum=function(t){var e=1;if(t.$TextField[30]){var r=t.height,i=t.size,n=t.lineSpacing;e=Math.floor(r/(i+n));var o=r-(i+n)*e;o>i/2&&e++}return e},e}();t.TextFieldUtils=e,__reflect(e.prototype,"egret.TextFieldUtils")}(egret||(egret={}));var egret;!function(t){var e;!function(t){}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.TOP="top",t.BOTTOM="bottom",t.MIDDLE="middle",t.JUSTIFY="justify",t.CONTENT_JUSTIFY="contentJustify",t}();t.VerticalAlign=e,__reflect(e.prototype,"egret.VerticalAlign")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.encode=function(t){for(var e=new Uint8Array(t),r=e.length,i="",n=0;r>n;n+=3)i+=chars[e[n]>>2],i+=chars[(3&e[n])<<4|e[n+1]>>4],i+=chars[(15&e[n+1])<<2|e[n+2]>>6],i+=chars[63&e[n+2]];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},t.decode=function(t){var e=.75*t.length,r=t.length,i=0,n=0,o=0,a=0,s=0;"="===t[t.length-1]&&(e--,"="===t[t.length-2]&&e--);for(var h=new ArrayBuffer(e),c=new Uint8Array(h),u=0;r>u;u+=4)n=lookup[t.charCodeAt(u)],o=lookup[t.charCodeAt(u+1)],a=lookup[t.charCodeAt(u+2)],s=lookup[t.charCodeAt(u+3)],c[i++]=n<<2|o>>4,c[i++]=(15&o)<<4|a>>2,c[i++]=(3&a)<<6|63&s;return h},t}();t.Base64Util=e,__reflect(e.prototype,"egret.Base64Util")}(egret||(egret={}));for(var chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup=new Uint8Array(256),i=0;i<chars.length;i++)lookup[chars.charCodeAt(i)]=i;var egret;!function(t){var e=function(){function t(){}return t.LITTLE_ENDIAN="littleEndian",t.BIG_ENDIAN="bigEndian",t}();t.Endian=e,__reflect(e.prototype,"egret.Endian");var r=function(){function r(t,r){void 0===r&&(r=0),this.bufferExtSize=0,this.EOF_byte=-1,this.EOF_code_point=-1,0>r&&(r=0),this.bufferExtSize=r;var i,n=0;if(t){var o=void 0;if(t instanceof Uint8Array?(o=t,n=t.length):(n=t.byteLength,o=new Uint8Array(t)),0==r)i=new Uint8Array(n);else{var a=(n/r|0)+1;i=new Uint8Array(a*r)}i.set(o)}else i=new Uint8Array(r);this.write_position=n,this._position=0,this._bytes=i,this.data=new DataView(i.buffer),this.endian=e.BIG_ENDIAN}return Object.defineProperty(r.prototype,"endian",{get:function(){return 0==this.$endian?e.LITTLE_ENDIAN:e.BIG_ENDIAN},set:function(t){this.$endian=t==e.LITTLE_ENDIAN?0:1},enumerable:!0,configurable:!0}),r.prototype.setArrayBuffer=function(t){},Object.defineProperty(r.prototype,"readAvailable",{get:function(){return this.write_position-this._position},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this.data.buffer.slice(0,this.write_position)},set:function(t){var e,r=t.byteLength,i=new Uint8Array(t),n=this.bufferExtSize;if(0==n)e=new Uint8Array(r);else{var o=(r/n|0)+1;e=new Uint8Array(o*n)}e.set(i),this.write_position=r,this._bytes=e,this.data=new DataView(e.buffer)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"rawBuffer",{get:function(){return this.data.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"bytes",{get:function(){return this._bytes},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"dataView",{get:function(){return this.data},set:function(t){this.buffer=t.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"bufferOffset",{get:function(){return this.data.byteOffset},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"position",{get:function(){return this._position},set:function(t){this._position=t,t>this.write_position&&(this.write_position=t)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this.write_position},set:function(t){this.write_position=t,this.data.byteLength>t&&(this._position=t),this._validateBuffer(t)},enumerable:!0,configurable:!0}),r.prototype._validateBuffer=function(t){if(this.data.byteLength<t){var e=this.bufferExtSize,r=void 0;if(0==e)r=new Uint8Array(t);else{var i=((t/e>>0)+1)*e;r=new Uint8Array(i)}r.set(this._bytes),this._bytes=r,this.data=new DataView(r.buffer)}},Object.defineProperty(r.prototype,"bytesAvailable",{get:function(){return this.data.byteLength-this._position},enumerable:!0,configurable:!0}),r.prototype.clear=function(){var t=new ArrayBuffer(this.bufferExtSize);this.data=new DataView(t),this._bytes=new Uint8Array(t),this._position=0,this.write_position=0},r.prototype.readBoolean=function(){return this.validate(1)?!!this._bytes[this.position++]:void 0},r.prototype.readByte=function(){return this.validate(1)?this.data.getInt8(this.position++):void 0},r.prototype.readBytes=function(e,r,i){if(void 0===r&&(r=0),void 0===i&&(i=0),e){var n=this._position,o=this.write_position-n;if(0>o)return void t.$error(1025);if(0==i)i=o;else if(i>o)return void t.$error(1025);e.validateBuffer(r+i),e._bytes.set(this._bytes.subarray(n,n+i),r),this.position+=i}},r.prototype.readDouble=function(){if(this.validate(8)){var t=this.data.getFloat64(this._position,0==this.$endian);return this.position+=8,t}},r.prototype.readFloat=function(){if(this.validate(4)){var t=this.data.getFloat32(this._position,0==this.$endian);return this.position+=4,t}},r.prototype.readInt=function(){if(this.validate(4)){var t=this.data.getInt32(this._position,0==this.$endian);return this.position+=4,t}},r.prototype.readShort=function(){if(this.validate(2)){var t=this.data.getInt16(this._position,0==this.$endian);return this.position+=2,t}},r.prototype.readUnsignedByte=function(){return this.validate(1)?this._bytes[this.position++]:void 0},r.prototype.readUnsignedInt=function(){if(this.validate(4)){var t=this.data.getUint32(this._position,0==this.$endian);return this.position+=4,t}},r.prototype.readUnsignedShort=function(){if(this.validate(2)){var t=this.data.getUint16(this._position,0==this.$endian);return this.position+=2,t}},r.prototype.readUTF=function(){var t=this.readUnsignedShort();return t>0?this.readUTFBytes(t):""},r.prototype.readUTFBytes=function(t){if(this.validate(t)){var e=this.data,r=new Uint8Array(e.buffer,e.byteOffset+this._position,t);return this.position+=t,this.decodeUTF8(r)}},r.prototype.writeBoolean=function(t){this.validateBuffer(1),this._bytes[this.position++]=+t},r.prototype.writeByte=function(t){this.validateBuffer(1),this._bytes[this.position++]=255&t},r.prototype.writeBytes=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0);var i;0>e||0>r||(i=0==r?t.length-e:Math.min(t.length-e,r),i>0&&(this.validateBuffer(i),this._bytes.set(t._bytes.subarray(e,e+i),this._position),this.position=this._position+i))},r.prototype.writeDouble=function(t){this.validateBuffer(8),this.data.setFloat64(this._position,t,0==this.$endian),this.position+=8},r.prototype.writeFloat=function(t){this.validateBuffer(4),this.data.setFloat32(this._position,t,0==this.$endian),this.position+=4},r.prototype.writeInt=function(t){this.validateBuffer(4),this.data.setInt32(this._position,t,0==this.$endian),this.position+=4},r.prototype.writeShort=function(t){this.validateBuffer(2),this.data.setInt16(this._position,t,0==this.$endian),this.position+=2},r.prototype.writeUnsignedInt=function(t){this.validateBuffer(4),this.data.setUint32(this._position,t,0==this.$endian),this.position+=4},r.prototype.writeUnsignedShort=function(t){this.validateBuffer(2),this.data.setUint16(this._position,t,0==this.$endian),this.position+=2},r.prototype.writeUTF=function(t){var e=this.encodeUTF8(t),r=e.length;this.validateBuffer(2+r),this.data.setUint16(this._position,r,0==this.$endian),this.position+=2,this._writeUint8Array(e,!1)},r.prototype.writeUTFBytes=function(t){this._writeUint8Array(this.encodeUTF8(t))},r.prototype.toString=function(){return"[ByteArray] length:"+this.length+", bytesAvailable:"+this.bytesAvailable},r.prototype._writeUint8Array=function(t,e){void 0===e&&(e=!0);var r=this._position,i=r+t.length;e&&this.validateBuffer(i),this.bytes.set(t,r),this.position=i},r.prototype.validate=function(e){var r=this._bytes.length;return r>0&&this._position+e<=r?!0:void t.$error(1025)},r.prototype.validateBuffer=function(t){this.write_position=t>this.write_position?t:this.write_position,t+=this._position,this._validateBuffer(t)},r.prototype.encodeUTF8=function(t){for(var e=0,r=this.stringToCodePoints(t),i=[];r.length>e;){var n=r[e++];if(this.inRange(n,55296,57343))this.encoderError(n);else if(this.inRange(n,0,127))i.push(n);else{var o=void 0,a=void 0;for(this.inRange(n,128,2047)?(o=1,a=192):this.inRange(n,2048,65535)?(o=2,a=224):this.inRange(n,65536,1114111)&&(o=3,a=240),i.push(this.div(n,Math.pow(64,o))+a);o>0;){var s=this.div(n,Math.pow(64,o-1));i.push(128+s%64),o-=1}}}return new Uint8Array(i)},r.prototype.decodeUTF8=function(t){for(var e,r=!1,i=0,n="",o=0,a=0,s=0,h=0;t.length>i;){var c=t[i++];if(c==this.EOF_byte)e=0!=a?this.decoderError(r):this.EOF_code_point;else if(0==a)this.inRange(c,0,127)?e=c:(this.inRange(c,194,223)?(a=1,h=128,o=c-192):this.inRange(c,224,239)?(a=2,h=2048,o=c-224):this.inRange(c,240,244)?(a=3,h=65536,o=c-240):this.decoderError(r),o*=Math.pow(64,a),e=null);else if(this.inRange(c,128,191))if(s+=1,o+=(c-128)*Math.pow(64,a-s),s!==a)e=null;else{var u=o,l=h;o=0,a=0,s=0,h=0,e=this.inRange(u,l,1114111)&&!this.inRange(u,55296,57343)?u:this.decoderError(r,c)}else o=0,a=0,s=0,h=0,i--,e=this.decoderError(r,c);null!==e&&e!==this.EOF_code_point&&(65535>=e?e>0&&(n+=String.fromCharCode(e)):(e-=65536,n+=String.fromCharCode(55296+(e>>10&1023)),n+=String.fromCharCode(56320+(1023&e))))}return n},r.prototype.encoderError=function(e){t.$error(1026,e)},r.prototype.decoderError=function(e,r){return e&&t.$error(1027),r||65533},r.prototype.inRange=function(t,e,r){return t>=e&&r>=t},r.prototype.div=function(t,e){return Math.floor(t/e)},r.prototype.stringToCodePoints=function(t){for(var e=[],r=0,i=t.length;r<t.length;){var n=t.charCodeAt(r);if(this.inRange(n,55296,57343))if(this.inRange(n,56320,57343))e.push(65533);else if(r==i-1)e.push(65533);else{var o=t.charCodeAt(r+1);if(this.inRange(o,56320,57343)){var a=1023&n,s=1023&o;r+=1,e.push(65536+(a<<10)+s)}else e.push(65533)}else e.push(n);r+=1}return e},r}();t.ByteArray=r,__reflect(r.prototype,"egret.ByteArray")}(egret||(egret={}));var egret;!function(t){t.BitmapFillMode={REPEAT:"repeat",SCALE:"scale",CLIP:"clip"}}(egret||(egret={}));var egret;!function(t){function e(e,r){t.useFontMapping=!0,t.fontMapping[e]=r}t.fontMapping={},t.useFontMapping=!1,t.registerFontMapping=e}(egret||(egret={}));var egret;!function(t){function e(t,e,r){var i=t.prototype;i.__class__=e;var n=[e];r&&(n=n.concat(r));var o=i.__types__;if(i.__types__)for(var a=o.length,s=0;a>s;s++){var h=o[s];-1==n.indexOf(h)&&n.push(h)}i.__types__=n}t.registerClass=e}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.NORMAL="normal",t.ADD="add",t.ERASE="erase",t}();t.BlendMode=e,__reflect(e.prototype,"egret.BlendMode")}(egret||(egret={})),function(t){var e;!function(t){function e(t){var e=n[t];return void 0===e?0:e}function r(t){var e=i[t];return void 0===e?"normal":e}for(var i=["normal","add","erase"],n={},o=i.length,a=0;o>a;a++){var s=i[a];n[s]=a}t.blendModeToNumber=e,t.numberToBlendMode=r}(e=t.sys||(t.sys={}))}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return Object.defineProperty(t,"logLevel",{set:function(t){},enumerable:!0,configurable:!0}),t.ALL="all",t.DEBUG="debug",t.INFO="info",t.WARN="warn",t.ERROR="error",t.OFF="off",t}();t.Logger=e,__reflect(e.prototype,"egret.Logger")}(egret||(egret={}));var egret;!function(t){var e=function(){function t(){}return t.isNumber=function(t){return"number"==typeof t&&!isNaN(t)},t.sin=function(e){var r=Math.floor(e),i=r+1,n=t.sinInt(r);if(r==e)return n;var o=t.sinInt(i);return(e-r)*o+(i-e)*n},t.sinInt=function(t){return t%=360,0>t&&(t+=360),egret_sin_map[t]},t.cos=function(e){var r=Math.floor(e),i=r+1,n=t.cosInt(r);if(r==e)return n;var o=t.cosInt(i);return(e-r)*o+(i-e)*n},t.cosInt=function(t){return t%=360,0>t&&(t+=360),egret_cos_map[t]},t}();t.NumberUtils=e,__reflect(e.prototype,"egret.NumberUtils")}(egret||(egret={}));for(var egret_sin_map={},egret_cos_map={},DEG_TO_RAD=Math.PI/180,NumberUtils_i=0;360>NumberUtils_i;NumberUtils_i++)egret_sin_map[NumberUtils_i]=Math.sin(NumberUtils_i*DEG_TO_RAD),egret_cos_map[NumberUtils_i]=Math.cos(NumberUtils_i*DEG_TO_RAD);egret_sin_map[90]=1,egret_cos_map[90]=0,egret_sin_map[180]=0,egret_cos_map[180]=-1,egret_sin_map[270]=-1,egret_cos_map[270]=0,Function.prototype.bind||(Function.prototype.bind=function(t){"function"!=typeof this&&egret.$error(1029);var e=Array.prototype.slice.call(arguments,1),r=this,i=function(){},n=function(){return r.apply(this instanceof i&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,n.prototype=new i,n});var egret;!function(t){var e=function(e){function r(t,r){void 0===r&&(r=0);var i=e.call(this)||this;return i._delay=0,i._currentCount=0,i._running=!1,i.updateInterval=1e3,i.lastCount=1e3,i.lastTimeStamp=0,i.delay=t,i.repeatCount=0|+r,i}return __extends(r,e),Object.defineProperty(r.prototype,"delay",{get:function(){return this._delay},set:function(t){1>t&&(t=1),this._delay!=t&&(this._delay=t,this.lastCount=this.updateInterval=Math.round(60*t))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"currentCount",{get:function(){return this._currentCount},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"running",{get:function(){return this._running},enumerable:!0,configurable:!0}),r.prototype.reset=function(){this.stop(),this._currentCount=0},r.prototype.start=function(){this._running||(this.lastCount=this.updateInterval,this.lastTimeStamp=t.getTimer(),t.ticker.$startTick(this.$update,this),this._running=!0)},r.prototype.stop=function(){this._running&&(t.stopTick(this.$update,this),this._running=!1)},r.prototype.$update=function(e){var r=e-this.lastTimeStamp;if(r>=this._delay)this.lastCount=this.updateInterval;else{if(this.lastCount-=1e3,this.lastCount>0)return!1;this.lastCount+=this.updateInterval}this.lastTimeStamp=e,this._currentCount++;var i=this.repeatCount>0&&this._currentCount>=this.repeatCount;return t.TimerEvent.dispatchTimerEvent(this,t.TimerEvent.TIMER),i&&(this.stop(),t.TimerEvent.dispatchTimerEvent(this,t.TimerEvent.TIMER_COMPLETE)),!1},r}(t.EventDispatcher);t.Timer=e,__reflect(e.prototype,"egret.Timer")}(egret||(egret={}));var egret;!function(t){}(egret||(egret={}));var egret;!function(t){function e(e,r){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];t.$callLaterFunctionList.push(e),t.$callLaterThisList.push(r),t.$callLaterArgsList.push(i)}function r(e,r){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];t.$callAsyncFunctionList.push(e),t.$callAsyncThisList.push(r),t.$callAsyncArgsList.push(i)}t.$callLaterFunctionList=[],t.$callLaterThisList=[],t.$callLaterArgsList=[],t.callLater=e,t.$callAsyncFunctionList=[],t.$callAsyncThisList=[],t.$callAsyncArgsList=[],t.$callAsync=r}(egret||(egret={}));var egret;!function(t){function e(t,e,r){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];var o,a=t.prototype;t.hasOwnProperty("__sets__")||Object.defineProperty(t,"__sets__",{value:{}}),o=t.__sets__;var s=o[r];if(s)return s.apply(e,i);var h=Object.getPrototypeOf(a);if(null!=h){for(;!h.hasOwnProperty(r);)if(h=Object.getPrototypeOf(h),null==h)return;s=Object.getOwnPropertyDescriptor(h,r).set,o[r]=s,s.apply(e,i)}}function r(t,e,r){var i,n=t.prototype;t.hasOwnProperty("__gets__")||Object.defineProperty(t,"__gets__",{value:{}}),i=t.__gets__;var o=i[r];if(o)return o.call(e);var a=Object.getPrototypeOf(n);if(null!=a){for(;!a.hasOwnProperty(r);)if(a=Object.getPrototypeOf(a),null==a)return;return o=Object.getOwnPropertyDescriptor(a,r).get,i[r]=o,o.call(e)}}t.superSetter=e,t.superGetter=r}(egret||(egret={}));var egret;!function(t){function e(t){if(!t)return null;var e=r[t];if(e)return e;var i=t.split("."),n=i.length;e=__global;for(var o=0;n>o;o++){var a=i[o];if(e=e[a],!e)return null}return r[t]=e,e}var r={};t.getDefinitionByName=e}(egret||(egret={}));var __global=this.__global||this,egret;!function(t){}(egret||(egret={}));var egret;!function(t){function e(t){var e=typeof t;if(!t||"object"!=e&&!t.prototype)return e;var r=t.prototype?t.prototype:Object.getPrototypeOf(t);if(r.hasOwnProperty("__class__"))return r.__class__;var i=r.constructor.toString().trim(),n=i.indexOf("("),o=i.substring(9,n);return Object.defineProperty(r,"__class__",{value:o,enumerable:!1,writable:!0}),o}t.getQualifiedClassName=e}(egret||(egret={}));var egret;!function(t){function e(e){if(!e||"object"!=typeof e&&!e.prototype)return null;var r=e.prototype?e.prototype:Object.getPrototypeOf(e),i=Object.getPrototypeOf(r);if(!i)return null;var n=t.getQualifiedClassName(i.constructor);return n?n:null}t.getQualifiedSuperclassName=e}(egret||(egret={}));var egret;!function(t){function e(){return Date.now()-t.sys.$START_TIME}t.getTimer=e}(egret||(egret={}));var egret;!function(t){function e(e){var r=t.getDefinitionByName(e);return r?!0:!1}t.hasDefinition=e}(egret||(egret={}));var egret;!function(t){function e(t,e){if(!t||"object"!=typeof t)return!1;var r=Object.getPrototypeOf(t),i=r?r.__types__:null;return i?-1!==i.indexOf(e):!1}t.is=e}(egret||(egret={}));var egret;!function(t){function e(e,r){t.ticker.$startTick(e,r)}t.startTick=e}(egret||(egret={}));var egret;!function(t){function e(e,r){t.ticker.$stopTick(e,r)}t.stopTick=e}(egret||(egret={}));var egret;!function(t){function e(t){0>t&&(t=0),t>16777215&&(t=16777215);for(var e=t.toString(16).toUpperCase();e.length>6;)e=e.slice(1,e.length);for(;e.length<6;)e="0"+e;return"#"+e}t.toColorString=e}(egret||(egret={}));