text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rextextarea=e()}(this,function(){"use strict";function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function i(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function y(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(n){var s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=g(n);if(s){var i=g(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return m(t)}(this,t)}}function l(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}function k(t,e,i){return(k="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=l(t,e);if(n){var s=Object.getOwnPropertyDescriptor(n,e);return s.get?s.get.call(i):s.value}})(t,e,i||t)}function r(t,e,i,n){return(r="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,i,n){var s,r,o,h,a=l(t,e);if(a){if((s=Object.getOwnPropertyDescriptor(a,e)).set)return s.set.call(n,i),!0;if(!s.writable)return!1}if(s=Object.getOwnPropertyDescriptor(n,e)){if(!s.writable)return!1;s.value=i,Object.defineProperty(n,e,s)}else h=i,(o=e)in(r=n)?Object.defineProperty(r,o,{value:h,enumerable:!0,configurable:!0,writable:!0}):r[o]=h;return!0})(t,e,i,n)}function e(t,e,i,n,s){if(!r(t,e,i,n||t)&&s)throw new Error("failed to set property");return i}function o(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var t=Phaser.GameObjects.Zone,a=Phaser.Utils.Array.Add,c=Phaser.Utils.Array.Remove,d=function(){y(h,t);var o=b(h);function h(t,e,i,n,s){var r;return f(this,h),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=1),(r=o.call(this,t,e,i,n,s)).children=[],r}return i(h,[{key:"destroy",value:function(t){if(this.scene){if(t)for(var e,i=this.children.length-1;0<=i;i--)(e=this.children[i]).parentContainer||e.displayList||e.destroy(t);this.clear(!t),k(g(h.prototype),"destroy",this).call(this,t)}}},{key:"contains",value:function(t){return-1!==this.children.indexOf(t)}},{key:"add",value:function(t){var e=this;return a(this.children,t,0,function(t){t.once("destroy",e.onChildDestroy,e)},this),this}},{key:"remove",value:function(t,e){var i=this;return c(this.children,t,function(t){t.off("destroy",i.onChildDestroy,i),e&&t.destroy()}),this}},{key:"onChildDestroy",value:function(t){this.remove(t,!1)}},{key:"clear",value:function(t){for(var e,i=0,n=this.children.length;i<n;i++)(e=this.children[i]).off("destroy",this.onChildDestroy,this),t&&e.destroy();return this.children.length=0,this}}]),h}(),v=Phaser.GameObjects.Components;Phaser.Class.mixin(d,[v.Alpha,v.Flip]);function p(t){var e;return t.hasOwnProperty("rexContainer")&&(e=t.rexContainer.parent),e}function x(e){if(!e.hasOwnProperty("rexContainer")){var t={parent:null,self:null,x:0,y:0,rotation:0,scaleX:0,scaleY:0,alpha:0,visible:!0,active:!0};Object.defineProperty(t,"angle",{get:function(){return T(this.rotation)},set:function(t){this.rotation=M(t)}}),Object.defineProperty(t,"displayWidth",{get:function(){return e.width*this.scaleX},set:function(t){this.scaleX=t/e.width}}),Object.defineProperty(t,"displayHeight",{get:function(){return e.height*this.scaleY},set:function(t){this.scaleY=t/e.height}}),e.rexContainer=t}return e.rexContainer}function S(t){return this.setParent(t),this.resetChildState(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),z.call(this,t),this}function C(t){this.setParent(t);var e=x(t);return e.x=t.x,e.y=t.y,e.rotation=t.rotation,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.alpha=t.alpha,e.visible=t.visible,e.active=t.active,this.updateChildPosition(t).updateChildAlpha(t).updateChildVisible(t).updateChildActive(t).updateChildScrollFactor(t).updateChildMask(t),z.call(this,t),this}function O(t,e){return t===e?1:t/e}function E(t,e){if(0===t.length)return t;void 0===e&&(e=!1);var i=t[0].scene.sys.displayList;return i.depthSort(),e?t.sort(function(t,e){return i.getIndex(e)-i.getIndex(t)}):t.sort(function(t,e){return i.getIndex(t)-i.getIndex(e)}),t}function w(t,e){for(var i=[t];0<i.length;){var n=i.shift();!e(n)&&n.isRexContainerLite&&i.push.apply(i,o(n.children))}}function _(t){return"[object Array]"===Object.prototype.toString.call(t)}function P(t){var e=this.getAllChildren([this]);return E(e),t.add(e),this}var M=Phaser.Math.DegToRad,T=Phaser.Math.RadToDeg,Y={setParent:function(t,e){void 0===e&&(e=this);var i=x(t);return e?(i.parent=e,i.self=t):(i.parent=null,i.self=null),this},getParent:function(t){return void 0===t&&(t=this),p(t)},getTopmostParent:function(t){return void 0===t&&(t=this),function(t){for(var e=p(t);e;)e=p(t=e);return t}(t)}},z=d.prototype.add,D={add:function(t){return Array.isArray(t)?this.addMultiple(t):S.call(this,t),this},pin:function(t){return Array.isArray(t)?this.addMultiple(t):S.call(this,t),this},addMultiple:function(t){for(var e=0,i=t.length;e<i;e++)S.call(this,t[e]);return this},addLocal:function(t){return Array.isArray(t)?this.addMultiple(t):C.call(this,t),this},addLocalMultiple:function(t){for(var e=0,i=t.length;e<i;e++)C.call(this,t[e]);return this}},R=d.prototype.remove,L=d.prototype.clear,j={remove:function(t,e){return p(t)!==this||(this.setParent(t,null),R.call(this,t,e)),this},clear:function(t){for(var e=0,i=this.children.length;e<i;e++)this.setParent(this.children[e],null);return L.call(this,t),this}},V={getLocalState:function(t){return x(t)},resetChildState:function(t){return this.resetChildPositionState(t).resetChildVisibleState(t).resetChildAlphaState(t).resetChildActiveState(t),this},resetChildrenState:function(t){for(var e=0,i=t.length;e<i;e++)this.resetChildState(t[e]);return this},syncProperties:function(){return this.syncPosition().syncVisible().syncAlpha().syncActive().syncScrollFactor().syncMask(),this}},A=Phaser.Math.RotateAround,X={worldToLocal:function(t){return t.x-=this.x,t.y-=this.y,A(t,0,0,-this.rotation),t.x/=this.scaleX,t.y/=this.scaleY,t},localToWorld:function(t){return t.x*=this.scaleX,t.y*=this.scaleY,A(t,0,0,this.rotation),t.x+=this.x,t.y+=this.y,t}},W={updateChildPosition:function(t){t.isRexContainerLite&&(t.syncChildrenEnable=!1);var e=x(t),i=e.parent;return t.x=e.x,t.y=e.y,i.localToWorld(t),t.scaleX=e.scaleX*i.scaleX,t.scaleY=e.scaleY*i.scaleY,t.rotation=e.rotation+i.rotation,t.isRexContainerLite&&(t.syncChildrenEnable=!0,t.syncPosition()),this},syncPosition:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildPosition,this),this},resetChildPositionState:function(t){var e=x(t),i=e.parent;return e.x=t.x,e.y=t.y,i.worldToLocal(e),e.scaleX=O(t.scaleX,i.scaleX),e.scaleY=O(t.scaleY,i.scaleY),e.rotation=t.rotation-i.rotation,this},setChildPosition:function(t,e,i){return t.x=e,t.y=i,this.resetChildPositionState(t),this},setChildLocalPosition:function(t,e,i){var n=x(t);return n.x=e,n.y=i,this.updateChildPosition(t),this},resetLocalPositionState:function(){var t=x(this).parent;return t&&t.resetChildPositionState(this),this}},H={updateChildRotation:function(t){var e=x(t),i=e.parent;return t.rotation=i.rotation+e.rotation,this},syncRotation:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildRotation,this),this},resetChildRotationState:function(t){var e=x(t),i=e.parent;return e.rotation=t.rotation-i.rotation,this},setChildRotation:function(t,e){return t.rotation=e,this.resetChildRotationState(t),this},setChildAngle:function(t,e){return t.angle=e,this.resetChildRotationState(t),this},setChildLocalRotation:function(t,e){return x(t).rotation=e,this.updateChildRotation(t),this},resetLocalRotationState:function(){var t=x(this).parent;return t&&t.resetChildRotationState(this),this}},F={updateChildScale:function(t){var e=x(t),i=e.parent;return t.scaleX=i.scaleX*e.scaleX,t.scaleY=i.scaleY*e.scaleY,this},syncScale:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScale,this),this},resetChildScaleState:function(t){var e=x(t),i=e.parent;return e.scaleX=O(t.scaleX,i.scaleX),e.scaleY=O(t.scaleY,i.scaleY),this},setChildScale:function(t,e,i){return void 0===i&&(i=e),t.scaleX=e,t.scaleY=i,this.resetChildScaleState(t),this},setChildLocalScale:function(t,e,i){void 0===i&&(i=e);var n=x(t);return n.scaleX=e,n.scaleY=i,this.updateChildScale(t),this},setChildDisplaySize:function(t,e,i){return t.setDisplaySize(e,i),this.resetChildScaleState(t),this},resetLocalScaleState:function(){var t=x(this).parent;return t&&t.resetChildScaleState(this),this}},N={updateChildVisible:function(t){var e=x(t),i=e.parent,n=!e.hasOwnProperty("maskVisible")||e.maskVisible;return t.visible=i.visible&&e.visible&&n,this},syncVisible:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildVisible,this),this},resetChildVisibleState:function(t){var e=x(t);return e.hasOwnProperty("maskVisible")&&delete e.maskVisible,e.visible=t.visible,this},setChildVisible:function(t,e){return this.setChildLocalVisible(t,e),this},setChildLocalVisible:function(t,e){return void 0===e&&(e=!0),x(t).visible=e,this.updateChildVisible(t),this},setChildMaskVisible:function(t,e){return void 0===e&&(e=!0),x(t).maskVisible=e,this.updateChildVisible(t),this},resetLocalVisibleState:function(){var t=x(this).parent;return t&&t.resetChildVisibleState(this),this}},I={updateChildAlpha:function(t){var e=x(t),i=e.parent;return t.alpha=i.alpha*e.alpha,this},syncAlpha:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildAlpha,this),this},resetChildAlphaState:function(t){var e=x(t),i=e.parent;return e.alpha=O(t.alpha,i.alpha),this},setChildAlpha:function(t,e){return t.alpha=e,this.resetChildAlphaState(t),this},setChildLocalAlpha:function(t,e){return x(t).alpha=e,this.updateChildAlpha(t),this},resetLocalAlphaState:function(){var t=x(this).parent;return t&&t.resetChildAlphaState(this),this}},G={updateChildActive:function(t){var e=x(t),i=e.parent;return t.active=i.active&&e.active,this},syncActive:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildActive,this),this},resetChildActiveState:function(t){return x(t).active=t.active,this},setChildActive:function(t,e){return t.active=e,this.resetChildActiveState(t),this},setChildLocalActive:function(t,e){return void 0===e&&(e=!0),x(t).active=e,this.updateChildActive(t),this},resetLocalActiveState:function(){var t=x(this).parent;return t&&t.resetChildActiveState(this),this}},B={updateChildScrollFactor:function(t){var e=x(t).parent;return t.setScrollFactor(e.scrollFactorX,e.scrollFactorY),this},syncScrollFactor:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildScrollFactor,this),this}},U={updateChildMask:function(t){return null==this.mask||(this.mask.hasOwnProperty("geometryMask")?this.mask.geometryMask:this.mask.bitmapMask)!==t&&(t.mask=this.mask),this},syncMask:function(){return this.syncChildrenEnable&&this.children.forEach(this.updateChildMask,this),this},setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this}},J={setDepth:function(t,e){if(this.depth=t,!e&&this.children)for(var i=this.getAllChildren(),n=0,s=i.length;n<s;n++)i[n].depth=t;return this},swapDepth:function(t){var e=this.depth,i=t.depth;return this.setDepth(i),t.setDepth(e),this},incDepth:function(t){if(this.depth+=t,this.children)for(var e=this.getAllChildren(),i=0,n=e.length;i<n;i++)e[i].depth+=t;return this},moveDepthBelow:function(t){var e=t.scene.children,i=this.getAllChildren([this]);E(i);for(var n=0,s=i.length;n<s;n++){var r=i[n];if(e.exists(r)){e.moveBelow(t,r);break}}return this},moveDepthAbove:function(t){var e=t.scene.children,i=this.getAllChildren([this]);E(i,!0);for(var n=0,s=i.length;n<s;n++){var r=i[n];if(e.exists(r)){e.moveAbove(t,r);break}}return this}},K=Phaser.Utils.Array,Z={getChildren:function(t){if(t)for(var e=0,i=this.children.length;e<i;e++)t.push(this.children[e]);else t=this.children;return t},getAllChildren:function(e){void 0===e&&(e=[]);var i=this;return w(i,function(t){t!==i&&e.push(t)}),e},getAllVisibleChildren:function(e){void 0===e&&(e=[]);var i=this;return w(i,function(t){if(t!==i)return!t.visible||void e.push(t)}),e},bfs:function(t,e){return void 0===e&&(e=this),w(e,t),this},dfs:function(t,e){return void 0===e&&(e=this),function t(e,i){if(!i(e)&&e.isRexContainerLite)for(var n=e.children,s=0,r=n.length;s<r;s++)t(n[s],i)}(e,t),this},contains:function(t){var e=p(t);return!!e&&(e===this||this.contains(e))},getByName:function(t,e){if(e){for(var i,n,s=[this];s.length;)for(var r=0,o=(i=s.shift()).children.length;r<o;r++){if((n=i.children[r]).name===t)return n;n.isRexContainerLite&&s.push(n)}return null}return K.GetFirst(this.children,"name",t)},getRandom:function(t,e){return K.GetRandom(this.children,t,e)},getFirst:function(t,e,i,n){return K.GetFirstElement(this.children,t,e,i,n)},getAll:function(t,e,i,n){return K.GetAll(this.children,t,e,i,n)},count:function(t,e,i,n){return K.CountAllMatching(this.children,t,e,i,n)},swap:function(t,e){return K.Swap(this.children,t,e),this},setAll:function(t,e,i,n){return K.SetAll(this.children,t,e,i,n),this}},q={tweenChild:function(t){var e=t.targets;_(e)||(e=[e]);for(var r,i,n=[],s=0,o=e.length;s<o;s++)(i=e[s]).hasOwnProperty("rexContainer")&&(r=i.scene,n.push(i.rexContainer));if(r){t.targets=n;var h=r.tweens.add(t);return h.on("update",function(t,e,i){if(i.parent){var n=i.parent,s=i.self;switch(e){case"x":case"y":n.updateChildPosition(s);break;case"angle":case"rotation":n.updateChildRotation(s);break;case"scaleX":case"scaleY":case"displayWidth":case"displayHeight":n.updateChildScale(s);break;case"alpha":n.updateChildAlpha(s)}}else r.tweens.remove(t)}),h}},tween:function(t){var e=this.scene;return t.targets||(t.targets=this),e.tweens.add(t)}},$={addToLayer:P,addToContainer:P},Q=Phaser.Math.RotateAround,tt={changeOrigin:function(t,e){this.syncChildrenEnable=!1,function(t,e,i){void 0===i&&(i=e);var n={x:(e-t.originX)*t.displayWidth,y:(i-t.originY)*t.displayHeight};Q(n,0,0,t.rotation),t.originX=e,t.originY=i,t.x=t.x+n.x,t.y=t.y+n.y}(this,t,e),this.syncChildrenEnable=!0;for(var i=this.getAllChildren(),n=0,s=i.length;n<s;n++)this.resetChildPositionState(i[n]);return this}};Object.assign(tt,Y,D,j,V,X,W,H,F,N,I,G,B,U,J,Z,q,$);var et=function(){y(a,d);var h=b(a);function a(t,e,i,n,s,r){var o;return f(this,a),(o=h.call(this,t,e,i,n,s)).type="rexContainerLite",o.isRexContainerLite=!0,o.syncChildrenEnable=!0,o._active=!0,o._mask=null,o._scrollFactorX=1,o._scrollFactorY=1,r&&o.add(r),o}return i(a,[{key:"destroy",value:function(t){this.scene&&(this.syncChildrenEnable=!1,k(g(a.prototype),"destroy",this).call(this,t))}},{key:"resize",value:function(t,e){return this.setSize(t,e),this}},{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.syncPosition())}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.syncPosition())}},{key:"rotation",get:function(){return k(g(a.prototype),"rotation",this)},set:function(t){this.rotation!==t&&(e(g(a.prototype),"rotation",t,this,!0),this.syncPosition())}},{key:"scaleX",get:function(){return k(g(a.prototype),"scaleX",this)},set:function(t){this.scaleX!==t&&(e(g(a.prototype),"scaleX",t,this,!0),this.syncPosition())}},{key:"scaleY",get:function(){return k(g(a.prototype),"scaleY",this)},set:function(t){this.scaleY!==t&&(e(g(a.prototype),"scaleY",t,this,!0),this.syncPosition())}},{key:"visible",get:function(){return k(g(a.prototype),"visible",this)},set:function(t){k(g(a.prototype),"visible",this)!==t&&(e(g(a.prototype),"visible",t,this,!0),this.syncVisible())}},{key:"alpha",get:function(){return k(g(a.prototype),"alpha",this)},set:function(t){k(g(a.prototype),"alpha",this)!==t&&(e(g(a.prototype),"alpha",t,this,!0),this.syncAlpha())}},{key:"active",get:function(){return this._active},set:function(t){this._active!==t&&(this._active=t,this.syncActive())}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask!==t&&(this._mask=t,this.syncMask())}},{key:"scrollFactorX",get:function(){return this._scrollFactorX},set:function(t){this._scrollFactorX!==t&&(this._scrollFactorX=t,this.syncScrollFactor())}},{key:"scrollFactorY",get:function(){return this._scrollFactorY},set:function(t){this._scrollFactorY!==t&&(this._scrollFactorY=t,this.syncScrollFactor())}},{key:"list",get:function(){return this.children}}],[{key:"GetParent",value:function(t){return p(t)}}]),a}();Object.assign(et.prototype,tt);function it(t){return t.hasOwnProperty("rexSizer")||(t.rexSizer={}),t.rexSizer}function nt(){}var st,rt=Phaser.Display.Align,ot={center:rt.CENTER,left:rt.LEFT_CENTER,right:rt.RIGHT_CENTER,top:rt.TOP_CENTER,bottom:rt.BOTTOM_CENTER,"left-top":rt.TOP_LEFT,"left-center":rt.LEFT_CENTER,"left-bottom":rt.BOTTOM_LEFT,"center-top":rt.TOP_CENTER,"center-center":rt.CENTER,"center-bottom":rt.BOTTOM_CENTER,"right-top":rt.TOP_RIGHT,"right-center":rt.RIGHT_CENTER,"right-bottom":rt.BOTTOM_RIGHT},ht=new Phaser.GameObjects.Zone({sys:{queueDepthSort:nt,events:{once:nt}}},0,0,1,1);ht.setOrigin(0);function at(t){return void 0!==t.displayWidth?t.displayWidth:t.width}function lt(t){return void 0!==t.displayHeight?t.displayHeight:t.height}function ut(t){var e=lt(t);return t.y+e-e*t.originY}function ct(t){var e=at(t);return t.x-e*t.originX+.5*e}function dt(t,e){var i=lt(t);return t.y=e-i+i*t.originY,t}function vt(t,e){var i=at(t),n=i*t.originX;return t.x=e+n-.5*i,t}function pt(t){var e=at(t);return t.x-e*t.originX}function ft(t,e){var i=at(t);return t.x=e+i*t.originX,t}function yt(t){var e=at(t);return t.x+e-e*t.originX}function gt(t,e){var i=at(t);return t.x=e-i+i*t.originX,t}function mt(t,e){var i=lt(t),n=i*t.originY;return t.y=e+n-.5*i,t}function bt(t){var e=lt(t);return t.y-e*t.originY+.5*e}function kt(t){var e=lt(t);return t.y-e*t.originY}function xt(t,e){var i=lt(t);return t.y=e+i*t.originY,t}var St=0,Ct=1,Ot=2,Et=4,wt=6,_t=8,Pt=10,Mt=12,Tt=[];Tt[11]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),vt(t,ct(e)+i),dt(t,ut(e)+n),t},Tt[Pt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ft(t,pt(e)-i),dt(t,ut(e)+n),t},Tt[Mt]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),gt(t,yt(e)+i),dt(t,ut(e)+n),t},Tt[wt]=function(t,e,i,n){var s,r,o;return void 0===i&&(i=0),void 0===n&&(n=0),s=t,r=ct(e)+i,o=bt(e)+n,vt(s,r),mt(s,o),t},Tt[Et]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ft(t,pt(e)-i),mt(t,bt(e)+n),t},Tt[_t]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),gt(t,yt(e)+i),mt(t,bt(e)+n),t},Tt[Ct]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),vt(t,ct(e)+i),xt(t,kt(e)-n),t},Tt[St]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),ft(t,pt(e)-i),xt(t,kt(e)-n),t},Tt[Ot]=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),gt(t,yt(e)+i),xt(t,kt(e)-n),t};function Yt(t,e,i,n,s){return Tt[i](t,e,n,s)}function zt(t,e,i,n,s,r){ht.setPosition(e,i).setSize(n,s),Yt(t,ht,r)}function Dt(t,e){return void 0===e&&(e={}),"number"==typeof t?(e.left=t,e.right=t,e.top=t,e.bottom=t):(e.left=Bt(t,"left",0),e.right=Bt(t,"right",0),e.top=Bt(t,"top",0),e.bottom=Bt(t,"bottom",0)),e}function Rt(t){return Ut.call(this,t),this.sizerEventsEnable&&(t.emit("sizer.add",t,this),this.emit("add",t,this)),this}function Lt(t,e){return void 0===this.childrenMap&&(this.childrenMap={}),this.childrenMap[t]=e,this}function jt(t,e){return void 0===e?t:t[e]}function Vt(t,e,i){var n=u(e);"string"===n?t[e]=i:"number"===n?(t.left=e,t.right=e,t.top=e,t.bottom=e):(t.left=Zt(e,"left",0),t.right=Zt(e,"right",0),t.top=Zt(e,"top",0),t.bottom=Zt(e,"bottom",0))}function At(t){return void 0===t&&(t=Math.max(this.childrenWidth,this.minWidth)),t}function Xt(t){var e=Math.max(this.childrenHeight,this.minHeight);return void 0===t&&(t=e),t}function Wt(){this._childrenWidth=void 0,this._childrenHeight=void 0;for(var t,e=this.getChildrenSizers(),i=0,n=e.length;i<n;i++)(t=e[i]).ignoreLayout||t.preLayout()}function Ht(t){return t instanceof te}var Ft=Phaser.Utils.Objects.GetValue,Nt=Phaser.GameObjects.Group,It=function(t){return t.add.text(0,0,"")},Gt=new Phaser.Geom.Rectangle,Bt=Phaser.Utils.Objects.GetValue,Ut=et.prototype.add,Jt={addBackground:function(t,e,i){return void 0===this.backgroundChildren&&(this.backgroundChildren=[]),"string"==typeof e&&(i=e,e=void 0),void 0===e&&(e=0),Rt.call(this,t),this.backgroundChildren.push(t),this.getSizerConfig(t).padding=Dt(e),void 0!==i&&this.addChildrenMap(i,t),this},isBackground:function(t){return void 0!==this.backgroundChildren&&-1!==this.backgroundChildren.indexOf(t)}},Kt=/(\S+)\[(\d+)\]/i,Zt=Phaser.Utils.Objects.GetValue,qt={getInnerPadding:function(t){return jt(this.space,t)},setInnerPadding:function(t,e){return Vt(this.space,t,e),this},getOutterPadding:function(t){return jt(this.getSizerConfig(this).padding,t)},setOuterPadding:function(t,e){return Vt(this.getSizerConfig(this).padding,t,e),this},getChildOutterPadding:function(t,e){return"string"==typeof t&&(t=this.getElement(t)),jt(this.getSizerConfig(t).padding,e)},setChildOuterPadding:function(t,e,i){return"string"==typeof t&&(t=this.getElement(t)),Vt(this.getSizerConfig(t).padding,e,i),this}},$t={getShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n<s;n++)(e=i[n]).rexSizer&&e.rexSizer.hidden||t.push(e);return t},getAllShownChildren:function(t){void 0===t&&(t=[]);for(var e,i=this.children,n=0,s=i.length;n<s;n++){if(!(e=i[n]).rexSizer||!e.rexSizer.hidden)if(t.push(e),e.hasOwnProperty("isRexContainerLite"))t.push.apply(t,o(e.getAllShownChildren()))}return t}},Qt={setEventEmitter:function(t,e){return void 0===e&&(e=Phaser.Events.EventEmitter),this._privateEE=!0===t||void 0===t,this._eventEmitter=this._privateEE?new e:t,this},destroyEventEmitter:function(){return this._eventEmitter&&this._privateEE&&this._eventEmitter.shutdown(),this},getEventEmitter:function(){return this._eventEmitter},on:function(){return this._eventEmitter&&this._eventEmitter.on.apply(this._eventEmitter,arguments),this},once:function(){return this._eventEmitter&&this._eventEmitter.once.apply(this._eventEmitter,arguments),this},off:function(){return this._eventEmitter&&this._eventEmitter.off.apply(this._eventEmitter,arguments),this},emit:function(t){return this._eventEmitter&&t&&this._eventEmitter.emit.apply(this._eventEmitter,arguments),this},addListener:function(){return this._eventEmitter&&this._eventEmitter.addListener.apply(this._eventEmitter,arguments),this},removeListener:function(){return this._eventEmitter&&this._eventEmitter.removeListener.apply(this._eventEmitter,arguments),this},removeAllListeners:function(){return this._eventEmitter&&this._eventEmitter.removeAllListeners.apply(this._eventEmitter,arguments),this},listenerCount:function(){return this._eventEmitter?this._eventEmitter.listenerCount.apply(this._eventEmitter,arguments):0},listeners:function(){return this._eventEmitter?this._eventEmitter.listeners.apply(this._eventEmitter,arguments):[]},eventNames:function(){return this._eventEmitter?this._eventEmitter.eventNames.apply(this._eventEmitter,arguments):[]}},te=Phaser.Scene,ee=Phaser.Utils.Objects.GetValue,ie=function(){function n(t,e){var i;f(this,n),this.parent=t,this.scene=null==(i=t)||"object"!==u(i)?null:Ht(i)?i:i.scene&&Ht(i.scene)?i.scene:i.parent&&i.parent.scene&&Ht(i.parent.scene)?i.parent.scene:void 0,this.isShutdown=!1,this.setEventEmitter(ee(e,"eventEmitter",!0)),this.parent&&this.parent===this.scene?this.scene.events.once("shutdown",this.onSceneDestroy,this):this.parent&&this.parent.once&&this.parent.once("destroy",this.onParentDestroy,this)}return i(n,[{key:"shutdown",value:function(){this.isShutdown||(this.parent&&this.parent===this.scene?this.scene.events.off("shutdown",this.onSceneDestroy,this):this.parent&&this.parent.once&&this.parent.off("destroy",this.onParentDestroy,this),this.destroyEventEmitter(),this.parent=void 0,this.scene=void 0,this.isShutdown=!0)}},{key:"destroy",value:function(t){this.shutdown(t)}},{key:"onSceneDestroy",value:function(){this.destroy(!0)}},{key:"onParentDestroy",value:function(t,e){this.destroy(e)}}]),n}();Object.assign(ie.prototype,Qt);var ne=Phaser.Geom.Rectangle;Phaser.Scale.Center;function se(t){return i=t,n="complete",new Promise(function(t,e){i.once(n,function(){t()})});var i,n}function re(e,t){t.completeEventName=void 0,t.on("complete",function(){t.completeEventName&&(e.emit(t.completeEventName,e),t.completeEventName=void 0)}),t.on("update",function(){var t=e.getParentSizer();t&&t.resetChildPositionState(e)})}function oe(e,t){t.completeEventName=void 0,t.on("complete",function(){t.completeEventName&&(e.emit(t.completeEventName,e),t.completeEventName=void 0)}),t.on("update",function(){var t=e.getParentSizer();t&&t.resetChildAlphaState(e)})}function he(t,e){if("number"==typeof t)return t;var i=t[0],n=parseFloat(t.substr(2));switch(i){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n}}function ae(e,t){t.completeEventName=void 0,t.on("complete",function(){t.completeEventName&&(e.emit(t.completeEventName,e),t.completeEventName=void 0)}),t.on("update",function(){var t=e.getParentSizer();t&&t.resetChildPositionState(e)})}function le(t,e,i,n,s){return!(!t||!t.getBounds)&&(!(n&&!n(t,e,i))&&(!!(si=t.getBounds(si)).contains(e,i)&&!(s&&!s(t,e,i))))}function ue(t,e,i,n,s){return le(t,e,i,ri(n),oi(s))}function ce(t){return!(t.rexSizer&&t.rexSizer.hidden)}function de(t,e,i){!t||void 0===e&&void 0===i||(t.resize?(void 0===e&&(e=t.width),void 0===i&&(i=t.height),t.resize(e,i)):(void 0!==e&&(t.displayWidth=e),void 0!==i&&(t.displayHeight=i)))}function ve(t){var e,i;this.sizerEventsEnable&&(e=t,void 0===(i=this.getChildPrevState(t))?i={}:!0===i&&(i=hi),i.x=e.x,i.y=e.y,i.scaleX=e.scaleX,i.scaleY=e.scaleY,i.width=e.width,i.height=e.height,i.displayWidth=e.displayWidth,i.displayHeight=e.displayHeight,this.layoutedChildren.push(t))}function pe(t,e,i,n,s,r,o,h){zt(t,e,i,n,s,r),void 0!==o&&(t.x+=o),void 0!==h&&(t.y+=h),this.resetChildPositionState(t),this.sizerEventsEnable&&t.emit("sizer.postlayout",t,this)}var fe=new ne,ye=function(){y(s,ie);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,{eventEmitter:!1})).viewport=void 0,i.resetFromJSON(e),i.boot(),i}return i(s,[{key:"resetFromJSON",value:function(t){var e,i,n,s,r,o,h,a;void 0===t&&(t={}),void 0!==t.x?(e=null,i=t.x):void 0!==t.left?(e=0,i=t.left):void 0!==t.right?(e=1,i=t.right):void 0!==t.centerX&&(e=.5,i=t.centerX),void 0!==t.y?(n=null,s=t.y):void 0!==t.top?(n=0,s=t.top):void 0!==t.bottom?(n=1,s=t.bottom):void 0!==t.centerY&&(n=.5,s=t.centerY),void 0!==i&&(i=i.replace("left","0%").replace("right","100%").replace("center","50%").split("%"),r=parseFloat(i[0])/100,o=""===i[1]?0:parseFloat(i[1])),void 0!==s&&(s=s.replace("top","0%").replace("bottom","100%").replace("center","50%").split("%"),h=parseFloat(s[0])/100,a=""===s[1]?0:parseFloat(s[1]));var l,u,c=t.width;void 0!==c&&(c=c.split("%"),l=parseFloat(c[0])/100,u=""===c[1]?0:parseFloat(c[1]));var d,v,p=t.height;void 0!==p&&(p=p.split("%"),d=parseFloat(p[0])/100,v=""===p[1]?0:parseFloat(p[1])),this.setAlign(e,n),this.setPercentage(r,h),this.setOffset(o,a),this.setSizePercentage(l,d),this.setSizePadding(u,v);var f=t.onResizeCallback,y=t.onResizeCallbackScope;void 0!==f&&this.setResizeCallback(f,y);var g=t.onUpdateViewportCallback,m=t.onUpdateViewportCallbackScope;return void 0!==g&&this.setUpdateViewportCallback(g,m),this}},{key:"boot",value:function(){this.scene.scale.on("resize",this.anchor,this),this.anchor()}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.scale.off("resize",this.anchor,this),this.viewport=void 0,this.onUpdateViewportCallback=void 0,this.onUpdateViewportCallbackScope=void 0,this.onResizeCallback=void 0,this.onResizeCallbackScope=void 0,k(g(s.prototype),"shutdown",this).call(this,t))}},{key:"setAlign",value:function(t,e){return this.alignX=t,this.alignY=e,this}},{key:"setPercentage",value:function(t,e){return this.percentageX=t,this.percentageY=e,this}},{key:"setOffset",value:function(t,e){return this.offsetX=t,this.offsetY=e,this}},{key:"setSizePercentage",value:function(t,e){return this.percentageWidth=t,this.percentageHeight=e,this}},{key:"setSizePadding",value:function(t,e){return this.paddingWidth=t,this.paddingHeight=e,this}},{key:"setResizeCallback",value:function(t,e){return this.onResizeCallback=t,this.onResizeCallbackScope=e,this}},{key:"setUpdateViewportCallback",value:function(t,e){return this.onUpdateViewportCallback=t,this.onUpdateViewportCallbackScope=e,this}},{key:"anchor",value:function(){return this.updateViewport(),this.updateSize(),this.updatePosition(),this}},{key:"updateSize",value:function(){var t=this.onResizeCallback,e=this.onResizeCallbackScope,i=this.anchorWidth,n=this.anchorHeight;if((void 0!==i||void 0!==n)&&t){var s=this.parent;void 0===i&&(i=s.width),void 0===n&&(n=s.height),e?t.call(e,i,n,s,this):t(i,n,s,this)}}},{key:"updatePosition",value:function(){var t=this.parent;return null===this.alignX?t.x=this.anchorX:void 0!==this.alignX&&(t.x=this.anchorX+t.displayWidth*(t.originX-this.alignX)),null===this.alignY?t.y=this.anchorY:void 0!==this.alignY&&(t.y=this.anchorY+t.displayHeight*(t.originY-this.alignY)),this}},{key:"anchorX",get:function(){return this.viewport.x+this.viewport.width*this.percentageX+this.offsetX}},{key:"anchorY",get:function(){return this.viewport.y+this.viewport.height*this.percentageY+this.offsetY}},{key:"anchorWidth",get:function(){if(void 0!==this.percentageWidth)return this.viewport.width*this.percentageWidth+this.paddingWidth}},{key:"anchorHeight",get:function(){if(void 0!==this.percentageHeight)return this.viewport.height*this.percentageHeight+this.paddingHeight}},{key:"updateViewport",value:function(){this.viewport=function(t,e){void 0===e?e=new ne:!0===e&&(e=fe);var i,n,s=t.scale,r=s.baseSize,o=s.parentSize,h=s.canvasBounds,a=s.displayScale,l=0<=h.x?0:-(h.x*a.x),u=0<=h.y?0:-(h.y*a.y);return i=o.width>=h.width?r.width:r.width-(h.width-o.width)*a.x,n=o.height>=h.height?r.height:r.height-(h.height-o.height)*a.y,e.setTo(l,u,i,n),e}(this.scene,!this.viewport||this.viewport);var t=this.onUpdateViewportCallback,e=this.onUpdateViewportCallbackScope;t&&(e?t.call(e,this.viewport,this.parent,this):t(this.viewport,this.parent,this))}}]),s}(),ge=Phaser.Utils.Objects.GetValue,me=function(){y(s,ie);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e))._isRunning=!1,i.isPaused=!1,i.tickingState=!1,i.setTickingMode(ge(e,"tickingMode",1)),i}return i(s,[{key:"boot",value:function(){2!==this.tickingMode||this.tickingState||this.startTicking()}},{key:"shutdown",value:function(t){this.isShutdown||(this.stop(),this.tickingState&&this.stopTicking(),k(g(s.prototype),"shutdown",this).call(this,t))}},{key:"setTickingMode",value:function(t){"string"==typeof t&&(t=be[t]),this.tickingMode=t}},{key:"startTicking",value:function(){this.tickingState=!0}},{key:"stopTicking",value:function(){this.tickingState=!1}},{key:"isRunning",get:function(){return this._isRunning},set:function(t){this._isRunning!==t&&(this._isRunning=t,1===this.tickingMode&&t!=this.tickingState&&(t?this.startTicking():this.stopTicking()))}},{key:"start",value:function(){return this.isPaused=!1,this.isRunning=!0,this}},{key:"pause",value:function(){return this.isRunning&&(this.isPaused=!0,this.isRunning=!1),this}},{key:"resume",value:function(){return this.isPaused&&(this.isRunning=!0),this}},{key:"stop",value:function(){return this.isPaused=!1,this.isRunning=!1,this}},{key:"complete",value:function(){this.isPaused=!1,this.isRunning=!1,this.emit("complete",this.parent,this)}}]),s}(),be={no:0,lazy:1,always:2},ke=function(){y(e,me);var t=b(e);function e(){return f(this,e),t.apply(this,arguments)}return i(e,[{key:"startTicking",value:function(){k(g(e.prototype),"startTicking",this).call(this),this.scene.events.on("update",this.update,this)}},{key:"stopTicking",value:function(){k(g(e.prototype),"stopTicking",this).call(this),this.scene&&this.scene.events.off("update",this.update,this)}}]),e}(),xe=Phaser.Utils.Objects.GetValue,Se=Phaser.Math.Clamp,Ce=function(){function e(t){f(this,e),this.resetFromJSON(t)}return i(e,[{key:"resetFromJSON",value:function(t){this.state=xe(t,"state",Oe),this.timeScale=xe(t,"timeScale",1),this.delay=xe(t,"delay",0),this.repeat=xe(t,"repeat",0),this.repeatCounter=xe(t,"repeatCounter",0),this.duration=xe(t,"duration",0),this.nowTime=xe(t,"nowTime",0),this.justRestart=xe(t,"justRestart",!1)}},{key:"toJSON",value:function(){return{state:this.state,timeScale:this.timeScale,delay:this.delay,repeat:this.repeat,repeatCounter:this.repeatCounter,duration:this.duration,nowTime:this.nowTime,justRestart:this.justRestart}}},{key:"destroy",value:function(){}},{key:"setTimeScale",value:function(t){return this.timeScale=t,this}},{key:"setDelay",value:function(t){return void 0===t&&(t=0),this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"setRepeatInfinity",value:function(){return this.repeat=-1,this}},{key:"start",value:function(){return this.nowTime=0<this.delay?-this.delay:0,this.state=0<=this.nowTime?we:Ee,this.repeatCounter=0,this}},{key:"stop",value:function(){return this.state=Oe,this}},{key:"update",value:function(t,e){this.state!==Oe&&this.state!==_e&&0!==e&&0!==this.timeScale&&(this.nowTime+=e*this.timeScale,this.state=0<=this.nowTime?we:Ee,this.justRestart=!1,this.nowTime>=this.duration&&(-1===this.repeat||this.repeatCounter<this.repeat?(this.repeatCounter++,this.justRestart=!0,this.nowTime-=this.duration):(this.nowTime=this.duration,this.state=_e)))}},{key:"t",get:function(){var t;switch(this.state){case Oe:case Ee:t=0;break;case we:t=this.nowTime/this.duration;break;case _e:t=1}return Se(t,0,1)},set:function(t){(t=Se(t,-1,1))<0?(this.state=Ee,this.nowTime=-this.delay*t):(this.state=we,this.nowTime=this.duration*t,1===t&&0!==this.repeat&&this.repeatCounter++)}},{key:"isIdle",get:function(){return this.state===Oe}},{key:"isDelay",get:function(){return this.state===Ee}},{key:"isCountDown",get:function(){return this.state===we}},{key:"isRunning",get:function(){return this.state===Ee||this.state===we}},{key:"isDone",get:function(){return this.state===_e}},{key:"isOddIteration",get:function(){return 1==(1&this.repeatCounter)}},{key:"isEvenIteration",get:function(){return 0==(1&this.repeatCounter)}}]),e}(),Oe=0,Ee=1,we=2,_e=-1,Pe=function(){y(s,ke);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e)).timer=new Ce,i}return i(s,[{key:"shutdown",value:function(t){this.isShutdown||(k(g(s.prototype),"shutdown",this).call(this,t),this.timer.destroy(),this.timer=void 0)}},{key:"start",value:function(){return this.timer.start(),k(g(s.prototype),"start",this).call(this),this}},{key:"stop",value:function(){return this.timer.stop(),k(g(s.prototype),"stop",this).call(this),this}},{key:"complete",value:function(){return this.timer.stop(),k(g(s.prototype),"complete",this).call(this),this}}]),s}(),Me=Phaser.Utils.Objects.GetValue,Te=Phaser.Utils.Objects.GetAdvancedValue,Ye=Phaser.Tweens.Builders.GetEaseFunction,ze=function(){y(e,Pe);var t=b(e);function e(){return f(this,e),t.apply(this,arguments)}return i(e,[{key:"resetFromJSON",value:function(t){return this.timer.resetFromJSON(Me(t,"timer")),this.setEnable(Me(t,"enable",!0)),this.setDelay(Te(t,"delay",0)),this.setDuration(Te(t,"duration",1e3)),this.setEase(Me(t,"ease","Linear")),this.setRepeat(Me(t,"repeat",0)),this}},{key:"setEnable",value:function(t){return null==t&&(t=!0),this.enable=t,this}},{key:"setDelay",value:function(t){return this.delay=t,this}},{key:"setDuration",value:function(t){return this.duration=t,this}},{key:"setEase",value:function(t){return void 0===t&&(t="Linear"),this.ease=t,this.easeFn=Ye(t),this}},{key:"setRepeat",value:function(t){return this.repeat=t,this}},{key:"start",value:function(){return this.timer.isRunning||k(g(e.prototype),"start",this).call(this),this}},{key:"restart",value:function(){return this.timer.stop(),this.start.apply(this,arguments),this}},{key:"update",value:function(t,e){if(!this.isRunning||!this.enable)return this;var i=this.parent;if(!i.active)return this;var n=this.timer;return n.update(t,e),n.isDelay||this.updateGameObject(i,n),this.emit("update",i,this),n.isDone&&this.complete(),this}},{key:"updateGameObject",value:function(){}}]),e}(),De=Phaser.Utils.Objects.GetValue,Re=Phaser.Utils.Objects.GetAdvancedValue,Le=Phaser.Math.Linear,je=function(){y(s,ze);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e)).scaleStart={},i.scaleEnd={},i.resetFromJSON(e),i.boot(),i}return i(s,[{key:"resetFromJSON",value:function(t){return k(g(s.prototype),"resetFromJSON",this).call(this,t),this.setMode(De(t,"mode",0)),this.setScaleRange(Re(t,"start",void 0),Re(t,"end",0)),this}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=Ve[t]),this.mode=t,this}},{key:"setScaleRange",value:function(t,e){return"number"==typeof t?(this.startX=t,this.startY=t):(this.startX=Re(t,"x",this.parent.scaleX),this.startY=Re(t,"y",this.parent.scaleY)),"number"==typeof e?(this.endX=e,this.endY=e):(this.endX=Re(e,"x",void 0),this.endY=Re(e,"y",void 0)),this.hasScaleX=void 0!==this.startX&&void 0!==this.endX,this.hasScaleY=void 0!==this.startY&&void 0!==this.endY,this}},{key:"start",value:function(){if(this.timer.isRunning)return this;var t=this.parent;return this.hasScaleX&&(t.scaleX=this.startX),this.hasScaleY&&(t.scaleY=this.startY),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),k(g(s.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),i=this.easeFn(i),this.hasScaleX&&(t.scaleX=Le(this.startX,this.endX,i)),this.hasScaleY&&(t.scaleY=Le(this.startY,this.endY,i))}},{key:"complete",value:function(){return k(g(s.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),s}(),Ve={stop:0,destroy:1,yoyo:2},Ae=Phaser.Utils.Objects.IsPlainObject,Xe={popUp:function(t,e,i){if(Ae(t)){var n=t;t=n.duration,e=n.orientation,i=n.ease}var s=void 0===this._scale;return this._scale=function(t,e,i,n,s){var r;switch(i){case 0:case"x":r={x:0};break;case 1:case"y":r={y:0};break;default:r=0}var o={mode:0,start:r,end:1,duration:e,ease:void 0===n?"Cubic":n};return void 0===s?s=new je(t,o):s.resetFromJSON(o),s.restart(),s}(this,t,e,i,this._scale),s&&re(this,this._scale),this._scale.completeEventName="popup.complete",this},popUpPromise:function(t,e,i){return this.popUp(t,e,i),se(this._scale)},scaleDownDestroy:function(t,e,i,n){if(Ae(t)){var s=t;t=s.duration,e=s.orientation,i=s.ease,n=s.destroy}var r=void 0===this._scale;return this._scale=function(t,e,i,n,s,r){s instanceof je&&(r=s,s=void 0),void 0===s&&(s=!0);var o={};switch(o.mode=s?1:0,i){case 0:case"x":o.end={x:0};break;case 1:case"y":o.end={y:0};break;default:o.end=0}return o.duration=e,o.ease=void 0===n?"Linear":n,void 0===r?r=new je(t,o):r.resetFromJSON(o),r.restart(),r}(this,t,e,i,n,this._scale),r&&re(this,this._scale),this._scale.completeEventName="scaledown.complete",this},scaleDownDestroyPromise:function(t,e,i,n){return this.scaleDownDestroy(t,e,i,n),se(this._scale)},scaleDown:function(t,e,i){return this.scaleDownDestroy(t,e,i,!1),this},scaleDownPromise:function(t,e,i){return this.scaleDown(t,e,i),se(this._scale)}},We=Phaser.Utils.Objects.GetValue,He=Phaser.Utils.Objects.GetAdvancedValue,Fe=Phaser.Math.Linear,Ne=function(){y(s,ze);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e)).resetFromJSON(e),i.boot(),i}return i(s,[{key:"resetFromJSON",value:function(t){return k(g(s.prototype),"resetFromJSON",this).call(this,t),this.setMode(We(t,"mode",0)),this.setAlphaRange(He(t,"start",this.parent.alpha),He(t,"end",0)),this}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=Ie[t]),this.mode=t,this}},{key:"setAlphaRange",value:function(t,e){return this.alphaStart=t,this.alphaEnd=e,this}},{key:"start",value:function(){return this.timer.isRunning||(this.parent.setAlpha(this.alphaStart),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),k(g(s.prototype),"start",this).call(this)),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),t.alpha=Fe(this.alphaStart,this.alphaEnd,i)}},{key:"complete",value:function(){return k(g(s.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),s}(),Ie={stop:0,destroy:1,yoyo:2},Ge=Phaser.Utils.Objects.IsPlainObject,Be=Phaser.Utils.Objects.IsPlainObject,Ue={fadeIn:function(t,e){Be(t)&&(t=t.duration);var i=void 0===this._fade;return this._fade=function(t,e,i,n){var s,r;r=Ge(i)?(s=i.start,i.end):i,void 0===s&&(s=0),void 0===r&&(r=1);var o={mode:0,start:s,end:r,duration:e};return void 0===n?n=new Ne(t,o):n.resetFromJSON(o),n.restart(),n}(this,t,e,this._fade),i&&oe(this,this._fade),this._fade.completeEventName="fadein.complete",this},fadeInPromoise:function(t,e){return this.fadeIn(t,e),se(this._fade)},fadeOutDestroy:function(t,e){if(Be(t)){var i=t;t=i.duration,e=i.destroy}var n=void 0===this._fade;return this._fade=function(t,e,i,n){i instanceof Ne&&(n=i,i=void 0),void 0===i&&(i=!0);var s={mode:i?1:0,end:0,duration:e};return void 0===n?n=new Ne(t,s):n.resetFromJSON(s),n.restart(),n}(this,t,e,this._fade),n&&oe(this,this._fade),this._fade.completeEventName="fadeout.complete",this},fadeOutDestroyPromise:function(t,e){return this.fadeOutDestroy(t,e),se(this._fade)},fadeOut:function(t){return this.fadeOutDestroy(t,!1),this},fadeOutPromise:function(t){return this.fadeOut(t),se(this._fade)}},Je=Phaser.Utils.Objects.GetValue,Ke=Phaser.Utils.Objects.GetAdvancedValue,Ze=Phaser.Math.Linear,qe=function(){y(s,ze);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e)).resetFromJSON(e),i.boot(),i}return i(s,[{key:"resetFromJSON",value:function(t){if(k(g(s.prototype),"resetFromJSON",this).call(this,t),this.setMode(Je(t,"mode",0)),t&&(t.hasOwnProperty("x")||t.hasOwnProperty("y"))){var e=Ke(t,"x",void 0),i=Ke(t,"y",void 0);this.setTargetPosition(e,i)}else this.setTargetPosition(t);return this}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=$e[t]),this.mode=t,this}},{key:"setTargetPosition",value:function(t,e){if("number"==typeof t||"number"==typeof e)this.startX=this.parent.x,this.startY=this.parent.y,this.endX=t,this.endY=e;else{var i=t;this.startX=Ke(i,"startX",void 0),this.startY=Ke(i,"startY",void 0),this.endX=Ke(i,"endX",void 0),this.endY=Ke(i,"endY",void 0)}return this.hasMoveX=void 0!==this.startX&&void 0!==this.endX,this.hasMoveY=void 0!==this.startY&&void 0!==this.endY,this}},{key:"start",value:function(){if(this.timer.isRunning)return this;var t=this.parent;return this.hasMoveX&&(t.x=this.startX),this.hasMoveY&&(t.y=this.startY),this.timer.setDelay(this.delay).setDuration(this.duration).setRepeat(2===this.mode?-1:0),k(g(s.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;e.isOddIteration&&(i=1-i),i=this.easeFn(i),this.hasMoveX&&(t.x=Ze(this.startX,this.endX,i)),this.hasMoveY&&(t.y=Ze(this.startY,this.endY,i))}},{key:"complete",value:function(){return k(g(s.prototype),"complete",this).call(this),1===this.mode&&this.parent.destroy(),this}}]),s}(),$e={stop:0,destroy:1,yoyo:2},Qe=Phaser.Utils.Objects.IsPlainObject,ti=Phaser.Math.Distance.Between,ei={moveFrom:function(t,e,i,n,s){if(Qe(t)){var r=t;e=r.x,i=r.y,t=r.hasOwnProperty("speed")?1e3*ti(e,i,this.x,this.y)/r.speed:r.duration,n=r.ease}var o=void 0===this._easeMove;return this._easeMove=function(t,e,i,n,s,r,o){r instanceof qe&&(o=r,r=void 0),void 0===r&&(r=!1);var h={};return h.mode=r?1:0,void 0!==i&&(h.startX=he(i,t.x),h.endX=t.x),void 0!==n&&(h.startY=he(n,t.y),h.endY=t.y),h.duration=e,h.ease=void 0===s?"Linear":s,void 0===o?o=new qe(t,h):o.resetFromJSON(h),o.restart(),o}(this,t,e,i,n,s,this._easeMove),o&&ae(this,this._easeMove),this._easeMove.completeEventName="movefrom.complete",this},moveFromPromise:function(t,e,i,n,s){return this.moveFrom(t,e,i,n,s),se(this._easeMove)},moveFromDestroy:function(t,e,i,n){return this.moveFrom(t,e,i,n,!0),this},moveFromDestroyPromise:function(t,e,i,n){return this.moveFromDestroy(t,e,i,n),se(this._easeMove)},moveTo:function(t,e,i,n,s){if(Qe(t)){var r=t;e=r.x,i=r.y,t=r.hasOwnProperty("speed")?1e3*ti(e,i,this.x,this.y)/r.speed:r.duration,n=r.ease}var o=void 0===this._easeMove;return this._easeMove=function(t,e,i,n,s,r,o){r instanceof qe&&(o=r,r=void 0),void 0===r&&(r=!1);var h={};return h.mode=r?1:0,void 0!==i&&(h.startX=t.x,h.endX=he(i,t.x)),void 0!==n&&(h.startY=t.y,h.endY=he(n,t.y)),h.duration=e,h.ease=void 0===s?"Linear":s,void 0===o?o=new qe(t,h):o.resetFromJSON(h),o.restart(),o}(this,t,e,i,n,s,this._easeMove),o&&ae(this,this._easeMove),this._easeMove.completeEventName="moveto.complete",this},moveToPromise:function(t,e,i,n,s){return this.moveTo(t,e,i,n,s),se(this._easeMove)},moveToDestroy:function(t,e,i,n){return this.moveTo(t,e,i,n,!0),this},moveToDestroyPromise:function(t,e,i,n){return this.moveToDestroy(t,e,i,n,!0),se(this._easeMove)}},ii=function(t,e){t&&(it(t).hidden=e,t.rexContainer.parent.setChildVisible(t,!e))},ni={show:function(t){return void 0===t&&(t=this),ii(t,!1),this},hide:function(t){return void 0===t&&(t=this),ii(t,!0),this},isShow:function(t){return void 0===t&&(t=this),!!(e=t)&&!it(e).hidden;var e}},si=void 0,ri=function(n){return n?function(t,e,i){return!!ce(t)&&(n(t,e,i),!0)}:ce},oi=function(t){return t},hi={},ai=Phaser.Display.Align.CENTER,li=Phaser.Utils.Objects.GetValue,ui=function(){y(s,ie);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e))._enable=void 0,t.setInteractive(li(e,"inputConfig",void 0)),i.resetFromJSON(e),i.boot(),i}return i(s,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.lastClickTime=void 0,this.setEnable(li(t,"enable",!0)),this.setMode(li(t,"mode",1)),this.setClickInterval(li(t,"clickInterval",100)),this.setDragThreshold(li(t,"threshold",void 0)),this}},{key:"boot",value:function(){var t=this.parent;t.on("pointerdown",this.onPress,this),t.on("pointerup",this.onRelease,this),t.on("pointerout",this.onPointOut,this),t.on("pointermove",this.onMove,this)}},{key:"shutdown",value:function(t){this.isShutdown||(this.pointer=null,k(g(s.prototype),"shutdown",this).call(this,t))}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t){t||this.cancel();var e=(this._enable=t)?"enable":"disable";this.emit(e,this,this.parent)}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setMode",value:function(t){return"string"==typeof t&&(t=ci[t]),this.mode=t,this}},{key:"setClickInterval",value:function(t){return this.clickInterval=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"onPress",value:function(t,e,i,n){void 0===this.pointer&&(this.pointer=t,0===this.mode&&this.click(t.downTime,t,n))}},{key:"onRelease",value:function(t,e,i,n){this.pointer===t&&(1===this.mode&&this.click(t.upTime,t,n),this.pointer=void 0)}},{key:"onPointOut",value:function(t){this.pointer===t&&this.cancel()}},{key:"onMove",value:function(t){this.pointer===t&&void 0!==this.dragThreshold&&t.getDistance()>=this.dragThreshold&&this.cancel()}},{key:"click",value:function(t,e,i){if(!this.enable)return this;if(void 0===t)return this.emit("click",this,this.parent,e,i),this;this.pointer=void 0;var n=this.lastClickTime;return void 0!==n&&t-n<=this.clickInterval||(this.lastClickTime=t,this.emit("click",this,this.parent,e,i)),this}},{key:"cancel",value:function(){return this.pointer=void 0,this}}]),s}(),ci={press:0,pointerdown:0,release:1,pointerup:1},di={onClick:function(t,e,i){return t&&(void 0===this._click&&(this._click=new ui(this,i)),this._click.on("click",t,e)),this},offClick:function(t,e){return void 0===this._click||this._click.off("click",t,e),this},enableClick:function(t){return void 0===this._click||this._click.setEnable(t),this},disableClick:function(){return void 0===this._click||this._click.setEnable(!1),this}},vi={getSizerConfig:it,getChildPrevState:function(t){var e=it(t);return e.hasOwnProperty("prevState")||(e.prevState={}),e.prevState},pushIntoBounds:function(t){return void 0===t&&(t=function(t,e){void 0===e&&(void 0===st&&(st=new Phaser.Geom.Rectangle),e=st);var i=t.game.config;return e.setTo(0,0,i.width,i.height),e}(this.scene)),this.left=Math.max(this.left,t.left),this.right=Math.min(this.right,t.right),this.top=Math.max(this.top,t.top),this.bottom=Math.min(this.bottom,t.bottom),this},drawBounds:function(t,e){var i,n,s,r,o=t.scene;if("number"==typeof e)i=e;else{i=Ft(e,"color",16777215);var h=Ft(e,"name",!1);h&&(n=Ft(h,"createTextCallback",It),s=Ft(h,"createTextCallbackScope",void 0),"string"==typeof(r=Ft(h,"align","left-top"))&&(r=ot[r]))}if(n&&!t.children){t.children=new Nt(o),t.once("destroy",function(t,e){t.children.destroy(!e),t.children=void 0});var a=t.clear.bind(t);t.clear=function(){a(),t.children.clear(!1,!0)}}for(var l,u,c=this.getAllShownChildren([this]),d=0,v=c.length;d<v;d++)(l=c[d]).getBounds&&(i&&t.lineStyle(1,i).strokeRectShape(l.getBounds(Gt)),l.name&&n&&(u=s?n.call(s,o):n(o))&&(u.setText(l.name),t.children.add(u),zt(u,Gt.x,Gt.y,Gt.width,Gt.height,r)));return this},resolveWidth:At,resolveChildrenWidth:function(t){var e,i;for(var n in this.sizerChildren)(e=this.sizerChildren[n])&&e.isRexSizer&&!e.ignoreLayout&&(i=this.getExpandedChildWidth(e,t),i=e.resolveWidth(i),e.resolveChildrenWidth(i))},resolveHeight:Xt,getChildWidth:function(t){return t.isRexSizer?Math.max(t.minWidth,t.childrenWidth):void 0!==t.minWidth?t.minWidth:at(t)},getChildHeight:function(t){return t.isRexSizer?Math.max(t.minHeight,t.childrenHeight):void 0!==t.minHeight?t.minHeight:lt(t)},getExpandedChildWidth:function(t,e){return e},getExpandedChildHeight:function(t,e){return e},getChildrenWidth:function(){return 0},getChildrenHeight:function(){return 0},addChildrenMap:Lt,addElement:Lt,getElement:function(t,e){if("string"==typeof t&&(t=t.split(".")),0!==t.length){var i=t.shift(),n=null;if("#"===i.charAt(0))i=i.substring(1),n=this.getByName(i,e);else if(-1===i.indexOf("["))this.childrenMap&&(n=this.childrenMap[i]);else{var s=i.match(Kt);if(null!=s&&this.childrenMap){var r=this.childrenMap[s[1]];r&&(n=r[s[2]])}}return 0===t.length?n:n&&n.childrenMap?n.getElement(t):null}},getAllChildrenSizers:function(t){void 0===t&&(t=[]);for(var e=t.length,i=this.getChildrenSizers(t),n=t.length,s=e;s<n;s++)i[s].getAllChildrenSizers(t);return t},getChildrenSizers:function(t){return void 0===t&&(t=[]),t},preLayout:Wt,layout:function(){return this.runLayout(),this},runLayout:function(t,e,i){if(this.ignoreLayout)return this;var n=!t;return n&&this.preLayout(),e=this.resolveWidth(e),n&&(this.resolveChildrenWidth(e),this.runWidthWrap(e)),i=this.resolveHeight(i),this.resize(e,i),this.sizerEventsEnable&&void 0===this.layoutedChildren&&(this.layoutedChildren=[]),this.layoutChildren(),this.layoutBackgrounds(),this.sizerEventsEnable&&(this.emit("postlayout",this.layoutedChildren,this),this.layoutedChildren.length=0),this.postLayout()},layoutChildren:function(){},runWidthWrap:function(t){var e,i;for(var n in this.sizerChildren)!(e=this.sizerChildren[n])||e.isRexSizer&&e.ignoreLayout||!e.runWidthWrap||(i=this.getExpandedChildWidth(e,t),e.isRexSizer&&(i=e.resolveWidth(i)),e.runWidthWrap(i));return this},layoutBackgrounds:function(){if(void 0!==this.backgroundChildren)for(var t,e,i,n,s,r,o,h=this.backgroundChildren,a=this.left,l=this.top,u=this.width,c=this.height,d=0,v=h.length;d<v;d++)(e=(t=h[d]).rexSizer).hidden||(i=e.padding,ve.call(this,t),n=a+i.left,s=l+i.top,r=u-i.left-i.right,o=c-i.top-i.bottom,de(t,r,o),pe.call(this,t,n,s,r,o,ai))},postLayout:function(){return this._anchor&&this._anchor.updatePosition(),this},setAnchor:function(t){void 0===t&&(t={});var n=t.hasOwnProperty("width"),s=t.hasOwnProperty("height"),e=t.hasOwnProperty("onResizeCallback");return!n&&!s||e||(t.onResizeCallback=function(t,e,i){n&&i.setMinWidth(t),s&&i.setMinHeight(e),i.layout()}),void 0===this._anchor?this._anchor=new ye(this,t):this._anchor.resetFromJSON(t),this},isInTouching:function(t,e){return void 0===e&&(e=this),function(t,e,i,n){if(e)return le(t,e.x,e.y,i,n);for(var s=t.scene.input.manager,r=s.pointersTotal,o=s.pointers,h=0;h<r;h++)if(e=o[h],le(t,e.x,e.y,i,n))return!0;return!1}(e,t)},pointToChild:function(t,e,i,n,s){var r;if((r=i)&&"function"==typeof r||(s=i,n=i=void 0),void 0===s&&(s=this.sizerChildren?this.sizerChildren:this.children),_(s)){for(var o,h=0,a=s.length;h<a;h++)if(o=s[h],ue(o,t,e,i,n))return o}else for(var l in s)if(o=s[l],ue(o,t,e,i,n))return o;return null},setDraggable:function(s,t){var e=u(s);return"string"===e?s=this.getElement(s):void 0!==s&&"object"==e||(t=s,s=this),void 0===t&&(t=!0),s.input&&s.input.hasOwnProperty("draggable")?s.input.draggable=t:t&&(s.setInteractive(),s.scene.input.setDraggable(s),s.on("drag",function(t,e,i){var n=this.getTopmostSizer();n.x+=e-s.x,n.y+=i-s.y},this)),this},broadcastEvent:function(){for(var t=this.getAllChildren([this]),e=0,i=t.length;e<i;e++){var n=t[e];n.emit.apply(n,arguments)}return this}};Object.assign(vi,qt,Jt,{getParentSizer:function(t){return this.getParent(t)},getTopmostSizer:function(t){return this.getTopmostParent(t)}},Xe,Ue,ei,di,ni,$t);var pi=Phaser.Utils.Objects.GetValue,fi=function(){y(l,et);var a=b(l);function l(t,e,i,n,s,r){var o;f(this,l),(o=a.call(this,t,e,i,2,2)).isRexSizer=!0,o.setMinSize(n,s),o.setName(pi(r,"name","")),o.rexSizer={},o.space={},o.backgroundChildren=void 0,o.sizerChildren=void 0,o.layoutedChildren=void 0;var h=pi(r,"anchor",void 0);return h&&o.setAnchor(h),o.setInnerPadding(pi(r,"space",0)),o.setDraggable(pi(r,"draggable",!1)),o.setSizerEventsEnable(pi(r,"sizerEvents",!1)),o.setDirty(!0),o}return i(l,[{key:"destroy",value:function(t){if(this.scene){if(t)for(var e=this.getAllChildrenSizers([this]),i=0,n=e.length;i<n;i++)e[i].sizerEventsEnable=!1;k(g(l.prototype),"destroy",this).call(this,t),this.backgroundChildren=void 0,this.sizerChildren=void 0,this.childrenMap=void 0,this.space=void 0,this.rexSizer=void 0,this.layoutedChildren=void 0}}},{key:"setMinSize",value:function(t,e){return this.setMinWidth(t).setMinHeight(e),this}},{key:"setMinWidth",value:function(t){return null==t&&(t=0),this.minWidth=t,this}},{key:"setMinHeight",value:function(t){return null==t&&(t=0),this.minHeight=t,this}},{key:"setDirty",value:function(t){return void 0===t&&(t=!0),this.dirty=t,this}},{key:"setSizerEventsEnable",value:function(t){return void 0===t&&(t=!0),this.sizerEventsEnable=t,this}},{key:"ignoreLayout",get:function(){return this.rexSizer.hidden||!this.dirty}},{key:"childrenWidth",get:function(){return void 0===this._childrenWidth&&(this._childrenWidth=this.getChildrenWidth()),this._childrenWidth}},{key:"childrenHeight",get:function(){return void 0===this._childrenHeight&&(this._childrenHeight=this.getChildrenHeight()),this._childrenHeight}},{key:"left",get:function(){return this.x-at(this)*this.originX},set:function(t){this.x+=t-this.left}},{key:"alignLeft",value:function(t){return this.left=t,this}},{key:"right",get:function(){return this.left+at(this)},set:function(t){this.x+=t-this.right}},{key:"alignRight",value:function(t){return this.right=t,this}},{key:"centerX",get:function(){return this.left+at(this)/2},set:function(t){this.x+=t-this.centerX}},{key:"alignCenterX",value:function(t){return this.centerX=t,this}},{key:"top",get:function(){return this.y-lt(this)*this.originY},set:function(t){this.y+=t-this.top}},{key:"alignTop",value:function(t){return this.top=t,this}},{key:"bottom",get:function(){return this.top+lt(this)},set:function(t){this.y+=t-this.bottom}},{key:"alignBottom",value:function(t){return this.bottom=t,this}},{key:"centerY",get:function(){return this.top+lt(this)/2},set:function(t){this.y+=t-this.centerY}},{key:"alignCenterY",value:function(t){return this.centerY=t,this}},{key:"innerLeft",get:function(){return this.left+this.space.left}},{key:"innerRight",get:function(){return this.right-this.space.right}},{key:"innerTop",get:function(){return this.top+this.space.top}},{key:"innerBottom",get:function(){return this.bottom-this.space.bottom}},{key:"innerWidth",get:function(){return this.width-this.space.left-this.space.right}},{key:"innerHeight",get:function(){return this.height-this.space.top-this.space.bottom}},{key:"minInnerWidth",get:function(){var t=this.minWidth-this.space.left-this.space.right;return Math.max(t,0)}},{key:"minInnerHeight",get:function(){var t=this.minHeight-this.space.top-this.space.bottom;return Math.max(t,0)}}]),l}();Object.assign(fi.prototype,vi);function yi(t,e,i,n,s,r,o,h){Rt.call(this,t);var a=u(e);if(null===e)return this;if("number"!==a)if("string"===a)e=Si[e];else if(bi(e)){var l;e=ki(l=e,"proportion",0),i=ki(l,"align",xi),n=ki(l,"padding",0),s=ki(l,"expand",!1),r=ki(l,"key",void 0),o=ki(l,"index",void 0),t.isRexSizer||(h=0===this.orientation?ki(l,"minWidth",void 0):ki(l,"minHeight",void 0))}return"string"==typeof i&&(i=ot[i]),void 0===e&&(e=0),void 0===i&&(i=xi),void 0===n&&(n=0),void 0===s&&(s=!1),t.isRexSizer||void 0!==h||(h=0===this.orientation?t._minWidth:t._minHeight),(l=this.getSizerConfig(t)).proportion=e,l.align=i,l.padding=Dt(n),l.expand=s,void 0===o||o>=this.sizerChildren.length?this.sizerChildren.push(t):this.sizerChildren.splice(o,0,t),!t.isRexSizer&&0<e&&(0===this.orientation?(t.minWidth=void 0===h?at(t):h,t.minHeight=void 0):(t.minWidth=void 0,t.minHeight=void 0===h?lt(t):h)),void 0!==r&&this.addChildrenMap(r,t),this}var gi=Phaser.GameObjects.Zone,mi=function(){y(n,gi);var i=b(n);function n(t){var e;return f(this,n),(e=i.call(this,t,0,0,1,1)).isRexSpace=!0,e}return n}(),bi=Phaser.Utils.Objects.IsPlainObject,ki=Phaser.Utils.Objects.GetValue,xi=Phaser.Display.Align.CENTER,Si={min:0,full:-1},Ci={add:yi,addSpace:function(t){return this.insertSpace(void 0,t),this},insertSpace:function(t,e){return void 0===e&&(e=1),yi.call(this,new mi(this.scene),{proportion:e,minWidth:0,minHeight:0,index:t}),this},insert:function(t,e,i,n,s,r,o){return yi.call(this,e,i,n,s,r,o,t),this}},Oi=Phaser.Utils.Array.Remove,Ei=et.prototype.remove,wi=et.prototype.clear,_i=Phaser.Utils.Array.Remove,Pi={remove:function(t,e){return this.getParentSizer(t)!==this||(_i(this.sizerChildren,t),function(t,e){return this.isBackground(t)&&Oi(this.backgroundChildren,t),Ei.call(this,t,e),!e&&this.sizerEventsEnable&&(t.emit("sizer.remove",t,this),this.emit("remove",t,this)),this}.call(this,t,e)),this},removeAll:function(t){for(var e=this.sizerChildren.length-1;0<=e;e--)this.remove(this.sizerChildren[e],t);return this},clear:function(t){return this.sizerChildren.length=0,function(t){this.backgroundChildren&&(this.backgroundChildren.length=0);var e,i=!t&&this.sizerEventsEnable;if(i&&(e=this.getChildren([])),wi.call(this,t),i)for(var n,s=0,r=e.length;s<r;s++)(n=e[s]).emit("sizer.remove",n,this),this.emit("remove",n,this);return this}.call(this,t),this}},Mi={getChildrenWidth:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=0,h=r.length;o<h;o++)(e=r[o]).rexSizer.hidden||(n=0===e.rexSizer.proportion||t&&0<e.rexSizer.proportion?this.getChildWidth(e):0,n+=(i=e.rexSizer.padding).left+i.right,0<o&&(n+=this.space.item),s+=n);else for(o=0,h=r.length;o<h;o++)(e=r[o]).hasOwnProperty("rexSizer")&&(e.rexSizer.hidden||(i=e.rexSizer.padding,n=this.getChildWidth(e)+i.left+i.right,s=Math.max(n,s)));return s+this.space.left+this.space.right},getChildrenHeight:function(t){if(this.rexSizer.hidden)return 0;void 0===t&&(t=!0);var e,i,n,s=0,r=this.sizerChildren;if(0===this.orientation)for(var o=0,h=r.length;o<h;o++)(e=r[o]).rexSizer.hidden||(i=e.rexSizer.padding,n=this.getChildHeight(e)+i.top+i.bottom,s=Math.max(n,s));else for(o=0,h=r.length;o<h;o++)(e=r[o]).hasOwnProperty("rexSizer")&&(e.rexSizer.hidden||(i=e.rexSizer.padding,n=0===e.rexSizer.proportion||t&&0<e.rexSizer.proportion?this.getChildHeight(e):0,n+=i.top+i.bottom,0<o&&(n+=this.space.item),s+=n));return s+this.space.top+this.space.bottom},getExpandedChildWidth:function(t,e){var i;void 0===e&&(e=this.width);var n=t.rexSizer,s=n.padding;0===this.orientation?0<n.proportion&&0<this.proportionLength&&(i=n.proportion*this.proportionLength):n.expand&&(i=e-this.space.left-this.space.right-s.left-s.right);return i},getExpandedChildHeight:function(t,e){var i;void 0===e&&(e=this.height);var n=t.rexSizer,s=n.padding;0===this.orientation?n.expand&&(i=e-this.space.top-this.space.bottom-s.top-s.bottom):0<n.proportion&&0<this.proportionLength&&(i=n.proportion*this.proportionLength);return i},getChildrenSizers:function(t){void 0===t&&(t=[]);for(var e,i=this.sizerChildren,n=0,s=i.length;n<s;n++)(e=i[n]).isRexSizer&&t.push(e);return t},preLayout:function(){return this._childrenProportion=void 0,this.proportionLength=void 0,Wt.call(this),this},layoutChildren:function(){for(var t,e,i,n,s,r,o,h,a,l,u,c=this.sizerChildren,d=this.innerLeft,v=this.innerTop,p=this.innerWidth,f=this.innerHeight,y=d,g=v,m=0,b=c.length;m<b;m++)(t=this.rtl?c[b-m-1]:c[m]).rexSizer.hidden||(i=(e=t.rexSizer).padding,ve.call(this,t),a=t.isRexSpace?h=0:(h=this.getExpandedChildWidth(t),this.getExpandedChildHeight(t)),t.isRexSizer?(t.runLayout(this,h,a),u=this,(l=t).width<l.childrenWidth&&console.warn("Layout width error: Parent=".concat(u.constructor.name,", Child=").concat(l.constructor.name)),l.height<l.childrenHeight&&console.warn("Layout height error: Parent=".concat(u.constructor.name,", Child=").concat(l.constructor.name))):de(t,h,a),void 0===h&&(h=at(t)),void 0===a&&(a=lt(t)),o=0===this.orientation?(n=y+i.left,r=0===e.proportion||0===this.proportionLength?h:e.proportion*this.proportionLength,s=g+i.top,f-i.top-i.bottom):(n=y+i.left,r=p-i.left-i.right,s=g+i.top,0===e.proportion||0===this.proportionLength?a:e.proportion*this.proportionLength),pe.call(this,t,n,s,r,o,e.align),0===this.orientation?y+=r+i.left+i.right+this.space.item:g+=o+i.top+i.bottom+this.space.item)},resolveWidth:function(t){t=At.call(this,t);if(void 0===this.proportionLength&&0===this.orientation){var e=t-this.childrenWidth;0<e?(e=t-this.getChildrenWidth(!1),this.proportionLength=e/this.childrenProportion):this.proportionLength=0}return t},resolveHeight:function(t,e){e=Xt.call(this,t,e);if(void 0===this.proportionLength&&1===this.orientation){var i=e-this.childrenHeight;0<i?(i=e-this.getChildrenHeight(!1),this.proportionLength=i/this.childrenProportion):this.proportionLength=0}return e}};Object.assign(Mi,Ci,Pi);var Ti={x:0,h:0,horizontal:0,"left-to-right":0,y:1,v:1,vertical:1,"top-to-bottom":1},Yi=Phaser.Utils.Objects.IsPlainObject,zi=Phaser.Utils.Objects.GetValue,Di=function(){y(l,fi);var a=b(l);function l(t,e,i,n,s,r,o){var h;return f(this,l),Yi(e)?(e=zi(o=e,"x",0),i=zi(o,"y",0),n=zi(o,"width",void 0),s=zi(o,"height",void 0),r=zi(o,"orientation",0)):Yi(n)?(n=zi(o=n,"width",void 0),s=zi(o,"height",void 0),r=zi(o,"orientation",0)):Yi(r)&&(r=zi(o=r,"orientation",0)),void 0===r&&(r=0),(h=a.call(this,t,e,i,n,s,o)).type="rexSizer",h.sizerChildren=[],h.setOrientation(r),h.setItemSpacing(zi(o,"space.item",0)),h.setRTL(zi(o,"rtl",!1)),h.addChildrenMap("items",h.sizerChildren),h}return i(l,[{key:"setOrientation",value:function(t){var e;return this.orientation=("string"==typeof(e=t)&&(e=Ti[e]),e),this}},{key:"setItemSpacing",value:function(t){return this.space.item=t,this}},{key:"setRTL",value:function(t){return void 0===t&&(t=!0),this.rtl=t,this}},{key:"childrenProportion",get:function(){return void 0===this._childrenProportion&&(this._childrenProportion=function(){for(var t,e,i=0,n=this.sizerChildren,s=0,r=n.length;s<r;s++)(t=n[s]).rexSizer.hidden||0<(e=t.rexSizer.proportion)&&(i+=e);return i}.call(this)),this._childrenProportion}}]),l}();Object.assign(Di.prototype,Mi);function Ri(t){var e=Wi(t,"scrollMode",0);return"string"==typeof e&&(e=Xi[e]),e}function Li(t,e,i){var n,s,r;return t.y===e.y?(n=Math.min(t.x,e.x),s=Math.max(t.x,e.x),r=Hi(i.x,n,s)):t.x===e.x&&(n=Math.min(t.y,e.y),s=Math.max(t.y,e.y),r=Hi(i.y,n,s)),r}function ji(t,e,i){this.enable&&(Fi.x=e,Fi.y=i,this.value=Li(this.getStartPoint(),this.getEndPoint(),Fi))}function Vi(t){if(this.enable&&t.isDown){Ni.x=t.worldX,Ni.y=t.worldY;var e=Li(this.getStartPoint(),this.getEndPoint(),Ni);this.stopEaseValue(),0===this.easeValueDuration||Math.abs(this.value-e)<.1?this.value=e:this.easeValueTo(e)}}function Ai(t,e){void 0===e&&(e=Ii);var i=this.childrenMap.thumb,n=i.x,s=i.y;return zt(i,this.innerLeft,this.innerTop,this.innerWidth,this.innerHeight,t),e.x=i.x,e.y=i.y,i.x=n,i.y=s,e}var Xi={v:0,vertical:0,h:1,horizontal:1},Wi=Phaser.Utils.Objects.GetValue,Hi=Phaser.Math.Percent,Fi={},Ni={},Ii={},Gi=Phaser.Display.Align.LEFT_CENTER,Bi=Phaser.Display.Align.TOP_CENTER,Ui={},Ji=Phaser.Display.Align.RIGHT_CENTER,Ki=Phaser.Display.Align.BOTTOM_CENTER,Zi={},qi=Phaser.Math.Linear,$i={},Qi=Phaser.Display.Align.LEFT_CENTER,tn=Phaser.Display.Align.TOP_CENTER,en=Phaser.Utils.Objects.GetValue,nn=Phaser.Math.Linear,sn=function(){y(s,ze);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e)).resetFromJSON(),i.boot(),i}return i(s,[{key:"start",value:function(t){if(this.timer.isRunning)return this;var e=this.parent;this.propertyKey=en(t,"key","value");var i=e[this.propertyKey];return this.fromValue=en(t,"from",i),this.toValue=en(t,"to",i),this.setEase(en(t,"ease",this.ease)),this.setDuration(en(t,"duration",this.duration)),this.timer.setDuration(this.duration),e[this.propertyKey]=this.fromValue,k(g(s.prototype),"start",this).call(this),this}},{key:"updateGameObject",value:function(t,e){var i=e.t;i=this.easeFn(i),t[this.propertyKey]=nn(this.fromValue,this.toValue,i)}}]),s}(),rn=Phaser.Math.Percent,on={setEaseValuePropName:function(t){return this.easeValuePropName=t,this},setEaseValueDuration:function(t){return this.easeValueDuration=t,this},setEaseValueFunction:function(t){return this.easeFunction=t,this},stopEaseValue:function(){return this.easeValueTask&&this.easeValueTask.stop(),this},easeValueTo:function(t,e,i){return null==t||(void 0!==e&&(t=rn(t,e,i)),void 0===this.easeValueTask&&(this.easeValueTask=new sn(this,{eventEmitter:null})),this.easeValueTask.restart({key:this.easeValuePropName,to:t,duration:this.easeValueDuration,ease:this.easeFunction})),this}},hn=Phaser.Utils.Objects.GetValue,an=Phaser.Math.Clamp,ln=Phaser.Math.Linear,un=Phaser.Math.Percent,cn=Phaser.Math.Snap.To,dn=function(){y(c,Di);var u=b(c);function c(t,e){var i;f(this,c),(i=u.call(this,t,e)).type="rexSlider",i.eventEmitter=hn(e,"eventEmitter",m(i));var n=hn(e,"background",void 0),s=hn(e,"track",void 0),r=hn(e,"indicator",void 0),o=hn(e,"thumb",void 0);n&&i.addBackground(n),s&&i.add(s,{proportion:1,expand:!0,minWidth:0,minHeight:0}),r&&i.pin(r),o&&i.pin(o);var h=hn(e,"input",0);switch("string"==typeof h&&(h=vn[h]),h){case 0:o&&(o.setInteractive(),i.scene.input.setDraggable(o),o.on("drag",ji,m(i)));break;case 1:i.setInteractive().on("pointerdown",Vi,m(i)).on("pointermove",Vi,m(i))}i.addChildrenMap("background",n),i.addChildrenMap("track",s),i.addChildrenMap("indicator",r),i.addChildrenMap("thumb",o);var a=hn(e,"valuechangeCallback",null);if(null!==a){var l=hn(e,"valuechangeCallbackScope",void 0);i.eventEmitter.on("valuechange",a,l)}return i.setEnable(hn(e,"enable",void 0)),i.setGap(hn(e,"gap",void 0)),i.setValue(hn(e,"value",0),hn(e,"min",void 0),hn(e,"max",void 0)),i.setEaseValuePropName("value").setEaseValueDuration(hn(e,"easeValue.duration",0)).setEaseValueFunction(hn(e,"easeValue.ease","Linear")),i}return i(c,[{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setGap",value:function(t){return this.gap=t,this}},{key:"value",get:function(){return this._value},set:function(t){void 0!==this.gap&&(t=cn(t,this.gap));var e=this._value;this._value=an(t,0,1),e!==this._value&&(this.updateThumb(this._value),this.updateIndicator(this._value),this.eventEmitter.emit("valuechange",this._value,e,this.eventEmitter))}},{key:"setValue",value:function(t,e,i){return null==t||(void 0!==e&&(t=un(t,e,i)),this.value=t),this}},{key:"addValue",value:function(t,e,i){return void 0!==e&&(t=un(t,e,i)),this.value+=t,this}},{key:"getValue",value:function(t,e){var i=this.value;return void 0!==t&&(i=ln(t,e,i)),i}},{key:"runLayout",value:function(t,e,i){return this.ignoreLayout||(k(g(c.prototype),"runLayout",this).call(this,t,e,i),this.updateThumb(),this.updateIndicator()),this}}]),c}(),vn={pan:0,drag:0,click:1,none:-1},pn={getStartPoint:function(t){if(void 0===t&&(t=Ui),this.childrenMap.thumb){var e=0===this.orientation?Gi:Bi;Ai.call(this,e,t)}else 0===this.orientation?(t.x=this.innerLeft+1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerTop+1);return t},getEndPoint:function(t){if(void 0===t&&(t=Zi),this.childrenMap.thumb){var e=0===this.orientation?Ji:Ki;Ai.call(this,e,t)}else 0===this.orientation?(t.x=this.innerRight-1,t.y=this.centerY):(t.x=this.centerX,t.y=this.innerBottom-1);return t},updateThumb:function(t){var e,i,n,s,r=this.childrenMap.thumb;return void 0===r||(void 0===t&&(t=this.value),e=t,i=this.getStartPoint(),n=this.getEndPoint(),void 0===(s=r)&&(s=$i),s.x=qi(i.x,n.x,e),s.y=qi(i.y,n.y,e),this.resetChildPositionState(r)),this},updateIndicator:function(t){var e,i,n=this.childrenMap.indicator;if(void 0===n)return this;void 0===t&&(t=this.value);var s=this.childrenMap.thumb;if(s)if(0===this.orientation){var r=at(s);e=s.x-r*s.originX+r-this.left}else{var o=lt(s);i=s.y-o*s.originY+o-this.top}else 0===this.orientation?e=this.width*t:i=this.height*t;de(n,e,i);var h=0===this.orientation?Qi:tn;Yt(n,this,h),this.resetChildPositionState(n)}};Object.assign(dn.prototype,pn,on);function fn(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1===e.indexOf("."))return i;for(var n=e.split("."),s=t,r=i,o=0;o<n.length;o++){if(!s.hasOwnProperty(n[o])){r=i;break}r=s[n[o]],s=s[n[o]]}return r}return i}var yn=function(){function o(t){f(this,o);var e=fn(t,"states",void 0);e&&this.addStates(e);var i=fn(t,"extend",void 0);if(i)for(var n in i)this.hasOwnProperty(n)&&void 0!==this[n]||(this[n]=i[n]);var s=fn(t,"eventEmitter",void 0),r=fn(t,"EventEmitterClass",void 0);this.setEventEmitter(s,r),this._stateLock=!1,this.resetFromJSON(t)}return i(o,[{key:"shutdown",value:function(){this.destroyEventEmitter()}},{key:"destroy",value:function(){this.shutdown()}},{key:"resetFromJSON",value:function(t){this.setEnable(fn(t,"enable",!0)),this.start(fn(t,"start",void 0));var e=fn(t,"init",void 0);return e&&e.call(this),this}},{key:"toJSON",value:function(){return{curState:this.state,prevState:this.prevState,enable:this.enable,start:this._start}}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"state",get:function(){return this._state},set:function(t){if(this.enable&&!this._stateLock&&this._state!==t){if(this._prevState=this._state,this._state=t,this._stateLock=!0,this.emit("statechange",this),null!=this._prevState){var e="exit_"+this._prevState,i=this[e];i&&i.call(this),this.emit(e,this)}if(this._stateLock=!1,null!=this._state){var n="enter_"+this._state,s=this[n];s&&s.call(this),this.emit(n,this)}}}},{key:"prevState",get:function(){return this._prevState}},{key:"start",value:function(t){return this._start=t,this._prevState=void 0,this._state=t,this}},{key:"goto",value:function(t){return null!=t&&(this.state=t),this}},{key:"next",value:function(){var t,e=this["next_"+this.state];return e&&(t="string"==typeof e?e:e.call(this)),this.goto(t),this}},{key:"addState",value:function(t,e){var i=fn(e,"next",void 0);i&&(this["next_"+t]=i);var n=fn(e,"exit",void 0);n&&(this["exit_"+t]=n);var s=fn(e,"enter",void 0);return s&&(this["enter_"+t]=s),this}},{key:"addStates",value:function(t){for(var e in t)this.addState(e,t[e]);return this}},{key:"update",value:function(t,e,i){void 0===i&&(i="update");var n=this[i+"_"+this.state];n&&n.call(this,t,e)}},{key:"preupdate",value:function(t,e){this.update(t,e,"preupdate")}},{key:"postupdate",value:function(t,e){this.update(t,e,"postupdate")}}]),o}();Object.assign(yn.prototype,Qt);var gn=function(){y(s,yn);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,e)).parent=t,i.init(),i}return i(s,[{key:"init",value:function(){this.start("IDLE")}},{key:"next_IDLE",value:function(){var t,e=this.parent;return e.dragState.isDown&&(t=0===e.dragThreshold?"DRAG":"DRAGBEGIN"),t}},{key:"update_IDLE",value:function(){this.next()}},{key:"next_DRAGBEGIN",value:function(){var t=this.parent,e=t.dragState;return e.isDown?e.pointer.getDistance()>=t.dragThreshold?"DRAG":"DRAGBEGIN":"IDLE"}},{key:"update_DRAGBEGIN",value:function(){this.next()}},{key:"next_DRAG",value:function(){var t,e=this.parent;return e.dragState.isUp&&(t=e.outOfBounds?"BACK":e.slidingEnable?"SLIDE":"IDLE"),t}},{key:"update_DRAG",value:function(){var t=this.parent;t.dragState.justMoved&&t.dragging(),this.next()}},{key:"next_SLIDE",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isSliding||(t="IDLE"),t}},{key:"enter_SLIDE",value:function(){this.parent.onSliding()}},{key:"exit_SLIDE",value:function(){this.parent.stop()}},{key:"update_SLIDE",value:function(t,e){this.parent.sliding(t,e),this.next()}},{key:"next_BACK",value:function(){var t,e=this.parent;return e.dragState.isDown?t="DRAG":e.isPullBack||(t="IDLE"),t}},{key:"enter_BACK",value:function(){this.parent.onPullBack()}},{key:"exit_BACK",value:function(){this.parent.stop()}},{key:"update_BACK",value:function(t,e){this.parent.pullBack(t,e),this.next()}}]),s}(),mn=Phaser.Utils.Objects.GetValue,bn=Phaser.Math.Distance.Between,kn=function(){y(s,ie);var n=b(s);function s(t,e){var i;return f(this,s),(i=n.call(this,t,e))._enable=void 0,t.setInteractive(mn(e,"inputConfig",void 0)),i.resetFromJSON(e),i.boot(),i}return i(s,[{key:"resetFromJSON",value:function(t){return this.pointer=void 0,this.isInTouched=!1,this.holdStartTime=void 0,this.x=void 0,this.y=void 0,this.preX=void 0,this.preY=void 0,this.localX=void 0,this.localY=void 0,this.justMoved=!1,this.setEnable(mn(t,"enable",!0)),this.holdThreshold=mn(t,"holdThreshold",50),this.pointerOutReleaseEnable=mn(t,"pointerOutRelease",!0),this}},{key:"boot",value:function(){this.parent.on("pointerdown",this.onPointIn,this),this.parent.on("pointerup",this.onPointOut,this),this.pointerOutReleaseEnable&&this.parent.on("pointerout",this.onPointOut,this),this.parent.on("pointermove",this.onPointerMove,this),this.scene.events.on("preupdate",this.preupdate,this)}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.events.off("preupdate",this.preupdate,this),this.pointer=void 0,k(g(s.prototype),"shutdown",this).call(this,t))}},{key:"enable",get:function(){return this._enable},set:function(t){this._enable!==t&&(t||(this.isInTouched=!1,this.pointer=void 0),this._enable=t)}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setPointerOutReleaseEnable",value:function(t){return void 0===t&&(t=!0),this.pointerOutReleaseEnable=t,this}},{key:"isDown",get:function(){return this.pointer&&this.pointer.isDown}},{key:"isUp",get:function(){return!this.isDown}},{key:"dx",get:function(){return this.x-this.preX}},{key:"dy",get:function(){return this.y-this.preY}},{key:"dt",get:function(){return this.scene.sys.game.loop.delta}},{key:"speed",get:function(){return this.x===this.preX&&this.y===this.preY?0:bn(this.preX,this.preY,this.x,this.y)/(.001*this.dt)}},{key:"speedX",get:function(){return this.dx/(.001*this.dt)}},{key:"speedY",get:function(){return this.dy/(.001*this.dt)}},{key:"onPointIn",value:function(t,e,i){this.enable&&t.isDown&&void 0===this.pointer&&(this.pointer=t,this.localX=e,this.localY=i)}},{key:"onPointOut",value:function(t){this.enable&&this.pointer===t&&(this.pointer=void 0)}},{key:"onPointerMove",value:function(t,e,i){this.enable&&t.isDown&&this.pointer===t&&(this.localX=e,this.localY=i)}},{key:"preupdate",value:function(t){if(this.enable){var e=this.pointer;this.justMoved=!1,e&&!this.isInTouched?(this.x=e.x,this.y=e.y,this.preX=e.x,this.preY=e.y,this.isInTouched=!0,this.holdStartTime=void 0,this.emit("touchstart",e,this.localX,this.localY)):e&&this.isInTouched?this.x===e.x&&this.y===e.y?void 0===this.holdStartTime?this.holdStartTime=t:t-this.holdStartTime>this.holdThreshold&&(this.preX=this.x,this.preY=this.y):(this.preX=this.x,this.preY=this.y,this.x=e.x,this.y=e.y,this.holdStartTime=void 0,this.justMoved=!0,this.emit("touchmove",e,this.localX,this.localY)):!e&&this.isInTouched&&(this.isInTouched=!1,this.holdStartTime=void 0,this.emit("touchend",e))}}}]),s}(),xn=Phaser.Utils.Objects.GetValue,Sn=function(){function e(t){f(this,e),this.resetFromJSON(t)}return i(e,[{key:"resetFromJSON",value:function(t){return this.setValue(xn(t,"value",0)),this.setSpeed(xn(t,"speed",0)),this.setAcceleration(xn(t,"acceleration",0)),this}},{key:"reset",value:function(){this.setValue(0),this.setSpeed(0),this.setAcceleration(0)}},{key:"setValue",value:function(t){return this.value=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"setAcceleration",value:function(t){return this.acceleration=t,this}},{key:"updateSpeed",value:function(t){return 0!==this.acceleration&&(this.speed+=this.acceleration*t,this.speed<0&&(this.speed=0)),this}},{key:"getDeltaValue",value:function(t){return this.updateSpeed(t),this.speed<=0?0:this.speed*t}},{key:"update",value:function(t){return this.updateSpeed(t),0<this.speed&&(this.value+=this.getDeltaValue(t)),this}},{key:"isMoving",get:function(){return 0<this.speed}}]),e}(),Cn=function(){function t(){f(this,t),this.value,this.dir,this.movement=new Sn}return i(t,[{key:"init",value:function(t,e,i,n,s){return this.value=t,this.end=s,this.dir=void 0!==s?t<s:e,this.movement.setSpeed(i).setAcceleration(-n),this}},{key:"stop",value:function(){this.movement.reset()}},{key:"update",value:function(t){var e=this.movement.getDeltaValue(t);return this.dir||(e=-e),void 0===this.end?this.value+=e:0===e?this.value=this.end:(this.value+=e,this.dir?this.value>this.end&&(this.value=this.end):this.value<this.end&&(this.value=this.end)),this}},{key:"isMoving",get:function(){return this.movement.isMoving}}]),t}(),On=Phaser.Utils.Objects.GetValue,En=Phaser.Math.Clamp,wn=function(){y(a,ie);var h=b(a);function a(t,e){var i;f(this,a),i=h.call(this,t,e);var n=On(e,"enable",!0);i._state=new gn(m(i),{enable:n,eventEmitter:!1});var s={inputConfig:On(e,"inputConfig",void 0),enable:n,pointerOutRelease:On(e,"pointerOutRelease",!0),eventEmitter:!1};i.dragState=new kn(t,s),i._enable=void 0,i._value=void 0,i._slowDown=new Cn;var r=On(e,"valuechangeCallback",null);if(null!==r){var o=On(e,"valuechangeCallbackScope",void 0);i.on("valuechange",r,o)}if(null!==(r=On(e,"overmaxCallback",null))){o=On(e,"overmaxCallbackScope",void 0);i.on("overmax",r,o)}if(null!==(r=On(e,"overminCallback",null))){o=On(e,"overminCallbackScope",void 0);i.on("overmin",r,o)}return i.resetFromJSON(e),i.boot(),i}return i(a,[{key:"resetFromJSON",value:function(t){this.setOrientationMode(On(t,"orientation",0)),this.setDragThreshold(On(t,"threshold",10)),this.setSlidingDeceleration(On(t,"slidingDeceleration",5e3)),this.setBackDeceleration(On(t,"backDeceleration",2e3));var e=On(t,"bounds",void 0);return e?this.setBounds(e):this.setBounds(On(t,"max",0),On(t,"min",0)),this.setValue(On(t,"value",this.maxValue||0)),this.setEnable(On(t,"enable",!0)),this}},{key:"boot",value:function(){this.scene.events.on("update",this._state.update,this._state)}},{key:"shutdown",value:function(t){this.isShutdown||(this.scene.events.off("update",this._state.update,this._state),this._state.destroy(t),this.dragState.destroy(t),this._state=void 0,this.dragState=void 0,k(g(a.prototype),"shutdown",this).call(this,t))}},{key:"enable",get:function(){return this._enable},set:function(t){if(this._enable!==t)return this._enable=t,this._state.setEnable(t),this.dragState.setEnable(t),this}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"toggleEnable",value:function(){return this.setEnable(!this.enable),this}},{key:"setOrientationMode",value:function(t){return"string"==typeof t&&(t=_n[t]),this.orientationMode=t,this}},{key:"setDragThreshold",value:function(t){return this.dragThreshold=t,this}},{key:"setSlidingDeceleration",value:function(t){return this.slidingDeceleration=t,this}},{key:"setBackDeceleration",value:function(t){return this.backDeceleration=t,this}},{key:"setBounds",value:function(t,e){if(Array.isArray(t)){var i=t;t=i[0],e=i[1]}return t<e?(this.minValue=t,this.maxValue=e):(this.minValue=e,this.maxValue=t),this}},{key:"value",get:function(){return this._value},set:function(t){if(t!==this._value){var e=this._value,i=this.overMax(t),n=this.overMin(t);i&&this.emit("overmax",t,e),n&&this.emit("overmin",t,e),this.backEnable||(i&&(t=this.maxValue),n&&(t=this.minValue)),this._value=t,this.emit("valuechange",t,e)}}},{key:"setValue",value:function(t,e){return void 0===e&&(e=!1),e&&(t=En(t,this.minValue,this.maxValue)),this.value=t,this}},{key:"addValue",value:function(t,e){return this.setValue(this.value+t,e),this}},{key:"state",get:function(){return this._state.state}},{key:"isDragging",get:function(){return this.dragState.isInTouched}},{key:"outOfMaxBound",get:function(){return this.overMax(this.value)}},{key:"outOfMinBound",get:function(){return this.overMin(this.value)}},{key:"outOfBounds",get:function(){return this.outOfMinBound||this.outOfMaxBound}},{key:"overMax",value:function(t){return null!=this.maxValue&&t>this.maxValue}},{key:"overMin",value:function(t){return null!=this.minValue&&t<this.minValue}},{key:"backEnable",get:function(){return"number"==typeof this.backDeceleration}},{key:"isPullBack",get:function(){return this._slowDown.isMoving}},{key:"slidingEnable",get:function(){return"number"==typeof this.slidingDeceleration}},{key:"isSliding",get:function(){return this._slowDown.isMoving}},{key:"dragDelta",get:function(){return 0===this.orientationMode?this.dragState.dy:1===this.orientationMode?this.dragState.dx:0}},{key:"dragSpeed",get:function(){return 0===this.orientationMode?this.dragState.speedY:1===this.orientationMode?this.dragState.speedX:0}},{key:"dragging",value:function(){this.value+=this.dragDelta}},{key:"onSliding",value:function(){var t=this.value,e=this.dragSpeed;if(0===e)return this._slowDown.stop(),void this._state.next();var i=this.slidingDeceleration;this._slowDown.init(t,0<e,Math.abs(e),i)}},{key:"sliding",value:function(t,e){e*=.001;var i=this._slowDown.update(e).value;this.overMax(i)?(this.value=this.maxValue,this._slowDown.stop()):this.overMin(i)?(this.value=this.minValue,this._slowDown.stop()):this.value=i}},{key:"onPullBack",value:function(){var t=this.value,e=this.outOfMinBound?this.minValue:this.maxValue,i=Math.abs(e-t),n=this.backDeceleration,s=Math.sqrt(2*n*i);this._slowDown.init(t,void 0,s,n,e)}},{key:"pullBack",value:function(t,e){e*=.001,this.value=this._slowDown.update(e).value,this._slowDown.isMoving||this._state.next()}},{key:"stop",value:function(){this._slowDown.stop()}}]),a}(),_n={y:0,v:0,vertical:0,x:1,h:1,horizontal:1},Pn=Phaser.Utils.Objects.GetValue,Mn=function(){y(s,ie);var n=b(s);function s(t,e){var i;(f(this,s),(i=n.call(this,t,e)).parent!==i.scene?i.focusMode=Pn(e,"focus",!1):i.focusMode=!1,i.setSpeed(Pn(e,"speed",.1)),i.setEnable(Pn(e,"enable",!0)),i.focusMode)?(t=i.parent).setInteractive(Pn(e,"inputConfig",void 0)).on("wheel",function(t,e,i,n,s){this.enable&&this.scroll(i)},m(i)):i.scene.input.on("wheel",i.onSceneScroll,m(i));return i}return i(s,[{key:"destroy",value:function(){this.focusMode||this.scene.input.off("wheel",this.onSceneScroll,this)}},{key:"onSceneScroll",value:function(t,e,i,n){this.enable&&this.scroll(n)}},{key:"setEnable",value:function(t){return void 0===t&&(t=!0),this.enable=t,this}},{key:"setSpeed",value:function(t){return this.speed=t,this}},{key:"scroll",value:function(t){t*=this.speed,this.emit("scroll",t,this.parent,this)}}]),s}(),Tn=Phaser.Utils.Objects.GetValue,Yn={right:0,left:1,bottom:0,top:1},zn=Phaser.Utils.Objects.GetValue,Dn=Phaser.Math.Clamp,Rn=function(){y(p,Di);var v=b(p);function p(t,e){var i;f(this,p),void 0===e&&(e={});var n=Ri(e);e.orientation=0===n?1:0,(i=v.call(this,t,e)).type=zn(e,"type","rexScrollable");var s=zn(e,"background",void 0),r=function(e,t){var i,n=e.scene,s=Ri(t),r=new Di(n,{orientation:s}),o=Tn(t,"child.gameObject",void 0),h=Tn(t,"slider",void 0),a=Tn(h,"position",0);"string"==typeof a&&(a=Yn[a]);var l,u,c=0===a,d=Tn(t,"scroller",!0),v=Tn(t,"mouseWheelScroller",!1);if(o){var p=Tn(t,"space.child",0),f={};if(e.childMargin={},"number"!=typeof p){var y=p;0===s?(f.left=Tn(y,"left",0),f.right=Tn(y,"right",0),e.childMargin.top=Tn(y,"top",0),e.childMargin.bottom=Tn(y,"bottom",0)):(f.top=Tn(y,"top",0),f.bottom=Tn(y,"bottom",0),e.childMargin.top=Tn(y,"left",0),e.childMargin.bottom=Tn(y,"right",0))}else h&&(f=0===s?c?{right:p}:{left:p}:c?{bottom:p}:{top:p}),e.childMargin.top=0,e.childMargin.bottom=0;h&&(!0===h&&(h={}),h.orientation=0===r.orientation?1:0,i=new dn(n,h)),d&&(!0===d&&(d={}),d.orientation=s,l=new wn(o,d)),v&&(u=new Mn(o,v)),i&&!c&&r.add(i,{proportion:0,align:"center",expand:!0});var g=Tn(t,"child.proportion",1),m=Tn(t,"child.expand",!0);r.add(o,{proportion:g,align:"center",padding:f,expand:m}),i&&c&&r.add(i,{proportion:0,align:"center",expand:!0})}return i&&i.on("valuechange",function(t){e.t=t,e.emit("scroll",e)}),l&&l.on("valuechange",function(t){e.childOY=t,e.emit("scroll",e)}),u&&u.on("scroll",function(t){e.addChildOY(-t,!0)}),e.addChildrenMap("child",o),e.addChildrenMap("slider",i),e.addChildrenMap("scroller",l),e.addChildrenMap("mouseWheelScroller",u),r}(m(i),e),o=zn(e,"header",void 0),h=zn(e,"footer",void 0);if(s&&i.addBackground(s),o){var a=zn(e,"align.header","center"),l=zn(e,"space.header",0);c=0===n?{bottom:l}:{right:l};var u=zn(e,"expand.header",!0);i.add(o,{proportion:0,align:a,padding:c,expand:u})}if(r&&i.add(r,{proportion:1,align:"center",padding:0,expand:!0}),h){a=zn(e,"align.footer","center");var c,d=zn(e,"space.footer",0);c=0===n?{top:d}:{left:d};u=zn(e,"expand.footer",!0);i.add(h,{proportion:0,align:a,padding:c,expand:u})}return i.addChildrenMap("background",s),i.addChildrenMap("header",o),i.addChildrenMap("footer",h),i}return i(p,[{key:"runLayout",value:function(t,e,i){return this.ignoreLayout||(k(g(p.prototype),"runLayout",this).call(this,t,e,i),this.resizeController()),this}},{key:"t",get:function(){var t=this.childrenMap.child.t,e=this.childMargin;if(0!==e.top||0!==e.bottom){var i=this.childrenMap.child,n=i.topChildOY-i.bottomChildOY,s=n+e.top+e.bottom;t=(n*t+e.top)/s}return t},set:function(t){var e=this.childMargin;if(0!==e.top||0!==e.bottom){var i=this.childrenMap.child,n=i.topChildOY-i.bottomChildOY;t=((n+e.top+e.bottom)*t-e.top)/n}this.childrenMap.child.t=t,this.updateController()}},{key:"childOY",get:function(){return this.childrenMap.child.childOY},set:function(t){this.childrenMap.child.childOY=t,this.updateController()}},{key:"topChildOY",get:function(){return this.childrenMap.child.topChildOY+this.childMargin.top}},{key:"bottomChildOY",get:function(){return this.childrenMap.child.bottomChildOY-this.childMargin.bottom}},{key:"isOverflow",get:function(){var t=this.childrenMap.child;return t.topChildOY!==t.bottomChildOY}},{key:"scrollMode",get:function(){return 0===this.orientation?1:0}},{key:"setChildOY",value:function(t,e){return void 0===e&&(e=!1),e&&(t=Dn(t,this.bottomChildOY,this.topChildOY)),this.childOY=t,this}},{key:"addChildOY",value:function(t,e){return this.setChildOY(this.childOY+t,e),this}},{key:"setT",value:function(t,e){return void 0===e&&(e=!1),e&&(t=Dn(t,0,1)),this.t=t,this}},{key:"addT",value:function(t,e){return this.setT(this.t+t,e),this}},{key:"scrollToTop",value:function(){return this.t=0,this}},{key:"scrollToBottom",value:function(){return this.t=1,this}},{key:"sliderEnable",get:function(){var t=this.childrenMap.slider;return!!t&&t.enable},set:function(t){var e=this.childrenMap.slider;e&&e.setEnable(t)}},{key:"setSliderEnable",value:function(t){return void 0===t&&(t=!0),this.sliderEnable=t,this}},{key:"scrollerEnable",get:function(){var t=this.childrenMap.scroller;return!!t&&t.enable},set:function(t){var e=this.childrenMap.scroller;e&&e.setEnable(t)}},{key:"setScrollerEnable",value:function(t){return void 0===t&&(t=!0),this.scrollerEnable=t,this}},{key:"mouseWheelScrollerEnable",get:function(){var t=this.childrenMap.mouseWheelScroller;return!!t&&t.enable},set:function(t){var e=this.childrenMap.mouseWheelScrollerEnable;e&&e.setEnable(t)}},{key:"setMouseWheelScrollerEnable",value:function(t){return void 0===t&&(t=!0),this.mouseWheelScrollerEnable=t,this}}]),p}(),Ln={resizeController:function(){var t=this.topChildOY,e=this.bottomChildOY,i=this.childrenMap.scroller,n=this.childrenMap.slider;return i&&i.setBounds(e,t),n&&n.setEnable(e!==t),this.updateController(),this},updateController:function(){var t=this.childrenMap.scroller,e=this.childrenMap.slider;t&&t.setValue(this.childOY),e&&e.setValue(this.t)}};Object.assign(Rn.prototype,Ln);function jn(t){return t instanceof Fn?2:t instanceof Hn?0:1}function Vn(t,e,i,n,s){switch(this.clear().fillStyle(16777215),this.shape){case 1:var r=Math.min(t,e)/2;this.fillCircle(-t*(n-.5),-e*(s-.5),r+i);break;default:this.fillRect(-t*n-i,-e*s-i,t+2*i,e+2*i)}}function An(t){return(t-this.textLineSpacing)/(this.textLineHeight+this.textLineSpacing)}function Xn(t){return t*(this.textLineHeight+this.textLineSpacing)-this.textLineSpacing}function Wn(){var t=this.textObject.rexSizer;this.textObject.y+=t.offsetY-t.preOffsetY,t.preOffsetY=t.offsetY,this.resetChildPositionState(this.textObject)}var Hn=Phaser.GameObjects.Text,Fn=Phaser.GameObjects.BitmapText,Nn=Phaser.GameObjects.Graphics,In=function(){y(r,Nn);var s=b(r);function r(t,e,i){var n;return f(this,r),void 0===e&&(e=0),"string"==typeof e&&(e=Gn[e]),void 0===i&&(i=0),(n=s.call(this,t.scene)).parent=t,n.shape=e,n.padding=i,n.setPosition().resize().setVisible(!1),n}return i(r,[{key:"destroy",value:function(){return this.parent=void 0,k(g(r.prototype),"destroy",this).call(this),this}},{key:"setPosition",value:function(t,e){var i=this.parent;return void 0===t&&(t=i.x),void 0===e&&(e=i.y),k(g(r.prototype),"setPosition",this).call(this,t,e),this}},{key:"resize",value:function(t,e,i){var n=this.parent;return void 0===t&&(t=n.width),void 0===e&&(e=n.height),void 0===i&&(i=this.padding),this.widthSave===t&&this.heightSave===e&&this.paddingSave===i||(this.widthSave=t,this.heightSave=e,this.paddingSave=i,this.originXSave=n.originX,this.originYSave=n.originY,Vn.call(this,t,e,i,n.originX,n.originY)),this}},{key:"setOrigin",value:function(t,e){void 0===e&&(e=t);var i=this.parent;return void 0===t&&(t=i.originX),void 0===e&&(e=i.originY),this.originXSave===t&&this.originYSave===e||(this.originXSave=t,this.originYSave=e,Vn.call(this,this.widthSave,this.heightSave,this.paddingSave,t,e)),this}}]),r}(),Gn={rectangle:0,circle:1},Bn={setText:function(t){return void 0!==t&&(this.text=t),this.lines=function(t,e,i){switch(jn(t)){case 0:i=t.getWrappedText(e);break;case 1:i=t.getPenManager(e,i);break;case 2:i=t.setText(e).getTextBounds().wrappedText.split("\n")}return i}(this.textObject,this.text,this.lines),this.linesCount=this.lines.length,this._textHeight=void 0,this._textVisibleHeight=void 0,this.updateTextObject(),this},updateTextObject:function(){var t=Math.max(Math.floor(An.call(this,-this.textOY)),0),e=Xn.call(this,t)+this.textOY,i=function(t){var e,i=t+this.visibleLinesCount;switch(this.textObjectType){case 0:e=this.lines.slice(t,i).join("\n");break;case 1:var n=this.lines.getLineStartIndex(t),s=this.lines.getLineEndIndex(i-1);e=this.lines.getSliceTagText(n,s,!0);break;case 2:e=this.lines.slice(t,i).join("\n")}return e}.call(this,t);return function(t,e){switch(jn(t)){case 0:var i=(s=t.style).wordWrapWidth,n=s.wordWrapCallback;s.wordWrapWidth=0,s.wordWrapCallback=void 0,t.setText(e),s.wordWrapWidth=i,s.wordWrapCallback=n;break;case 1:var s,r=(s=t.style).wrapMode;s.wrapMode=0,t.setText(e),s.wrapMode=r;break;case 2:var o=t._maxWidth;t._maxWidth=0,t.setText(e),t._maxWidth=o}}(this.textObject,i),this.textObject.rexSizer.offsetY=e,Wn.call(this),this},preLayout:function(){return this._textLineHeight=void 0,this._textLineSpacing=void 0,this._visibleLinesCount=void 0,this._textHeight=void 0,this._textVisibleHeight=void 0,Wt.call(this),this},layoutChildren:function(){var t,e,i,n,s,r,o,h=this.left,a=this.top;(t=this.textObject).rexSizer.hidden||(n=h+(i=(e=t.rexSizer).padding).left,s=a+i.top,r=this.width-i.left-i.right,o=this.height-i.top-i.bottom,function(t,e,i){if(i+=this.textLineHeight+this.textLineSpacing,this.textObjectWidth!==e||this.textObjectHeight!==i){switch(this.textObjectWidth=e,this.textObjectHeight=i,this.textObjectType){case 0:case 1:t.setFixedSize(e,i);var n=t.style,s=Math.max(e,0);0===this.textObjectType?n.wordWrapWidth=s:(0===n.wrapMode&&(n.wrapMode=1),n.wrapWidth=s);break;case 2:t.setMaxWidth(e)}this.setText()}}.call(this,t,r,o),zt(t,n,s,r,o,e.align),e.preOffsetY=0,Wn.call(this),this.textMask&&(this.textMask.setPosition().resize(),this.resetChildPositionState(this.textMask)))}},Un=Phaser.Utils.Objects.IsPlainObject,Jn=Phaser.Utils.Objects.GetValue,Kn=Phaser.Display.Align.TOP_LEFT,Zn=function(){y(d,fi);var c=b(d);function d(t,e,i,n,s,r){var o;f(this,d),Un(e)?(e=Jn(r=e,"x",0),i=Jn(r,"y",0),n=Jn(r,"width",void 0),s=Jn(r,"height",void 0)):Un(n)&&(n=Jn(r=n,"width",void 0),s=Jn(r,"height",void 0)),(o=c.call(this,t,e,i,n,s,r)).type="rexTextBlock",o.textObject=void 0,o.linesCount=0,o.textMask=void 0,o.textObjectType=void 0,o._textLineHeight=void 0,o._textLineSpacing=void 0,o._visibleLinesCount=void 0,o._textHeight=void 0,o._textVisibleHeight=void 0,o.lines=void 0,o.text=Jn(r,"content",""),o._textOY=0,o.execeedTopState=!1,o.execeedBottomState=!1,o.setClampMode(Jn(r,"clamplTextOY",!0));var h=Jn(r,"background",void 0),a=Jn(r,"text",void 0);void 0===a&&(a=qn(t));var l=Jn(r,"textMask",!0);h&&o.addBackground(h),o.add(a),o.sizerChildren=[a];var u=o.getSizerConfig(a);return u.align=Kn,u.padding=Dt(0),u.expand=!0,o.textObject=a,o.textObjectType=jn(a),u.preOffsetY=0,u.offsetY=0,l&&(o.textMask=function(t,e,i,n){var s=new In(e,i,n);if(t&&!t.isRexSizer){var r=s.createGeometryMask();t.setMask(r),this.once("destroy",function(){t.setMask(),r.destroy()})}return this.pin(s),s}.call(m(o),o.textObject,m(o))),o.addChildrenMap("background",h),o.addChildrenMap("text",a),o}return i(d,[{key:"destroy",value:function(t){if(this.scene){if(this.textObject=void 0,this.textMask=void 0,this.lines){switch(this.textObjectType){case 0:this.lines.length=0;break;case 1:this.lines.destroy();break;case 2:this.lines.length=0}this.lines=void 0}k(g(d.prototype),"destroy",this).call(this,t)}}},{key:"setClampMode",value:function(t){return void 0===t&&(t=!0),this.clampTextOY=t,this}},{key:"textLineHeight",get:function(){if(void 0===this._textLineHeight){var t;switch(this.textObjectType){case 0:case 1:var e=this.textObject.style;t=e.metrics.fontSize+e.strokeThickness;break;case 2:var i=this.textObject.fontSize/this.textObject.fontData.size;t=this.textObject.fontData.lineHeight*i}this._textLineHeight=t}return this._textLineHeight}},{key:"textLineSpacing",get:function(){if(void 0===this._textLineSpacing){var t;switch(this.textObjectType){case 0:case 1:t=this.textObject.lineSpacing;break;case 2:t=0}this._textLineSpacing=t}return this._textLineSpacing}},{key:"visibleLinesCount",get:function(){return void 0===this._visibleLinesCount&&(this._visibleLinesCount=Math.floor(An.call(this,this.textObjectHeight))),this._visibleLinesCount}},{key:"topTextOY",get:function(){return 0}},{key:"bottomTextOY",get:function(){return-this.textVisibleHeight}},{key:"textHeight",get:function(){return void 0===this._textHeight&&(this._textHeight=Xn.call(this,this.linesCount)),this._textHeight}},{key:"textVisibleHeight",get:function(){if(void 0===this._textVisibleHeight){var t,e=this.textHeight,i=this.textObjectHeight-this.textLineHeight-this.textLineSpacing;t=i<e?e-i:0,this._textVisibleHeight=t}return this._textVisibleHeight}},{key:"textOYExceedTop",value:function(t){return void 0===t&&(t=this.textOY),t>this.topTextOY}},{key:"textOYExeceedBottom",value:function(t){return void 0===t&&(t=this.textOY),t<this.bottomTextOY}},{key:"textOY",get:function(){return this._textOY},set:function(t){var e=this.topTextOY,i=this.bottomTextOY,n=this.textOYExceedTop(t),s=this.textOYExeceedBottom(t);this.clampTextOY&&(this.visibleLinesCount>this.linesCount?t=0:n?t=e:s&&(t=i)),this._textOY!==t&&(this._textOY=t,this.updateTextObject()),n&&(this.execeedTopState||this.emit("execeedtop",this,t,e)),this.execeedTopState=n,s&&(this.execeedBottomState||this.emit("execeedbottom",this,t,i)),this.execeedBottomState=s}},{key:"setTextOY",value:function(t){return this.textOY=t,this}},{key:"t",get:function(){var t=this.textVisibleHeight;return 0===t?0:this.textOY/-t},set:function(t){this.textOY=-this.textVisibleHeight*t}},{key:"setTextOYByPercentage",value:function(t){return this.t=t,this}}]),d}(),qn=function(t){return t.add.text(0,0,"")};Object.assign(Zn.prototype,Bn);var $n=Phaser.Utils.Objects.GetValue,Qn=function(){y(p,Rn);var v=b(p);function p(t,e){var i;f(this,p),void 0===e&&(e={});var n=$n(e,"text",void 0),s=$n(e,"textWidth",void 0),r=$n(e,"textHeight",void 0),o=$n(e,"textMask",!0),h=$n(e,"content",""),a=new Zn(t,{width:s,height:r,text:n,textMask:o,content:h,clamplTextOY:$n(e,"clamplChildOY",!1)});t.add.existing(a);var l,u=void 0===s?1:0,c=void 0===r;l=a,Object.defineProperty(l,"childOY",{configurable:!0,get:function(){return l.textOY},set:function(t){l.textOY=t}}),Object.defineProperty(l,"topChildOY",{get:function(){return l.topTextOY}}),Object.defineProperty(l,"bottomChildOY",{get:function(){return l.bottomTextOY}}),e.scrollMode=0,e.type="rexTextArea",e.child={gameObject:a,proportion:u,expand:c};var d=$n(e,"space",void 0);return d&&(d.child=d.text),(i=v.call(this,t,e)).addChildrenMap("text",n),i}return i(p,[{key:"text",get:function(){return this.childrenMap.child.text}},{key:"linesCount",get:function(){return this.childrenMap.child.linesCount}},{key:"contentHeight",get:function(){return this.childrenMap.child.textHeight}}]),p}(),ts={setText:function(t){return this.childrenMap.child.setText(t),this.resizeController(),this},appendText:function(t){return this.setText(this.text+t),this}};return Object.assign(Qn.prototype,ts),Qn});
  